美文网首页
2019-01-01

2019-01-01

作者: faraway_com | 来源:发表于2019-01-01 20:16 被阅读8次

    swift第三方框架导入步骤:

    This is what I completely did for ios-10.2 and Xcode -:8.2.1 (This works great)

    1. create a project.

    2. Go to terminal

    3. give command cd desktop(if project on desktop)

    4. cd project name

    5. pod init(This created pod file in directory)

    6. use this pod fie-:

    Uncomment the next line to define a global platform for your project

    platform :ios, '10.2'

    Comment the next line if you're not using Swift and don't want to use dynamic frameworks

    def shared_pods
    use_frameworks!
    pod 'Alamofire', '~> 4.4'
    pod 'SwiftyJSON'
    end
    target 'Modes' do

    Pods for Modes

    shared_pods
    end
    target 'ModesTests' do
    inherit! :search_paths

    Pods for testing

    shared_pods

    end

    target 'ModesUITests' do
    inherit! :search_paths
    # Pods for testing
    shared_pods

    end
    MARK-: I added use_frameworks under function shared_pods ( That allowed me to use frameworks) don't put it outside it.

    1. Save pod file

    2. pod install

    3. Close Terminal and all open projects .

    4. Go to project directory and open Projectname.xcworkspace.

    5. First Clean and Build.

    6. import Alamofire

    7. Bravo use your frameworks.

    相关文章

      网友评论

          本文标题:2019-01-01

          本文链接:https://www.haomeiwen.com/subject/enlolqtx.html