GoogleMaps没有CocoaPods [英] GoogleMaps without CocoaPods
本文介绍了GoogleMaps没有CocoaPods的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将 GoogleMaps
添加到我的iOS项目中,但我不想使用 CocoaPods
。有没有办法实现呢?
I would like to add GoogleMaps
to my iOS project but I don't want to use CocoaPods
. Is there any way to achieve that?
推荐答案
当然有:
- Immediate answer: https://www.gstatic.com/cpdc/0646cf0bd434ed77-GoogleMaps-1.10.1.tar.gz (Download and unzip it)
我是怎么做的(对你需要的任何库都有用)
- 转到你需要的吊舱,在这种情况下: https://cocoapods.org/pods/GoogleMaps
- 点击查看Podspec 链接在右下角的图书馆下面
- 你将被带到podspec.json
- 在JSON的最后,找到密钥源并使用提供的URL下载SDK。
- Go to the pod you need, in this case: https://cocoapods.org/pods/GoogleMaps
- Click on "See Podspec" link below Library on the bottom right corner
- You are gonna be taken to the podspec.json
- At the end of the JSON, find the key "source" and use the url provided to download the SDK.
如果您需要有关如何手动安装它的说明,你可以使用waybackmachine网站并输入相应的网址,设置提前约会。我会为您节省一些时间:
以旧方式添加Google地图:
Adding Google Maps the old way:
- 启动Xcode并打开现有项目或创建新项目。
- 如果您是iOS用户,请创建单视图应用程序,并确保启用使用自动引用计数。
- AVFoundation.framework
- CoreData.framework
- CoreLocation.framework
- CoreText.framework
- GLKit.framework
- ImageIO.framework
- libc ++。dylib
- libicucore.dylib
- libz。 dylib
- OpenGLES.framework
- QuartzCore.framework
- SystemConfiguration.framework
- AVFoundation.framework
- CoreData.framework
- CoreLocation.framework
- CoreText.framework
- GLKit.framework
- ImageIO.framework
- libc++.dylib
- libicucore.dylib
- libz.dylib
- OpenGLES.framework
- QuartzCore.framework
- SystemConfiguration.framework
- 在其他链接器标志部分中,添加
-ObjC
。如果看不到这些设置,请将Build Settings栏中的过滤器从Basic更改为All。
- 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.
-
#import< GoogleMaps / GoogleMaps.h>
- 将以下内容添加到
应用程序:didFinishLaunchingWithOptions:
方法,用API密钥替换API_KEY。[GMSServices提供APIKey:@API_KEY];
#import <GoogleMaps/GoogleMaps.h>
- Add the following to your
application:didFinishLaunchingWithOptions:
method, replacing API_KEY with your API key.[GMSServices provideAPIKey:@"API_KEY"];
#import< GoogleMaps / GoogleMaps.h>
将以下内容添加到您的应用程序:didFinishLaunchingWithOptions:
方法,用您的API密钥替换 API_KEY
。
Add the following to your application:didFinishLaunchingWithOptions:
method, replacing API_KEY
with your API key.
[GMSServices provideAPIKey:@"API_KEY"];
这篇关于GoogleMaps没有CocoaPods的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文