Use PDFloraButton.swift class to add flora button over any view using minimum lines of code. You can add images also to the surrounding buttons by sending an array of images string. Hence! let you use easily.
center, topLeft, topRight, bottomLeft, bottomRight, midTop, midBottom, midLeft, midRight
import UIKit
class ViewController: UIViewController {
let floraButton = PDFloraButton(withPosition: .center, size: 50.0, numberOfPetals: 20, images:[]) let floraButton2 = PDFloraButton(withPosition: .topLeft, size: 50.0, numberOfPetals: 4, images:[]) let floraButton3 = PDFloraButton(withPosition: .topRight, size: 50.0, numberOfPetals: 4, images:[]) let floraButton4 = PDFloraButton(withPosition: .bottomLeft, size: 50.0, numberOfPetals: 4, images:[]) let floraButton5 = PDFloraButton(withPosition: .bottomRight, size: 50.0, numberOfPetals: 4, images:[])
override func viewDidLoad() { super.viewDidLoad() self.view.addSubview(floraButton) self.view.addSubview(floraButton2) self.view.addSubview(floraButton3) self.view.addSubview(floraButton4) self.view.addSubview(floraButton5)
floraButton.buttonActionDidSelected = { (indexSelected) in debugPrint("Selected Index: (indexSelected)") } } }
https://medium.com/@iopriyam93/ios-coordinate-system-trigonometry-5432c05909b1
To run the example project, clone the repo, and run pod install
from the Example directory first.
FloraButton is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'FloraButton'
PriyamDutta, priyam.sm93@gmail.com
FloraButton is available under the MIT license. See the LICENSE file for more info.