SFSlideableButton 0.0.5

SFSlideableButton 0.0.5

发布会 维护。



SFSlideableButton

什么是 SFSlideableButton?

SFSlideableButton 是一个可滑动按钮,以确保用户不会意外执行操作。

如何使用 SFSlideableButton?

SFSlideableButton 可以通过 Cocoapod 获取。在 Podfile 中复制以下行添加 Pod:

 pod 'SFSlideableButton' 

运行以下命令使用库

 pod install

如果您的项目没有 Podfile,则可以通过 pod init 创建 Podfile。您也可以通过将源文件添加到您的项目中手动集成

示例用法

通过界面构建器或程序化方式添加按钮。在界面构建器中将 SFSlideableButton 类分配给您按钮的身份检查器中。在程序化方式中创建 FSlideableButton 的出口。通过代理获取按钮滑动回调
让您的按钮符合 SFSlideableButtonDelegate 并实现方法

     func didButtonSlides(sender:UIView){}

最后将您的 viewControllor 或自定义视图分配给 SFSlideableButtonDelegate

   yourButton.delegate = self

或者通过闭包方式

    yourButton.didButtonSlides = {
        // Implemetation goes here
    }

自定义属性

属性 描述 通过IB可用
slideTitle 按钮标题即 "滑动到行动" 的标题
slideTitleColor 按钮文本颜色即 .white
slideImage 滑动按钮左滑部分的图像
slideButtonFont 按钮标题的字体
roundCornerRadius 按钮的圆角半径即 5

演示