【文件属性】:
文件名称:CountryRest:使用免费restcountries.eu api的iOS应用
文件大小:16KB
文件格式:ZIP
更新时间:2021-05-16 22:51:38
Objective-C
乡村休息
使用免费的restcountries.eu api的iOS应用。
###步骤1:
初始化Pod以获取Podfile pod init
将AFNetworking添加到Podfile pod 'SVProgressHUD'
运行pod install命令pod install
###第2步:
添加一个对象
属性:名称,首都,人口
添加initWithDictionary
添加一个CountryController
添加带有完成处理程序的getCountriesWithName:方法
- (void)getCountriesWithName:(NSString *)name completion:(void (^)(NSArray *countries))completion;
该方法应创建一个NSURLSessionDataTask,然后解析响应
###第四步:
【文件预览】:
CountryRest-master
----.gitignore(495B)
----CountryRest.xcodeproj()
--------project.xcworkspace()
--------project.pbxproj(19KB)
--------xcuserdata()
----README.md(1KB)
----CountryRest()
--------main.m(348B)
--------CRViewController.h(226B)
--------CRViewController.m(508B)
--------Images.xcassets()
--------CRAppDelegate.m(2KB)
--------CountryRest-Prefix.pch(344B)
--------Base.lproj()
--------en.lproj()
--------CRAppDelegate.h(288B)
--------CountryRest-Info.plist(1KB)
----CountryRestTests()
--------CountryRestTests-Info.plist(695B)
--------en.lproj()
--------CountryRestTests.m(655B)