Basic iOS framework construction/and international operations, ios framework

Source: Internet
Author: User

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.

 

 

 

 

 

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.