Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adventam10/amclockview
AMClockView is a view can select time.
https://github.com/adventam10/amclockview
clock ios swift swift4
Last synced: about 1 month ago
JSON representation
AMClockView is a view can select time.
- Host: GitHub
- URL: https://github.com/adventam10/amclockview
- Owner: adventam10
- License: mit
- Created: 2018-01-06T15:23:37.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-10-14T11:32:46.000Z (about 5 years ago)
- Last Synced: 2024-10-03T09:22:18.883Z (about 1 month ago)
- Topics: clock, ios, swift, swift4
- Language: Swift
- Homepage: https://qiita.com/am10/items/0222e6966d58062d2eca
- Size: 175 KB
- Stars: 60
- Watchers: 9
- Forks: 10
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AMClockView
![Pod Platform](https://img.shields.io/cocoapods/p/AMClockView.svg?style=flat)
![Pod License](https://img.shields.io/cocoapods/l/AMClockView.svg?style=flat)
[![Pod Version](https://img.shields.io/cocoapods/v/AMClockView.svg?style=flat)](http://cocoapods.org/pods/AMClockView)
[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Swift Package Manager compatible](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)`AMClockView` is a view can select time.
## Demo
![amclock](https://user-images.githubusercontent.com/34936885/34641894-0adbf71a-f34e-11e7-892a-86e5f3e51256.gif)
## Usage
Create clockView.
```swift
let clockView = AMClockView(frame: view.bounds)// customize here
clockView.delegate = self
view.addSubview(clockView)
```Conform to the protocol in the class implementation.
```swift
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.```swift
@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](https://user-images.githubusercontent.com/34936885/66701955-20c3c680-ed3d-11e9-8e17-03544afab1bf.png)
## Installation
### CocoaPods
Add this to your Podfile.
```ogdl
pod 'AMClockView'
```### Carthage
Add this to your Cartfile.
```ogdl
github "adventam10/AMClockView"
```## License
MIT