HAActionSheet 0.1.9

HAActionSheet 0.1.9

测试已测试
语言语言 SwiftSwift
许可 MIT
发布最新发布2017年10月
SwiftSwift 版本4.0
SPM支持 SPM

Hasan Ali Asan 维护。



  • by
  • hasanlsn

这个工具是一个为 iOS 定制的动态操作表,使用 Swift 3.0 编写。

App Video

要求

  • iOS 8.0+
  • Xcode 8.1, 8.2, 8.3, 和 9.0
  • Swift 3.0, 3.1, 3.2, 和 4.0

用法

import UIKit
import HAActionSheet

class ViewController: UIViewController {
  let data = ["Apple",
              "Orange",
              "Banana",
              "Berry"]

  override func viewDidLoad() {
    super.viewDidLoad()

    let view = HAActionSheet(fromView: self.view, sourceData: data)
    view.buttonCornerRadius = 16
    view.show { (canceled, index) in
      if !canceled {
        print(self.data[index!])
      }
    }
  } 
}

选项

/// title for cancel button, default is "Cancel"
public var cancelButtonTitle: String

/// corner radius for cancel button, first and last button, default is 16.0
public var buttonCornerRadius: CGFloat

/// font for header title, default is UIFont.boldSystemFont(ofSize: 17)
public var headerTitleFont: UIFont

/// font for header message, default is UIFont.systemFont(ofSize: 14)
public var headerMessageFont: UIFont

/// header background color, default is white
public var headerBackgroundColor: UIColor

/// header text color, default is black
public var headerTextColor: UIColor

/// font for button titles, default is system font
public var titleFont: UIFont

/// cancel button title color, default is red
public var cancelButtonTitleColor: UIColor

/// cancel button background color, default is white
public var cancelButtonBackgroundColor: UIColor

/// button title color, default is blue
public var buttonTitleColor: UIColor

/// button background color, default is white
public var buttonBackgroundColor:UIColor

/// button seperator color, default is #EDEDEF
public var seperatorColor: UIColor

待办事项

  • 全面支持 iPad
  • 更多动画