IOS programming ideas, ios Programming

Source: Internet
Author: User

IOS programming ideas, ios Programming

From today on, I want to enter the door of the IOS architecture. I have been focusing on learning third-party frameworks. I think the framework is also a little bit of code. I only need to master the code, but the process of code is the most important, and it is impossible to achieve perfection overnight. There is no shortcut to perfection, however, learning a third-party framework will undoubtedly allow you to achieve your goal in less time.

 

Therefore, a good learning framework is definitely a paving stone on the road to success.

 

Today, I have a little understanding of IOS's programming ideas. I will take a note here, and the following exercises will be king:

1. chained programming ideas:
Just like the pipeline, the output in the previous step serves as the input in the next step, that is, the return value in the previous step serves as the call object in the next step, so that all calls can pass. to avoid redundant code.
Eg: view. setFrame (0, 0, 50). setBackgroundColor (@ "# 0c0c0c". toColor ());

Because oc is only available for attributes. method. Therefore, you can only define setFrame and setBackgroundColor as attributes and block the attributes with parameters. Therefore, the operation method defines these two block attributes in the extension of UIView, block is modified using the copy attribute.

Eg: Masonry framework

2. Functional programming ideas:
The difference between nested calls of functions or methods and chained programming is that chained programming is an operation on Attribute blocks, while functional programming is a parameter on blocks or functions, and return the operations of a series of functions of the object.
Eg: Masonry framework

3. responsive programming:
There is no call sequence. One event is completed, and many other tasks are automatically implemented.
Eg: The ReactiveCocoa framework combines functional programming and responsive programming.

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.