I am making an app for iOS using mapkit. I want to limit the boundaries of the map only to a specific region/country. Is there a way to do this?
相关问题
- 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
- Get the NSRange for the visible text after scroll
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Xcode: Is there a way to change line spacing (UI L
- Swift - hide pickerView after value selected
- How do you detect key up / key down events from a
- didBeginContact:(SKPhysicsContact *)contact not in
There's no way to tell the map not to scroll out of a certain area. The only way I could think to do it would be to stop the user from scrolling when you hit one of your fences. The example below is written without testing or compiling at all so you may need to tweek it yourself but hopefully it'll get you started..
ViewController.h
ViewController.m
Part of this comes from this answer: Getting the bounds of an MKMapvIew
Here is a further specification of the previous answer. Note that this will be different for different parts of the world: