2017-06-21 135 views
-5

enter image description here我在我的應用程序中有一個位置。我想製作一個按鈕,將此位置發送到其他應用,例如Google地圖或wa。。我怎樣才能做到這一點?如何從swift中將應用程序發送到其他應用程序?

+0

試試這個:https://stackoverflow.com/a/42971577/5447966 –

+0

這不是我想要的。我想要像我添加的照片。 – SinaSB

回答

1

創建一個ActionSheet,就像您在圖像中添加的一樣。

而列表中的類似的GoogleMaps,Google地圖,Waze的 所有的應用程序做點擊以下..

BOOL canHandle = [[UIApplication sharedApplication] canOpenURL: [NSURL URLWithString:@"comgooglemaps:"]]; 

if (canHandle) { 
UIApplication.shared.openURL(URL(string: 
      "comgooglemaps://?center=\(self.location.coordinate.latitude),\(self.location.coordinate.longitude)&zoom=14&views=traffic&q=\(self.location.coordinate.latitude),\(self.location.coordinate.longitude)")! 
} else { 

//show alert to install googlemaps 

} 
相關問題