KO
|
EN
gitlite — search
Search
#typescript
#ai-agents
#ai
#dsh-plugin
#deepseek-harness
#open-source
#cli
#claude-code
#codex
#developer-tools
#react
#windows
MSBlockButton
★ 350
Open GitHub ↗
No description available.
Download README (.md)
Explore Similar Repositories
lantern
:
Data exploration glue
modernmt
:
Neural Adaptive Machine Translation that adapts to context and learns from corrections.
ytk-learn
:
Ytk-learn is a distributed machine learning library which implements most of popular machine learning algorithms(GBDT, GBRT, Mixture Logistic Regression, Gradient Boosting Soft Tree, Factorization Machines, Field-aware Factorization Machines, Logistic Regression, Softmax).
MEVHorizontalContacts
:
An iOS UICollectionViewLayout subclass to show a list of contacts with configurable expandable items.
ng-http-loader
:
:dango: Smart angular HTTP interceptor - Intercepts automagically HTTP requests and shows a spinkit spinner / loader / progress bar
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
MSBlockButton
?
Download (.md)
# MSBlockButton [](https://www.apple.com/nl/ios/) [](https://github.com/JZJJZJ/MSBlockButton/blob/master/LICENSE) [](https://github.com/JZJJZJ/MSBlockButton.git)  [](https://github.com/JZJJZJ/MSBlockButton.git) An UIButton Category replace SEL with Block. ## Features - block syntax ## Installation ### Cocoapods(Recommended) 1. Add `pod 'MSBlockButton'` to your Podfile. 2. Run `pod install` ### Manual 1. Add all files under `MSBlockButton ` to your project ## Requirements - iOS 5.0 and greater - ARC/MRC ## How To Use ### Objective-C ```objc #import "MSBlockButton.h" CGFloat width = [UIScreen mainScreen].bounds.size.width; UIButton* button = [UIButton buttonWithType:UIButtonTypeCustom]; button.frame = CGRectMake((width-100)*0.5, (width-100)*0.5, 100, 100); [self.view addSubview:button]; button.backgroundColor = [[UIColor orangeColor] colorWithAlphaComponent:0.8]; [button setTitle:@"Blocks" forState:UIControlStateNormal]; [button handleTouchUpInsideEventWithBlock:^(UIButton *sender) { NSLog(@"%s",__func__); }]; ``` ### Swift You can use MSBlockButton in Swift projects too. To do this, you must: 1. Copy the relevant .m and .h files from the MSBlockButton src folder into your project 2. If prompted to create a "bridging header", you should do so. If not prompted and if you don't already have a bridging header, add one. For more information on bridging headers, see [Swift and Objective-C in the Same Project](https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html#//apple_ref/doc/uid/TP40014216-CH10-XID_76). 3. In your bridging header, add a line that says: ```objc #import "MSBlockButton.h" ``` If you do the above, you can then write Swift code that uses MSBlockButton. For example, in Swift 3.0 : ```swift let btn = UIButton(frame: CGRect(origin: CGPoint.zero, size: CGSize(width: 100, height: 100))) btn.center = view.center btn.backgroundColor = UIColor.purple btn.setTitle("SwiftVC", for: UIControlState.normal) view.addSubview(btn) btn.handleTouchUpInsideEvent { (btn:UIButton?) in print("\("SwiftViewController") \(#function)") } ``` ## License MSBlockButton is available under the MIT license. See the LICENSE file for more info.