DirectionButton 0.0.9

DirectionButton 0.0.9

zhouqitian 维护。



  • zhouqitian

DirectionButton

Contents

要求

  • iOS 10.0+
  • Xcode 9.0+
  • Swift 4.2+

通信

  • 如果您 发现了错误,请提交一个 issue。
  • 如果您 有功能请求,请提交一个 issue。
  • 如果您 想做出贡献,请提交一个 pull request。

安装

CocoaPods

CocoaPods 是 Cocoa 项目的依赖管理工具。您可以使用以下命令安装它:

$ gem install cocoapods

构建 DirectionButton 0.0.4 需要 CocoaPods 1.1.0+。

要使用 CocoaPods 将 SnapKit 集成到您的 Xcode 项目中,请在您的 Podfile 中指定它。

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'DirectionButton', '~> 0.0.4'
end

然后,运行以下命令:

$ pod install

Carthage

Carthage 是一个去中心化的依赖管理器,它构建您的依赖并提供二进制框架。

您可以使用以下命令通过 Homebrew 来安装 Carthage:

$ brew update
$ brew install carthage

要使用 Carthage 将 SnapKit 集成到您的 Xcode 项目中,请在您的 Cartfile 中指定它。

github "DirectionButton/DirectionButton" ~> 0.0.4

运行 carthage update 来构建框架,并将构建好的 SnapKit.framework 拖入您的 Xcode 项目中。

手动

如果您不希望使用上述提到的任何依赖管理器,您可以手动将 DirectionButton 集成到您的项目中。


使用方法

快速开始

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        let btn = DirectionButton.init(frame: CGRect.init(x: 100, y: 100, width: 200, height: 200))
        btn.tapDelegate = self
        
        view.addSubview(btn)
    }


}

extension ViewController: DirectionButtonDelegate{
    func didTapDirectionButton(direction: ButtonDirection) {
        // Tap DirectionButton Action
    }
    
    func didTapCenterButton() {
        // Tap CenterButton Action
        
    }
}

致谢

  • zhouqitian ([@zhouqitian])
  • 许多其他贡献者

许可证

DirectionButton 软件许可协议遵循MIT协议。有关详细信息,请参阅LICENSE文件。