如果没有 pod 安装,如何在 swift 中获得位置选择器



我已经安装了 pod,但现在我想再添加一个 pod'GMSPlacePickerController',过去我已经更改了我的项目名称,所以每当我尝试安装 pod 时,有时找不到 pod 文件,有时会发生其他错误。所以我只想要谷歌地方选择器,没有安装豆荚。

来自 https://developers.google.com/places/ios-api/start

This guide shows how to manually add the GooglePlaces framework to your project and configure your build settings in Xcode.
1. Download the SDK source files:
 - GooglePlaces-2.5.0
 - GoogleMaps-2.5.0
 - GooglePlacePicker-2.5.0
 - GooglePlacePicker-2.5.0 is only needed if you are using the place picker.
2. Unpack the source files.
3. Launch Xcode and either open an existing project, or create a new project. If you're new to iOS, create a Single View Application, and disable Use Storyboards and enable Use Automatic Reference Counting.
4. Remove any Maps bundles from previous releases from your project.
5. Drag the following bundles into your project (when prompted, select Copy items if needed):
- GooglePlaces-2.5.0/Frameworks/GooglePlaces.framework
- GoogleMaps-2.5.0/Base/Frameworks/GoogleMapsBase.framework
If you are using the place picker, drag the following bundles into your project (in addition to the previously listed bundles):
- GooglePlacePicker-2.5.0/Frameworks/GooglePlacePicker.framework
- GoogleMaps-2.5.0/Maps/Frameworks/GoogleMapsCore.framework
- GoogleMaps-2.5.0/Maps/Frameworks/GoogleMaps.framework
6. Right-click GooglePlaces.framework in your project, and select Show In Finder.
7. Drag the GooglePlaces.bundle from the Resources folder into your project. When prompted, ensure Copy items into destination group's folder is not selected.
8. If you are using the place picker, repeat the previous step and drag the GoogleMaps.bundle and GooglePlacePicker.bundle files into your project. These can be found in the GoogleMaps.framework and GooglePlacePicker.framework respectively.
9. Select your project from the Project Navigator, and choose your application's target.
10. Open the Build Phases tab, and within Link Binary with Libraries, add the following frameworks:
 - GooglePlaces.framework
 - GoogleMapsBase.framework
 - GooglePlacePicker.framework (only if using the place picker)
 - GoogleMapsCore.framework (only if using the place picker)
 - GoogleMaps.framework (only if using the place picker)
 - Accelerate.framework
 - CoreData.framework
 - CoreGraphics.framework
 - CoreLocation.framework
 - CoreTelephony.framework
 - CoreText.framework
 - GLKit.framework
 - ImageIO.framework
 - libc++.tbd
 - libz.tbd
 - OpenGLES.framework
 - QuartzCore.framework
 - SystemConfiguration.framework
 -  UIKit.framework
11. Choose your project, rather than a specific target, and open the Build Settings tab.
12. In the Other Linker Flags section, add -ObjC. If these settings are not visible, change the filter in the Build Settings bar from Basic to All.

最新更新