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.