amc

AMClockView

AMClockView is a view can select time.

Showing:

Popularity

Downloads/wk

0

GitHub Stars

58

Maintenance

Last Commit

2yrs ago

Contributors

3

Package

Dependencies

0

License

MIT

Categories

Readme

AMClockView

Pod Platform Pod License Pod Version Carthage Compatible Swift Package Manager compatible

AMClockView is a view can select time.

Demo

amclock

Usage

Create clockView.

let clockView = AMClockView(frame: view.bounds)

// customize here

clockView.delegate = self
view.addSubview(clockView)

Conform to the protocol in the class implementation.

func clockView(_ clockView: AMClockView, didChangeDate date: Date) { 
    // use selected date here
}

The hour hand moves when you dragged inside of central circle.

The minute hand moves when you draged outside of central circle.

Customization

AMClockView can be customized via the following properties.

@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 = 5.0
@IBInspectable public var minuteHandWidth: CGFloat = 3.0
@IBInspectable public var clockBorderLineColor: UIColor = .black
@IBInspectable public var centerCircleLineColor: UIColor = .darkGray
@IBInspectable public var hourHandColor: UIColor = .black
@IBInspectable public var minuteHandColor: 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 isShowSelectedTime: Bool = false
public var clockType = AMCVClockType.arabic
public var timeZone: TimeZone?  // default is TimeZone.current
public var selectedDate: Date?

clock

Installation

CocoaPods

Add this to your Podfile.

pod 'AMClockView'

Carthage

Add this to your Cartfile.

github "adventam10/AMClockView"

License

MIT

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100