项目作者: tapptitude

项目描述 :
Fortune spinning wheel that supports custom drawing.
高级语言: Swift
项目地址: git://github.com/tapptitude/TTFortuneWheel-iOS.git
创建时间: 2017-10-31T09:46:27Z
项目社区:https://github.com/tapptitude/TTFortuneWheel-iOS

开源协议:MIT License

下载


TTFortuneWheel-iOS


Platform
Version
License
Twitter

About

Fortune spinning wheel that supports custom drawing and dynamic content.

This project is maintained by Tapptitude, a mobile app development agency specialized in building high-quality iOS and Android mobile apps, for startups and brands alike. A lively team of skilled app developers and app designers based in Europe, we provide full-stack mobile app development services to entrepreneurs looking to innovate on mobile.

Features:

  • Dynamic content
  • Each slice can have it’s own style and angle
  • Drawn and animated using CoreGraphics
  • Customize(Font, Slice Color, Stroke, Frame color, width and shadow)
  • Predictible rotation to any slice
  • Exposes methods for custom Core Graphics drawings for each slice
  • Dynamic size

Requirements

  • iOS 9.0+
  • Xcode 8.2+

Installation

CocoaPods

Swift 5.0

  1. pod 'TTFortuneWheel'

Swift 4.2

  1. pod 'TTFortuneWheel', '~>0.1.6'

Swift 4.0

  1. pod 'TTFortuneWheel', '~>0.1.5'

Carthage

  1. github "tapptitude/TTFortuneWheel-iOS"

Manually

Add contents of TTFortuneWheel folder to your project.

Usage

You can place the FortuneWheel in your storyboard or add it as sa subview programatically.

  1. override func viewDidLoad() {
  2. super.viewDidLoad()
  3. let slices = [ FortuneWheelSlice(title: "Slice 1"),
  4. FortuneWheelSlice(title: "Slice 2"),
  5. FortuneWheelSlice(title: "Slice 3")]
  6. let fortuneWheel = TTFortuneWheel(frame: frame, slices:slices)
  7. spinningWheel.equalSlices = true
  8. self.view.addSubview(fortuneWheel)
  9. }

How to customize?

In order to provide custom drawing for slices you have to implement FortuneWheelSliceProtocol.
or can use the preconfiugred FortuneWheelSliceImpl class.

Contribution

Feel free to Fork, submit Pull Requests or send us your feedback and suggestions!

License

TTFortuneWheel is available under the MIT license. See the LICENSE file for more info.