Basic iOS framework construction/and international operations, ios framework
1. Basic Framework Construction
1.1 pod introduces common third-party class libraries
1.2 create a basic folder structure/directory structure
Resource --- stores audio, images, xib, storyboard, and other Resource files
Define -- macro definition, common constants/common methods
Category-Category, mainly for third-party framework encapsulation/Additional addition of system class methods
View -- place a View inherited from UIView, such as Cell...
ViewController -- put the class of inheritance and UIViewcontroller
Model -- network resolution type
NetManager-network requests
Factory -- Factory method class/tool class
Vendor-third-party class libraries (pod class libraries are not supported)
ViewModel-view model-(MVVM design mode)
1.3 create a base class file
ViewController
BaseViewController: UIViewController
Model
BaseModle: NSObject
ViewModel
BaseViewModel: NSObject
NetManager
BaseNetManager: NSObject
Factory
Factory: NSObject
Define
Constants. h --> select Header to create
Methods. h ---> select Header to create
1.4 directory file Adjustment
Info. plist pch-> supporting files
Storyboard xib images-> resource
ViewController-> ViewController
1.5 configure the pch File
Introduce common Class header files
Ps: In the appdelegate file, call any method contained in the header file in the following pch file and compile it with cmd + B. After the compilation is complete, the pch file will receive code prompts.
1.6 modify the minimum version number-> generally, it is backward compatible with one version.
Development Target: 7.0
1.7 disable landscape screens-based on actual needs, landscape screens are rare
1.8 choose universal for device devices: supports both pad and iphone
1.9 add Chinese support
Project-> info-> localizations point +, add chinese (simplicity) Simplified chinese
2. International Operations
2.1 to Project-> info-> localization click + to add Chinese support
2.2 create a file resource-> strings. click the "localized" button on the right to change the file to an international file. After the modification is completed, there will be an arrow that can be expanded in front of the file 2.3 For the name Localizable. strings file with optimized code
2.4 special InfoPlist. strings files are required for internationalization of info. plist files.