Swift语言实现的天气软件
使用了百度的天气API,需要在SwiftWeather / ViewController.swift中的let ak = " "填写申请到的ak,ak需要到『天气API』网页自行申请
以下引用自『参考』:
- Swift Programming Language
- CocoaPods
- AFNetworking
- Core Location
Because the app uses CocoaPods, we need to run pod install
to install all the pods.
- Open Terminal app.
- Change directory to the project folder.
cd $project_dir
- List
ls
all the file to check whether Podfile file is in the folder? - If the Podfile has been found, then execute
pod install
- If the Mac OS doesn't have CocoaPods installed. Please follow CocoaPods Getting Started to install.
- Once complete installation, open Swift Weather.xcworkspace file with Xcode 6.
- Press Cmd + B to build the app.
- Press Cmd + R to run the app on Simulator.