goal: IOs app framing.
method: the resource file is packaged into a bundle, and other logical implementations are packaged into a framework static framework.
preparation:
an app with basic functions
1, which packages resource files to generate resource files such as bundle
target files: pictures and screen XIB
establishment project: File-> ? New -> Project? -> ? macOS -> Framework & Library -> Bundle
Copy the imported resource file:
Modify the BaseSDK of the project TARGETS to IOS:
At this point, the project has been established, and the compilation project generates a. bundle file
Right-click. bundle-> Show in finder can find the generated bundle
2, and the logical implementation is encapsulated into a static framework
Target file:. m .h file
Establishment project: File-> ? New -> Project? -> ? iOS -> Framework & Library -> ? Cocoa Touch Framework
Copy the imported resource file:
Add BundleTools to obtain the resource file
Bundletools.h
Bundletools.m
Modify the imported. m file, and add init and initWithNibName methods to obtain the resources in the bundle when it is initialized.
At this point, the project has been established, and the compilation project generates a. framework file
Right-click. framework-> Show in finder can find the generated framework
3, build a test project
copy and import the framework and bundle
project TARGETS -> Embedded Binaries -> ? Add a framework
to create a test screen, and use the framework function
to complete the framing of the OS app, and run it to achieve the effect.