Latest 2.3.9
Homepage https://github.com/godL/StreamKit
License MIT
Platforms ios 8.0, requires ARC
Frameworks UIKit
Authors

============

License MIT 
CocoaPods 
CocoaPods 
Support 

A chain-programming framework for iOS.

Installation

CocoaPods

  1. Add pod 'StreamKit' to your Podfile.
  2. Run pod install or pod update.
  3. Import <StreamKit/StreamKit.h>.

Usage

Basic

//(Create a UILabel)
UILabel* label = [UILabel new];//UILabel.new
label.sk_frame(CGRectZero)
.sk_fontSize(15)
.sk_textAlignment(NSTextAlignmentCenter)
.sk_textColor([UIColor redColor])
.sk_text(@"a label")
.sk_addSimpleClickAction(^{
    //click action
});
[self.view addSubview:label];

//event block(create a button)
UIButton* button = [UIButton buttonWithType:UIButtonTypeCustom];
button.sk_frame(CGRectMake(100, 100, 100, 100))
.sk_setTitleNormal(@"a button")
.sk_setTitleColorNormal([UIColor redColor])
.sk_setFontSize(15)
.sk_addEventBlock(UIControlEventTouchDown,^(UIButton* button){

})
.sk_addEventBlock(UIControlEventTouchUpInside,^(UIButton* button){

})
.sk_addEventBlock(UIControlEventTouchUpOutside,^(UIButton* button){

});
[self.view addSubview:button];

//delegate block(create a textField)
UITextField* textField = UITextField.sk_init(CGRectZero)
.sk_textColor([UIColor blackColor])
.sk_fontSize(15)
.sk_placeholder(@"begin")
.sk_addEventBlock(UIControlEventEditingChanged,^(UITextField* textField){

})
.sk_textFieldShouldReturn(^BOOL(UITextField* textField){
    return YES;
})
.sk_textFieldShouldBeginEditing(^BOOL(UITextField* textField){
    return YES;
})
.sk_textFieldShouldChangeCharactersInRange(^BOOL(UITextField* textField,NSRange range,NSString* string){
    return YES;
});
[self.view addSubview:textField];

//KVO
label.sk_addObserverWithKeyPath(@"text",^(NSDictionary* change){

});

//NSNotification
NSNotificationCenter* defaultNotification = [NSNotificationCenter defaultCenter];
defaultNotification.sk_addNotification(UITextFieldTextDidChangeNotification,^(NSNotification* noti){

})
.sk_addNotification(UITextFieldTextDidEndEditingNotification,^(NSNotification* noti){

});

License

StreamKit is provided under the MIT license. See LICENSE file for details.

Latest podspec

{
    "name": "StreamKit",
    "version": "2.3.9",
    "summary": "A streaming programming framework for UIKit.",
    "homepage": "https://github.com/godL/StreamKit",
    "license": "MIT",
    "authors": {
        "GodL": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/godL/StreamKit.git",
        "tag": "2.3.9"
    },
    "source_files": [
        "StreamKit",
        "StreamKit/StreamKit.h"
    ],
    "public_header_files": "StreamKit/StreamKit.h",
    "frameworks": "UIKit",
    "requires_arc": true,
    "subspecs": [
        {
            "name": "Core",
            "source_files": "StreamKit/Core/*.{h,m}",
            "public_header_files": "StreamKit/Core/*.h",
            "dependencies": {
                "StreamKit/Marco": []
            }
        },
        {
            "name": "Marco",
            "source_files": "StreamKit/Marco/*.h",
            "public_header_files": "StreamKit/Marco/*.h"
        },
        {
            "name": "UI",
            "dependencies": {
                "StreamKit/Core": []
            },
            "public_header_files": "StreamKit/UI/*.h",
            "source_files": "StreamKit/UI/*.{h,m}"
        }
    ]
}

Pin It on Pinterest

Share This