LinkBlock and ioslinkblock for iOS chained programming framework

Source: Internet
Author: User

LinkBlock and ioslinkblock for iOS chained programming framework

LinkBlock for iOS chained Programming

First of all, thank you for helping me find the stars.

[LinkBlock GitHub download]

From the context, objc is one of the very strange languages. If you don't have an apple to keep it up, it's just an extension of textbooks. The most intuitive feeling is that there are more than three brackets in the brackets.

Therefore, we have completed a Link Block Extension framework covering the fundamentals. Basically, common methods in development can be used in this version.

The entire framework is based on the expansion of NSObject. All methods rely on the extended attributes. They are block types.

The statement is simple and in one breath, reducing the hassle of creating ideas and interrupting it:

@"0xff22cc".strToColorFromHexStr();btn.viewSetFrame(20,20,150,80).viewBGColor(@"0xff22cc".strToColorFromHexStr()).viewAddToView(self.view).btnTitle(@"click change color", UIControlStateNormal);NSComparisonResult result = @"".setTo(&str).strAppend(@"abc1.txt").strCompareNumberSensitive(@"abc2.txt");

The framework considers the security of the objc value. To ensure that the program does not crash because the program gets an abnormal value from the network, the Framework provides the following values:

dict.dictGetNoNSNull(@"key");dict.dictGetBOOLNoNullType(@"key");dict.dictGetArrNoNullType(@"key");dict.dictGetViewNoNullType(@"key");

This is also an example of learning Block usage.

At the same time, I want to explain why NSObject is extended. This is to solve the problem of call failure in a chain call. Two points must be done before it will crash. First, all objects respond to all extended attributes, this ensures that the call will not crash when the object is not empty. Second, the nil guy cannot be passed in the intermediate link of the chain. You know that [nil XXFuntion] won't crash, but nil. XXProperty will crash. Therefore, only when an error object of a single instance is passed in the middle can we ensure that the chain will not crash and will be used in the last step. For the sake of security, the only additional requirement of the framework is to use end () for calling in the last part. All processes are safe and fast.

In addition to arrays, dictionaries, and strings, the framework also adds views and common animations. However, it does not provide special functions for lightweight and easy to understand.

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.