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.