there are two more settings
(1)click the project-> Build Phases -> link Binary With Libraries -> click “+” -> search for “location” -> click the CoreLocation.framework, import the library to your project
(2)find info.plist,and add two keys and values
the first key is :NSLocationWhenInUseUsageDescription, you can put whatever you want in the value field to explain your reason to request user location,such as”Because I want to know where you are”. this can help you to request user location when the app is running.
the second key is:NSLocationAlwaysUsageDescription,you can puts reasons in the value field such as”Because I always want to know your locations”,this can help you in any time to get the user location ,even the app is not running.
(1)sudo gem install cocoapods
platform :ios, ‘8.0’
target ‘MyApp’ do
pod ‘AFNetworking’, ‘~> 2.6’
pod ‘ORStackView’, ‘~> 3.0’
pod ‘SwiftyJSON’, ‘~> 2.3’
(5)$ pod install
(7)Now you can import your dependencies e.g.:
如果在swift项目中使用ios的控件，不要忘记写转换文件，Create Bridge Header,
之后需要在Build setting下的Swift Compiler-Code Generation里配置下bridge header路径。
To import Objective-C code into Swift from the same target
In your Objective-C bridging header file, import every Objective-C header you want to expose to Swift. For example:
In Build Settings, in Swift Compiler – Code Generation, make sure the Objective-C Bridging Header build setting under has a path to the bridging header file.
The path should be relative to your project, similar to the way your Info.plist path is specified in Build Settings. In most cases, you should not need to modify this setting.