Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexdenisov/bindabletypes
Binding CocoaTouch controls to Foundation data types
https://github.com/alexdenisov/bindabletypes
Last synced: about 1 month ago
JSON representation
Binding CocoaTouch controls to Foundation data types
- Host: GitHub
- URL: https://github.com/alexdenisov/bindabletypes
- Owner: AlexDenisov
- Created: 2012-04-05T11:16:01.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-04-11T17:18:52.000Z (over 12 years ago)
- Last Synced: 2024-10-05T22:32:01.195Z (about 2 months ago)
- Language: Objective-C
- Homepage:
- Size: 156 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Bindable Foundation data types
### About
The framework consists of two class-clusters - BTNumber and BTString.
These classes allow you to bind Foundation data types with CocoaTouch controls without any delegates.### Features
- Binding in one string
- Only actual values at any time**BTString**: allows to bind NSString with UITextField or UITextView.
**BTNumber**: NSNumber binds with UISlider, UISwitch or UIStepper.### Installation
git clone [email protected]:AlexDenisov/BindableTypes.git
Open with XCode and build BuildFramework target.
The BindableTypes.framework will be located in ~/Products/, this path can be changed in the shell-script in the Settings tab of target.
Open your project Settings and add BindableTypes.framework to Link Binary With Libraries section.### Usage
Syntax is simple and clean.
These features very useful with your models.Order.h
@interface Order : NSObject
...
@property (nonatomic, retain) BTString *productName;
@property (nonatomic, retain) BTNumber *count;
...
@endOrder.m
@implementation Order
...
@synthesize productName;
@synthesize count;
...
@endEditOrderViewController.h
...
@property (nonatomic, retain) IBOutlet UITextField *productNameTextField;
@property (nonatomic, retain) IBOutlet UISlider *countSlider;
@property (nonatomic, retain) Order *order;
...
EditOrderViewController.m
...
- (void)viewDidLoad {
...
self.order.productName = [BTString stringWithTextField:self.productNameTextField
withString:self.order.productnName.stringValue];
self.order.count = [BTNumber numberWithSlider:self.countSlider
withNumber:self.order.count.numberValue];
...
}
...Now you always have the actual values: in the model and in view.
### Contacts
Bugs, questions and suggestions please send to [email protected]