I am struggling to unearth a standard way to drop a pin on a MkMapView based on a touch input. There probably isnt a standard way, but it is always worth asking. If I have to implement this myself is the best approach to add a Gesture Recogniser to pick up a tap on the map view.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Could I create “Call” button in HTML 5 IPhone appl
- 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
Yes, you can use a
UILongPressGestureRecognizer
to do this.This previous answer of mine has details with sample code:
How to add a push pin to a MKMapView(IOS) when touching?
To animate the drop, in
viewForAnnotation
, return anMKPinAnnotationView
withanimatesDrop
set to YES.I know that the Maps app has a separate button (under the curl of the map) that drops a pin. Hence that is kind of how I do it (though not under the map curl). I have not read anywhere that there is a standard but I have not read all 12,000 GB of documentation (ha ha). I would say to check out some of the "standard" apps like Maps and follow what they do just to be consistent. I know that typically a double tap zooms the map so I'm not sure that I would use that. Just my $0.02...