Swift: using private framework

后端 未结 2 1578
天涯浪人
天涯浪人 2021-02-07 23:56

I have built an iOS Swift framework with Xcode.

After writing the code I have build the project and took the .framework file inside the Products folder to test it.

2条回答
  •  一向
    一向 (楼主)
    2021-02-08 00:16

    To actual a self defined framework, u really have to do a lot of things.

    Firstly, make sure ur framework is used on right device. It's to say framework can only be used on corresponding device(either one of Simulator, Device and Mac). In other words, if framework A built on simulator, project import framework A can only pass compile and successfully built on simulator.

    P.S. if universal version desired, -lipo command is what u need to further explore.

    Secondly, during implementing ur framework , make sure all the classes, methods and variables u want use outside start with Public.

    Thirdly, check ur project setting Embedded Binaries and linked Frameworks and Libraries do contain ur framework.

提交回复
热议问题