Hatch 1.0.11

Hatch 1.0.11

‘KuDji’维护。



Hatch 1.0.11

CocoaPods Compatible Platform Twitter

要求

  • iOS 10.0+
  • Xcode 10.1+
  • Swift 4.2+

安装

CocoaPods

CocoaPods是Cocoa项目的依赖管理器。有关使用和安装说明,请访问他们的网站。要使用CocoaPods将Hatch集成到您的Xcode项目中,请在您的Podfile中指定它

pod 'Hatch'

如何做

使用标题、图片和按钮形成警告框

var hatch: Hatch!

func presentHatch() {
    let batchViewWidth: CGFloat = 300
    let titleText = "Title Text Example!"
    let textColor = UIColor.black
    let imageExmple = UIImage(named: "Ouroboros")
    let imageClose = UIImage(named: "Close")
    let imageSize = CGSize(width: 50, height: 50)
    let buttonText = "Done"

    let config = HatchConfigurator()
    let batchView = HatchBench(sizeWidth: batchViewWidth)
    let closeView = HatchCloseMark(image: imageClose, size: CGSize(width: 28, height: 28))
    hatch = Hatch(bench: batchView, closeMark: closeView, configuraction: config, onView: self.view)
    let hatchLabel = HatchLabel(text: titleText, color: textColor)
    let hatchImage = HatchUIImageView(image: imageExmple, size: imageSize)
    let hatchButoon = HatchButton(text: buttonText, action: #selector(test))

    hatch.addImage(hatchImage)
    hatch.addLabel(hatchLabel)
    hatch.addButton(hatchButoon)

    hatch.present()
}

@objc func test() {
    print("Success")
}

许可协议

Hatch遵循MIT许可协议。请查看LICENSE.md以获取详细信息。

联系

如果您需要联系我的 推主