How Do I add Pins (Annotations) with Xcode 6 (Swift)

后端 未结 2 621
旧巷少年郎
旧巷少年郎 2021-02-02 14:56

I\'m new to the swift language, and haven\'t done an application with mapkit yet. But I have the map and regions set, but I\'m hung up on how to allow users to add pins. Let me

2条回答
  •  别那么骄傲
    2021-02-02 15:20

    You will need to call a method for when and where the user needs to add the pin. If you want it to add a pin where the user taps and holds on the map, you will need to call a gestureRecognizer, but if you want to do it via a button you will obviously just call that in an action. Either way the documentation for adding pins is throughly discussed Here

提交回复
热议问题