AMNowClockView
AMNowClockView
是一个可以显示当前时间的视图。
演示
使用方法
let clockView = AMNowClockView(frame: view.bounds)
// customize here
view.addSubview(clockView)
定制
AMNowClockView
可以通过以下属性进行定制。
@IBInspectable public var clockBorderLineWidth: CGFloat = 5.0
@IBInspectable public var smallClockIndexWidth: CGFloat = 1.0
@IBInspectable public var clockIndexWidth: CGFloat = 2.0
@IBInspectable public var hourHandWidth: CGFloat = 3.5
@IBInspectable public var minuteHandWidth: CGFloat = 3.0
@IBInspectable public var secondHandWidth: CGFloat = 1.5
@IBInspectable public var clockBorderLineColor: UIColor = .black
@IBInspectable public var hourHandColor: UIColor = .black
@IBInspectable public var minuteHandColor: UIColor = .black
@IBInspectable public var secondHandColor: UIColor = .black
@IBInspectable public var selectedTimeLabelTextColor: UIColor = .black
@IBInspectable public var timeLabelTextColor: UIColor = .black
@IBInspectable public var smallClockIndexColor: UIColor = .black
@IBInspectable public var clockIndexColor: UIColor = .black
@IBInspectable public var clockColor: UIColor = .clear
@IBInspectable public var clockImage: UIImage?
@IBInspectable public var minuteHandImage: UIImage?
@IBInspectable public var hourHandImage: UIImage?
@IBInspectable public var secondHandImage: UIImage?
@IBInspectable public var isShowSelectedTime: Bool = false
public var clockType: AMNCClockType = .arabic
/// Time zone
///
/// default is TimeZone.current
public var timeZone: TimeZone?
设置时区(自 2.1 版本起)
clockView.timeZone = TimeZone(identifier: "GMT")
安装
CocoaPods
将此内容添加到您的 Podfile 中。
pod 'AMNowClockView'
Carthage
将此内容添加到您的 Cartfile 中。
github "adventam10/AMNowClockView"
许可协议
MIT