There is so much information and learning material available now that it is sometimes hard to know where to start or what is the best place to go especially if you are just starting out or moving onto the next level. Well for me the place I always go to first and keep returning to […]
Month: August 2016
UIView UITapGestureRecognizer
Adding a UITapGestureRecognizer to a UIView is very straighforward. All you do is setup the gesture and then assign it to the view. Could not be much easier could it.
1 2 |
let tapRecogniser = UITapGestureRecognizer(target: self, action: #selector(ViewController.viewPressed(_:))) myView.addGestureRecognizer(tapRecogniser) |
There are a couple of points just to hightlight. Firstly if you are using a UIImageView then you will need to add in the […]
UIPopoverController height
A recent project I worked on required a number of UIPopoverController screens. The api allows the implementation of these very easily in just a couple of lines as below:
1 2 3 4 5 |
let popoverViewController = UIPopoverController(contentViewController: viewController) popoverViewController.presentPopoverFromRect(CGRect(x: 195, y: 0, width: 60.0, height: 20), inView: sender, permittedArrowDirections: .Up, animated: true) |
Here i create a UIPopoverController when a button is pressed, using the sender button to presentPopoverFromRect. But what if you want to amend the size […]