2017-06-21 140 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 

} 
相关问题