简体   繁体   English

通过位置动态更改UITableViewController

[英]Changing a UITableViewController dynamically via location

I am in the process of building an app, for the record I am using the code from the ECSlidingView controller. 我正在构建一个应用程序,为了进行记录,我正在使用ECSlidingView控制器中的代码。 I would like for my app to use the GPS to pull data from my web interface letting the user know that they can do certain things at a given location. 对于我的应用程序,我希望使用GPS从我的Web界面中提取数据,让用户知道他们可以在给定位置执行某些操作。 So for example, I have a user go to a store and lets say I want them to make a payment at that location, it will given them that option. 例如,我有一个用户去一家商店,假设我希望他们在该地点付款,它将为他们提供选择。 Or if the store doesn't offer payment through the app, I disable that. 或者,如果商店不通过该应用程序提供付款,我将其禁用。 What would be a good way to go about this? 什么是解决这个问题的好方法?

You could try using CoreLocation but you might have trouble getting accurate location inside (it will most probably use wifi or cellular info so the accuracy might not be what you expect). 您可以尝试使用CoreLocation但可能无法获得准确的内部位置(它很可能会使用wifi或手机信息,因此准确度可能不是您所期望的)。 Then, when you get the location, issue a request to your service passing latitude and longiude you receive from CoreLocation . 然后,当您获取位置时,向您的服务发出请求,以传递您从CoreLocation接收到的纬度和CoreLocation There, you should search by location to retrieve possible matches - consider returning muliple store infos for nearby stores due to the accuracy issues. 在那儿,您应该按位置搜索以检索可能的匹配项-由于准确性问题,请考虑返回附近商店的多个商店信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM