I have been trying to set up a UIImageView that will allow the user to select an image from their apple watch and then display it to the UIImageView. However, I have not been successful at my attempts to solve this. There are only examples of how to do this for a phone.
I have tried the examples that explain how to get an image from the photo library and then display it to a UIImageView but for a phone which has not worked when trying to do the same thing but for the apple watch.
Here is an example of what people have been doing to try and accomplish this issue but for the phone and NOT the apple watch
class ViewController: UIImagePickerController, UINavigationControllerDelegate, UIImagePickerControllerDelegate {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func tableView(tableView: UITableView!, didSelectRowAtIndexPath indexPath: NSIndexPath!) {
var imagePickerController = UIImagePickerController()
imagePickerController.delegate = self
imagePickerController.sourceType = UIImagePickerControllerSourceType.SavedPhotosAlbum
imagePickerController.allowsEditing = true
self.presentViewController(imagePickerController, animated: true, completion: { imageP in
})
}
func imagePickerController(picker: UIImagePickerController!, didFinishPickingImage image: UIImage!, editingInfo: NSDictionary!) {
let selectedImage : UIImage = image
println(selectedImage)
}
}
The expected result is being able to click a button linked to the UIImageView and then the photo library pops up and allows me to select an image which will then be displayed to the UIImageView.
The Apple Watch platform doesn't have an equivalent UIImagePickerController. All you can do is file a suggestion to Apple in Feedback Assistant that such a component would be useful to you. It would be a user experience challenge for them to get the watchOS image picker thumbnails both sufficiently visible and scrollable, but you might as well let them know since they do read feedback and respond.