mirror of
https://github.com/wahyd4/Yep.git
synced 2026-08-10 21:36:49 +10:00
enable sendButton after didUpdateUserLocation
This commit is contained in:
@@ -194,6 +194,7 @@
|
||||
</navigationItem>
|
||||
<connections>
|
||||
<outlet property="mapView" destination="N6L-U8-EFf" id="xfc-We-pFG"/>
|
||||
<outlet property="sendButton" destination="Dek-I8-RQb" id="pzq-pU-tOf"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="b42-ms-7Bt" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
|
||||
@@ -11,7 +11,7 @@ import MapKit
|
||||
|
||||
class PickLocationViewController: UIViewController {
|
||||
|
||||
|
||||
@IBOutlet weak var sendButton: UIBarButtonItem!
|
||||
@IBOutlet weak var mapView: MKMapView!
|
||||
|
||||
var isFirstShowUserLocation = true
|
||||
@@ -22,6 +22,8 @@ class PickLocationViewController: UIViewController {
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
sendButton.enabled = false
|
||||
|
||||
mapView.showsUserLocation = true
|
||||
mapView.delegate = self
|
||||
|
||||
@@ -57,7 +59,6 @@ class PickLocationViewController: UIViewController {
|
||||
mapView.addAnnotation(pin)
|
||||
|
||||
userPickedLocationPin = pin
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,6 +69,8 @@ extension PickLocationViewController: MKMapViewDelegate {
|
||||
if isFirstShowUserLocation {
|
||||
isFirstShowUserLocation = false
|
||||
|
||||
sendButton.enabled = true
|
||||
|
||||
let location = userLocation.location
|
||||
let region = MKCoordinateRegionMakeWithDistance(location.coordinate, 2000, 2000)
|
||||
mapView.setRegion(region, animated: true)
|
||||
|
||||
Reference in New Issue
Block a user