WWRotaryWheel
一個滾輪Tab按鈕
使用範例
import UIKit
import WWRotaryWheel
class ViewController: UIViewController {
@IBOutlet weak var myRotaryWheel: WWRotaryWheel!
@IBOutlet weak var myLabel: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
myRotaryWheel.delegate = self
// myRotaryWheel.imageSetting([#imageLiteral(resourceName: "list"), #imageLiteral(resourceName: "like"), #imageLiteral(resourceName: "meeting"), #imageLiteral(resourceName: "plus"), #imageLiteral(resourceName: "check-mark")])
myRotaryWheel.titleSetting(["🐶", "🐭", "👻", "🦊", "🐼"])
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
}
extension ViewController: WWRotaryWheelDelegate {
func wwRotaryWheel(_ wwRotaryWheel: WWRotaryWheel, clickedItemAt index: Int, for buttons: [UIButton]) {
myLabel.text = index.description
}
func wwRotaryWheel(_ wwRotaryWheel: WWRotaryWheel, selectedItemAt index: Int, for buttons: [UIButton]) {
for button in buttons { button.backgroundColor = .clear }
buttons[index].backgroundColor = .yellow
}
}