Reputation: 352
Using CoreGraphics, I am able to get click location.
My requirement is to open different UIViewController
base on clicks on different areas of an image.
Upvotes: 1
Views: 120
Reputation: 61774
You need to create a new UIViewController
base on location of your touch using one of the following:
Create it manually
let controller = SubclassViewController()
//prepare your view controller here
Instantiate controller from storyboard
if let controller = storyboard.instantiateViewControllerWithIdentifier("identifier") as? SubclassViewController {
//prepare your view controller here
}
Perform segue to new view controller
performSegueWithIdentifier("segueIdentifier")
Then prepare your view controller within prepareForSegue:
if let controller = segue.destinationViewController as? SubclassViewController {
//prepare your controller here
}
Depending on what your app is doing, you can either to push your new view controller or present it manually
Upvotes: 1