Latest 0.1.0
Homepage https://github.com/svenfy/FYSwitch
License MIT
Platforms ios 9.0
Dependencies pop, AHEasing, ReactiveCocoa
Frameworks UIKit
Authors

CI Status
Version
License
Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Usage

将Switch背景和边框抽象出来复用,并提供IB实时预览;可使用以下预定义的效果,也可参照示例自行扩充。
IB

SwitchBackground

  • FYBgPure – 纯色背景;不变换
  • FYBgLinearChange – 纯色背景;提供线性变换
  • FYBgGradientChange – 渐变背景;提供线性变换
  • FYBgPointScale – 从一点扩张&收缩到一点

SwitchBorder

  • FYBorderPure – 纯色边框;不变换
  • FYBorderLinearChange – 纯色边框;提供线性变换
  • FYBorderLineStroke – 纯色边框;线条动画
  • FYBorderLineStrokeSpring – 纯色边框;线条动画

FYImageTextSwitch => 支持纯文字或图像Knob的IBInspectable

Demo中效果的简要说明

FYImageTextSwitch + FYBgPure + FYBorderPure + FY2DRotateKnob

01

FYSwitch + FYBgPure + FYBorderPure + FY3DSpringRotateKnob

02

FYSwitch + FYBgPure + FYBorderPure + FY3DBlinkRotateKnob

03

FYSwitch + FYBgPure + FYBorderPure + FYLineStrokeKnob

04

FYSwitch + FYDayNightBg1 + FYBorderLinearChange + FYDayNightKnob1

05

FYSwitch + FYDayNightBg2 + FYBorderLineStroke + FYDayNightKnob2

06

FYSwitch + FYBorderLineStrokeSpring + FYDayNightKnob3

07

FYImageTextSwitch + FYBgGradientChange + FYBorderLinearChange + FYScaleKnob

08

FYSwitch + FYPushKnobBg + FYPushKnob

09

FYSwitch + FYBgPure + FYCapsuleKnob

10

Requirements

iOS 9.0+
Swift 4.0

Installation

FYSwitch is available through CocoaPods. To install
it, simply add the following line to your Podfile:

platform :ios, '9.0'
use_frameworks!

pod 'FYSwitch'

post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['CONFIGURATION_BUILD_DIR'] = '$PODS_CONFIGURATION_BUILD_DIR'
        end
    end
end

Author

Jedark, [email protected]

License

FYSwitch is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "FYSwitch",
    "version": "0.1.0",
    "summary": "Custom Switch",
    "description": "various animation and UI style for Switch",
    "homepage": "https://github.com/svenfy/FYSwitch",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Jedark": "[email protected]"
    },
    "source": {
        "git": "https://github.com/svenfy/FYSwitch.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "FYSwitch/Classes/**/**/**/**/*.{swift}",
    "resources": "FYSwitch/Assets/**/*.{png}",
    "frameworks": "UIKit",
    "dependencies": {
        "pop": [],
        "AHEasing": [],
        "ReactiveCocoa": []
    },
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This