I am trying to create a progress circle for the Apple Watch version of my app. I know that we aren\'t able to use UIViews (which would make things so much easier!) so I am l
Nobody posts code??? Here it is! enjoy:
1) Create the images here: http://hmaidasani.github.io/RadialChartImageGenerator/
2) Drag n Drop a picker into your View Controller, and link it to some viewController.swift file. Set the Picker style to "Sequence" on the menu that appears on the right.
3) Add this code to the viewController.swift , and connect the picker to the IBOutlet and the IBAction:
import WatchKit
import Foundation
class PickerViewController: WKInterfaceController {
override func awakeWithContext(context: AnyObject?) {
super.awakeWithContext(context)
}
@IBOutlet var itemPicker: WKInterfacePicker!
override func willActivate() {
super.willActivate()
let pickerItems: [WKPickerItem] = (0...100).map {
let pickerItem = WKPickerItem()
pickerItem.contentImage = WKImage(imageName: "singleArc\($0).png")
return pickerItem
}
itemPicker.setItems(pickerItems)
}
@IBAction func pickerSelectedItemChanged(value: Int) {
NSLog("Sequence Picker: \(value) selected.")
}
override func didDeactivate() {
super.didDeactivate()
}
}