I'm developing an application to display a gallery of UIImages
by using a UIScrollView
, my question is, how to tap to zoom
and double tap to zoom
out, how does it work when handling with UIScrollView
.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
- How can I add media attachments to my push notific
Swift 3.0 version that zooms twice on double tap.
Somewhere (usually in viewDidLoad):
Handler:
You need to implement UITapGestureRecognizer - docs here - in your viewController
Basically this code is saying that when a
UITapGesture
is registered inself.view
the method tapOnce or tapTwice will be called inself
depending on if its a single or double tap. You therefore need to add these tap methods to yourUIViewController
:Hope that helps