2017-04-12 6 views
0

GoogleMapsSDKの使用中に奇妙な問題に直面しています。 Google Mapを表示している私の見解では、ナビゲーションコントローラが組み込まれています。ナビゲーションバーには、新しいビューに接続したバーボタンがあります。ボタンを押すと、セグが遅くなり、内容が表示されません。ここでiOS - GoogleMaps SDKを使用中にSegueの問題が発生する

は何が起こっているかである:http://gph.is/2putLtQ

ない問題が何であるかを確認してください。 GoogleMapsSDKを実装せずに同じ設定を行っています。

import UIKit 
import GoogleMaps 

class GoogleMapsViewController: UIViewController, CLLocationManagerDelegate, GMSMapViewDelegate { 

    var locationManager = CLLocationManager() 
    var tacoLocations = [TacoLocation]() 
    var tacoLocationPlace_id :String! 

    override func viewDidLoad() { 
     super.viewDidLoad() 

     self.locationManager = CLLocationManager() 
     self.locationManager.delegate = self 
     self.locationManager.desiredAccuracy = kCLLocationAccuracyBest 
     self.locationManager.distanceFilter = kCLDistanceFilterNone 
     self.locationManager.requestWhenInUseAuthorization() 
     self.locationManager.startUpdatingLocation() 

     let lat = self.locationManager.location?.coordinate.latitude 
     let lng = self.locationManager.location?.coordinate.longitude 


     // creates the map and zooms the current user location, at a 15.0 zoom 
     let camera = GMSCameraPosition.camera(withLatitude: lat!, longitude: lng!, zoom: 15.0) 
     let mapView = GMSMapView.map(withFrame: CGRect.zero, camera: camera) 
     view = mapView 

     for location in self.tacoLocations { 

      let marker = GMSMarker() 

      let lat = location.locationLat 
      let lng = location.locationLng 

      marker.position = CLLocationCoordinate2D(latitude: lat!, longitude: lng!) 
      marker.title = location.name 

      if location.open_now == false { 
       marker.snippet = "\(location.vicinity!)\nClosed" 
      } else if location.open_now == true { 
       marker.snippet = "\(location.vicinity!)\nOpen" 
      } else { 

      } 
      marker.userData = location 

      marker.icon = UIImage(named: "taco_marker.png") 
      marker.infoWindowAnchor = CGPoint(x: 0.5, y: 0.2) 

      marker.map = mapView 
     } 
     // enable my location dot 
     mapView.isMyLocationEnabled = true 
     mapView.delegate = self 

    } 

    //MARK: GMSMapViewDelegate 

    func mapView(_ mapView: GMSMapView, markerInfoWindow marker: GMSMarker) -> UIView? { 
     let customWindow = Bundle.main.loadNibNamed("CustomInfoWindow", owner: self, options: nil)?.first as! CustomInfoWindow 

     customWindow.nameLabel.text = marker.title 
     customWindow.addressLabel.text = marker.snippet 

     return customWindow 
    } 

    func mapView(_ mapView: GMSMapView, didTapInfoWindowOf marker: GMSMarker) { 

     let tacoLocation = marker.userData as! TacoLocation 
     self.tacoLocationPlace_id = tacoLocation.place_id 

     DispatchQueue.main.async { 
      self.performSegue(withIdentifier: "MoreInfoSegue", sender: self) 
     } 
    } 

    override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 


     if segue.identifier == "MoreInfoSegue" { 


      let tabVC = segue.destination as! UITabBarController 
      let moreInfoVC = tabVC.viewControllers?[0] as! MoreInfoViewController 
      let reviewVC = tabVC.viewControllers?[1] as! ReviewViewController 

      moreInfoVC.tacoLocationPlace_id = self.tacoLocationPlace_id 
      reviewVC.tacoLocationPlace_id = self.tacoLocationPlace_id 

     } else if segue.identifier == "ARSegue" { 

      //segue to new view that is not working correctly. 

     } 

    } 
} 

第2のビューコントローラで唯一のものがあるのviewDidLoad:

はここでGoogleマップのビューコントローラです。

ご協力いただきありがとうございます。

答えて

0

Googleマップのポッドをアンインストールしてから再インストールしました。それが私の問題を解決しました。 xcodeのバグだったはずです。

関連する問題