Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/escoz/QuickDialog
Browse files Browse the repository at this point in the history
Conflicts:
	QuickDialog.xcodeproj/project.pbxproj
	quickdialog/QRadioSection.h
  • Loading branch information
HiveHicks committed Apr 4, 2012
2 parents a84e4cc + 66e1ce3 commit ff1e45f
Show file tree
Hide file tree
Showing 48 changed files with 428 additions and 63 deletions.
20 changes: 20 additions & 0 deletions QuickDialog.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@
D8F180E813F0599A009B0CC6 /* QTableViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = D8F180E813F0599A009B0CC5 /* QTableViewCell.h */; };
D8F180E813F0599A009B0CC8 /* NSMutableArray+MoveObject.m in Sources */ = {isa = PBXBuildFile; fileRef = D8F180E813F0599A009B0CC7 /* NSMutableArray+MoveObject.m */; };
D8F180E813F0599A009B0CCA /* NSMutableArray+MoveObject.h in Headers */ = {isa = PBXBuildFile; fileRef = D8F180E813F0599A009B0CC9 /* NSMutableArray+MoveObject.h */; };
D8F180E813F0599A009B0CCC /* QPickerElement.m in Sources */ = {isa = PBXBuildFile; fileRef = D8F180E813F0599A009B0CCB /* QPickerElement.m */; };
D8F180E813F0599A009B0CCE /* QPickerElement.h in Headers */ = {isa = PBXBuildFile; fileRef = D8F180E813F0599A009B0CCD /* QPickerElement.h */; };
D8F180E813F0599A009B0CD0 /* jsonremote.json in Resources */ = {isa = PBXBuildFile; fileRef = D8F180E813F0599A009B0CCF /* jsonremote.json */; };
D8F180E813F0599A009B0CD2 /* QuickDialogWebController.m in Sources */ = {isa = PBXBuildFile; fileRef = D8F180E813F0599A009B0CD1 /* QuickDialogWebController.m */; };
D8F180E813F0599A009B0CD4 /* QuickDialogWebController.h in Headers */ = {isa = PBXBuildFile; fileRef = D8F180E813F0599A009B0CD3 /* QuickDialogWebController.h */; };
F2E6149E151C9E4D00F36976 /* QSelectSection.h in Headers */ = {isa = PBXBuildFile; fileRef = F2E6149C151C9E4D00F36976 /* QSelectSection.h */; };
F2E6149F151C9E4D00F36976 /* QSelectSection.m in Sources */ = {isa = PBXBuildFile; fileRef = F2E6149D151C9E4D00F36976 /* QSelectSection.m */; };
F2E614A2151CA1A100F36976 /* QSelectItemElement.h in Headers */ = {isa = PBXBuildFile; fileRef = F2E614A0151CA1A100F36976 /* QSelectItemElement.h */; };
Expand Down Expand Up @@ -300,6 +305,11 @@
D8F180E813F0599A009B0CC5 /* QTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = QTableViewCell.h; path = quickdialog/QTableViewCell.h; sourceTree = SOURCE_ROOT; };
D8F180E813F0599A009B0CC7 /* NSMutableArray+MoveObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSMutableArray+MoveObject.m"; path = "quickdialog/NSMutableArray+MoveObject.m"; sourceTree = SOURCE_ROOT; };
D8F180E813F0599A009B0CC9 /* NSMutableArray+MoveObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSMutableArray+MoveObject.h"; path = "quickdialog/NSMutableArray+MoveObject.h"; sourceTree = SOURCE_ROOT; };
D8F180E813F0599A009B0CCB /* QPickerElement.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = QPickerElement.m; path = quickdialog/QPickerElement.m; sourceTree = "<group>"; };
D8F180E813F0599A009B0CCD /* QPickerElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = QPickerElement.h; path = quickdialog/QPickerElement.h; sourceTree = "<group>"; };
D8F180E813F0599A009B0CCF /* jsonremote.json */ = {isa = PBXFileReference; lastKnownFileType = file.json; name = jsonremote.json; path = sample/Resources/jsonremote.json; sourceTree = SOURCE_ROOT; };
D8F180E813F0599A009B0CD1 /* QuickDialogWebController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = QuickDialogWebController.m; path = quickdialog/QuickDialogWebController.m; sourceTree = SOURCE_ROOT; };
D8F180E813F0599A009B0CD3 /* QuickDialogWebController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = QuickDialogWebController.h; path = quickdialog/QuickDialogWebController.h; sourceTree = SOURCE_ROOT; };
F2E6149C151C9E4D00F36976 /* QSelectSection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = QSelectSection.h; path = quickdialog/QSelectSection.h; sourceTree = SOURCE_ROOT; };
F2E6149D151C9E4D00F36976 /* QSelectSection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = QSelectSection.m; path = quickdialog/QSelectSection.m; sourceTree = SOURCE_ROOT; };
F2E614A0151CA1A100F36976 /* QSelectItemElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = QSelectItemElement.h; path = quickdialog/QSelectItemElement.h; sourceTree = SOURCE_ROOT; };
Expand Down Expand Up @@ -343,6 +353,8 @@
D80B0E2813E052DF00FA85CA = {
isa = PBXGroup;
children = (
D8F180E813F0599A009B0CCD /* QPickerElement.h */,
D8F180E813F0599A009B0CCB /* QPickerElement.m */,
2CE450A8145ADF8000B77D0E /* libQuickDialog */,
D860356713E0534000CB1785 /* quickdialog */,
D80B0E3D13E052DF00FA85CA /* sample */,
Expand Down Expand Up @@ -443,6 +455,8 @@
D860356713E0534000CB1785 /* quickdialog */ = {
isa = PBXGroup;
children = (
D8F180E813F0599A009B0CD3 /* QuickDialogWebController.h */,
D8F180E813F0599A009B0CD1 /* QuickDialogWebController.m */,
D8B394681514E8B3008ECB34 /* QSegmentedElement.m */,
D8B394671514E8B3008ECB34 /* QSegmentedElement.h */,
D8B39449151394E1008ECB34 /* QEmptyListElement.h */,
Expand Down Expand Up @@ -555,6 +569,7 @@
D86249F014BB5A64002F0585 /* json */ = {
isa = PBXGroup;
children = (
D8F180E813F0599A009B0CCF /* jsonremote.json */,
D86249F514BB5AB5002F0585 /* jsonadvancedsample.json */,
D86249F614BB5AB5002F0585 /* jsondatasample.json */,
D86249F714BB5AB5002F0585 /* loginform.json */,
Expand Down Expand Up @@ -620,6 +635,8 @@
D8B39452151394E1008ECB34 /* QMultilineElement.h in Headers */,
D8B39455151394E1008ECB34 /* QMultilineTextViewController.h in Headers */,
D8B394691514E8B3008ECB34 /* QSegmentedElement.h in Headers */,
D8F180E813F0599A009B0CCE /* QPickerElement.h in Headers */,
D8F180E813F0599A009B0CD4 /* QuickDialogWebController.h in Headers */,
F2E6149E151C9E4D00F36976 /* QSelectSection.h in Headers */,
F2E614A2151CA1A100F36976 /* QSelectItemElement.h in Headers */,
);
Expand Down Expand Up @@ -713,6 +730,7 @@
D86249FA14BB5AB5002F0585 /* jsondatasample.json in Resources */,
D86249FB14BB5AB5002F0585 /* loginform.json in Resources */,
D86249FC14BB5AB5002F0585 /* sample.json in Resources */,
D8F180E813F0599A009B0CD0 /* jsonremote.json in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -770,6 +788,8 @@
D8B39453151394E1008ECB34 /* QMultilineElement.m in Sources */,
D8B39456151394E1008ECB34 /* QMultilineTextViewController.m in Sources */,
D8B3946A1514E8B3008ECB34 /* QSegmentedElement.m in Sources */,
D8F180E813F0599A009B0CCC /* QPickerElement.m in Sources */,
D8F180E813F0599A009B0CD2 /* QuickDialogWebController.m in Sources */,
F2E6149F151C9E4D00F36976 /* QSelectSection.m in Sources */,
F2E614A3151CA1A100F36976 /* QSelectItemElement.m in Sources */,
);
Expand Down
17 changes: 15 additions & 2 deletions quickdialog/QBindingEvaluator.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ - (id)init {
return self;
}


- (void)bindObject:(id)object toData:(id)data {
if (![object respondsToSelector:@selector(bind)])
return;
Expand All @@ -47,7 +48,10 @@ - (void)bindObject:(id)object toData:(id)data {

if ([propName isEqualToString:@"iterate"] && [object isKindOfClass:[QSection class]]) {
[self bindSection:(QSection *)object toCollection:[data valueForKey:valueName]];


} else if ([propName isEqualToString:@"iterate"] && [object isKindOfClass:[QRootElement class]]) {
[self bindRootElement:(QRootElement *)object toCollection:[data valueForKey:valueName]];

} else if ([propName isEqualToString:@"iterateproperties"] && [object isKindOfClass:[QSection class]]) {
[self bindSection:(QSection *)object toProperties:[data valueForKey:valueName]];

Expand Down Expand Up @@ -82,12 +86,21 @@ - (void)bindSection:(QSection *)section toCollection:(NSArray *)items {
}
}


- (void)bindRootElement:(QRootElement *)element toCollection:(NSArray *)items {
[element.sections removeAllObjects];
for (id item in items){
QSection *section = [_builder buildSectionWithObject:element.sectionTemplate];
[element addSection:section];
[section bindToObject:item];
}
}

- (void)bindSection:(QSection *)section toProperties:(NSDictionary *)object {
[section.elements removeAllObjects];
for (id item in [object allKeys]){
QElement *element = [_builder buildElementWithObject:section.elementTemplate];
[section addElement:element];

[element bindToObject:[NSDictionary dictionaryWithObjectsAndKeys:item, @"key", [object valueForKey:item], @"value", nil]];
}
}
Expand Down
15 changes: 11 additions & 4 deletions quickdialog/QBooleanElement.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// permissions and limitations under the License.
//

#import <objc/message.h>

@implementation QBooleanElement {
__unsafe_unretained QuickDialogController *_controller;
}
Expand Down Expand Up @@ -73,15 +75,20 @@ - (void)selected:(QuickDialogTableView *)tableView controller:(QuickDialogContro
((UIImageView *)cell.accessoryView).image = _boolValue ? _onImage : _offImage;
}
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if (_sections!=nil)
[self handleElementSelected:controller];
[self handleElementSelected:controller];
}

- (void)buttonPressed:(UIButton *)boolButton {
_boolValue = !boolButton.selected;
boolButton.selected = _boolValue;
if (_controller!=nil && self.controllerAction!=nil)
[self handleElementSelected:_controller];
if (_controller!=nil && self.controllerAccessoryAction!=nil) {
SEL selector = NSSelectorFromString(self.controllerAccessoryAction);
if ([_controller respondsToSelector:selector]) {
objc_msgSend(_controller,selector, self);
} else {
NSLog(@"No method '%@' was found on controller %@", self.controllerAccessoryAction, [_controller class]);
}
}
}

- (void)switched:(id)boolSwitch {
Expand Down
1 change: 1 addition & 0 deletions quickdialog/QDateTimeElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
}

@property(nonatomic, retain) NSDate *dateValue;
@property(nonatomic, assign) NSNumber *ticksValue;

@property (assign) UIDatePickerMode mode;

Expand Down
9 changes: 8 additions & 1 deletion quickdialog/QDateTimeElement.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ - (void)setDateValue:(NSDate *)date {
[self initializeRoot];
}

- (void)setTicksValue:(NSNumber *)ticks {
[self setDateValue:[NSDate dateWithTimeIntervalSince1970:ticks.doubleValue]];
}

-(NSNumber *)ticksValue {
return [NSNumber numberWithDouble:[self.dateValue timeIntervalSince1970]];
}

- (UIDatePickerMode)mode {
return _mode;
}
Expand Down Expand Up @@ -98,7 +106,6 @@ - (void)initializeRoot {
dateForSection = NSDate.date;
}
QSection *section = [[QSection alloc] initWithTitle:(_mode == UIDatePickerModeDateAndTime ? @"\n" : @"\n\n")];

if (_mode == UIDatePickerModeDate || _mode == UIDatePickerModeDateAndTime){
QDateTimeInlineElement *dateElement = (QDateTimeInlineElement *) [[QDateTimeInlineElement alloc] initWithKey:@"date"];
dateElement.dateValue = dateForSection;
Expand Down
1 change: 1 addition & 0 deletions quickdialog/QDateTimeInlineElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
}

@property(nonatomic, retain) NSDate *dateValue;
@property(nonatomic, assign) NSNumber *ticksValue;

@property (assign) UIDatePickerMode mode;

Expand Down
9 changes: 9 additions & 0 deletions quickdialog/QDateTimeInlineElement.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ - (QDateTimeInlineElement *)initWithTitle:(NSString *)string date:(NSDate *)date
}


- (void)setTicksValue:(NSNumber *)ticks {
self.dateValue = [NSDate dateWithTimeIntervalSince1970:ticks.doubleValue];
}

-(NSNumber *)ticksValue {
return [NSNumber numberWithDouble:[self.dateValue timeIntervalSince1970]];
}

- (QDateTimeInlineElement *)initWithDate:(NSDate *)date {
return [self initWithTitle:nil date:date];
}
Expand All @@ -64,6 +72,7 @@ - (UITableViewCell *)getCellForTableView:(QuickDialogTableView *)tableView contr
cell = [[QDateEntryTableViewCell alloc] init];
}
[cell prepareForElement:self inTableView:tableView];
cell.imageView.image = self.image;
cell.selectionStyle = UITableViewCellSelectionStyleBlue ;
return cell;

Expand Down
4 changes: 3 additions & 1 deletion quickdialog/QElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
NSString * _controllerAction;
}


@property(nonatomic, copy) void (^onSelected)(void);
@property(nonatomic, retain) NSString *controllerAction;
@property(nonatomic, retain) NSString *controllerAccessoryAction;

@property(nonatomic) CGFloat height;

Expand All @@ -47,6 +47,8 @@

- (void)handleElementSelected:(QuickDialogController *)controller;

- (void)selectedAccessory:(QuickDialogTableView *)tableView controller:(QuickDialogController *)controller indexPath:(NSIndexPath *)indexPath;


- (void)selected:(QuickDialogTableView *)tableView controller:(QuickDialogController *)controller indexPath:(NSIndexPath *)indexPath;

Expand Down
18 changes: 16 additions & 2 deletions quickdialog/QElement.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
@implementation QElement {
@private
NSObject *_object;
NSString *_controllerAccessoryAction;
}

@synthesize parentSection = _parentSection;
Expand All @@ -28,6 +29,8 @@ @implementation QElement {
@synthesize controllerAction = _controllerAction;
@synthesize object = _object;
@synthesize height = _height;
@synthesize controllerAccessoryAction = _controllerAccessoryAction;


- (QElement *)init {
self = [super init];
Expand All @@ -44,7 +47,7 @@ - (QElement *)initWithKey:(NSString *)key {
- (UITableViewCell *)getCellForTableView:(QuickDialogTableView *)tableView controller:(QuickDialogController *)controller {
QTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:[NSString stringWithFormat:@"QuickformElementCell%@", self.key]];
if (cell == nil){
cell = [[QTableViewCell alloc] initWithReuseIdentifier:@"QuickformElementCell"];
cell = [[QTableViewCell alloc] initWithReuseIdentifier:[NSString stringWithFormat:@"QuickformElementCell%@", self.key]];
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.showsReorderControl = YES;
Expand All @@ -56,7 +59,7 @@ - (void)handleElementSelected:(QuickDialogController *)controller {
if (_onSelected!= nil)
_onSelected();

if (self.controllerAction!=NULL){
if (self.controllerAction!=NULL && !controller.quickDialogTableView.editing){
SEL selector = NSSelectorFromString(self.controllerAction);
if ([controller respondsToSelector:selector]) {
objc_msgSend(controller,selector, self);
Expand All @@ -66,6 +69,17 @@ - (void)handleElementSelected:(QuickDialogController *)controller {
}
}

- (void)selectedAccessory:(QuickDialogTableView *)tableView controller:(QuickDialogController *)controller indexPath:(NSIndexPath *)indexPath{
if (self.controllerAccessoryAction!=NULL){
SEL selector = NSSelectorFromString(self.controllerAccessoryAction);
if ([controller respondsToSelector:selector]) {
objc_msgSend(controller,selector, self);
} else {
NSLog(@"No method '%@' was found on controller %@", self.controllerAction, [controller class]);
}
}
}

- (void)selected:(QuickDialogTableView *)tableView controller:(QuickDialogController *)controller indexPath:(NSIndexPath *)indexPath {
[[tableView cellForRowAtIndexPath:indexPath] becomeFirstResponder];

Expand Down
2 changes: 2 additions & 0 deletions quickdialog/QEntryElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
@property(nonatomic) UIReturnKeyType returnKeyType; // default is UIReturnKeyDefault (See note under UIReturnKeyType enum)
@property(nonatomic) BOOL enablesReturnKeyAutomatically; // default is NO (when YES, will automatically disable return key when text widget has zero-length contents, and will automatically enable when text widget has non-zero-length contents)
@property(nonatomic,getter=isSecureTextEntry) BOOL secureTextEntry; // default is NO
@property(nonatomic, assign) BOOL clearsOnBeginEditing; // default is NO


- (QEntryElement *)init;

Expand Down
4 changes: 4 additions & 0 deletions quickdialog/QEntryElement.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ - (UITableViewCell *)getCellForTableView:(QuickDialogTableView *)tableView contr
cell = [[QEntryTableViewCell alloc] init];
}
cell.textField.enabled = YES;
cell.imageView.image = self.image;
[cell prepareForElement:self inTableView:tableView];
return cell;
}
Expand All @@ -77,5 +78,8 @@ - (void)fetchValueIntoObject:(id)obj {
@synthesize returnKeyType = _returnKeyType;
@synthesize enablesReturnKeyAutomatically = _enablesReturnKeyAutomatically;
@synthesize secureTextEntry = _secureTextEntry;
@synthesize clearsOnBeginEditing = _clearsOnBeginEditing;
@synthesize accessoryType = _accessoryType;


@end
17 changes: 10 additions & 7 deletions quickdialog/QEntryTableViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ -(UIToolbar *)createActionBar {
_prevNext = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObjects:NSLocalizedString(@"Previous", @""), NSLocalizedString(@"Next", @""), nil]];
_prevNext.momentary = YES;
_prevNext.segmentedControlStyle = UISegmentedControlStyleBar;
_prevNext.tintColor = [UIColor darkGrayColor];
_prevNext.tintColor = actionBar.tintColor;
[_prevNext addTarget:self action:@selector(handleActionBarPreviousNext:) forControlEvents:UIControlEventValueChanged];
UIBarButtonItem *prevNextWrapper = [[UIBarButtonItem alloc] initWithCustomView:_prevNext];
UIBarButtonItem *flexible = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
Expand Down Expand Up @@ -69,8 +69,12 @@ - (QEntryTableViewCell *)init {
}

- (CGRect)calculateFrameForEntryElement {
if (_entryElement.title == NULL) {
return CGRectMake(10,10,self.contentView.frame.size.width-10, 24);
int extra = (self.textField.clearButtonMode == UITextFieldViewModeNever) ? 10 :0;
if (_entryElement.title == NULL && _entryElement.image==NULL) {
return CGRectMake(10,10,self.contentView.frame.size.width-10-extra, self.frame.size.height-20);
}
if (_entryElement.title == NULL && _entryElement.image!=NULL){
return CGRectMake( _entryElement.image.size.width, 10, self.contentView.frame.size.width-10-_entryElement.image.size.width-extra , self.frame.size.height-20);
}
CGFloat totalWidth = self.contentView.frame.size.width;
CGFloat titleWidth = 0;
Expand All @@ -84,7 +88,7 @@ - (CGRect)calculateFrameForEntryElement {
titleWidth = size.width;
}
}
_entryElement.parentSection.entryPosition = CGRectMake(titleWidth+20,10,totalWidth-titleWidth-20,24);
_entryElement.parentSection.entryPosition = CGRectMake(titleWidth+20,10,totalWidth-titleWidth-20-extra, self.frame.size.height-20);
}

return _entryElement.parentSection.entryPosition;
Expand All @@ -108,11 +112,12 @@ - (void)prepareForElement:(QEntryElement *)element inTableView:(QuickDialogTable
_textField.keyboardType = _entryElement.keyboardType;
_textField.keyboardAppearance = _entryElement.keyboardAppearance;
_textField.secureTextEntry = _entryElement.secureTextEntry;
_textField.clearsOnBeginEditing = _entryElement.clearsOnBeginEditing;

_textField.returnKeyType = _entryElement.returnKeyType;
_textField.enablesReturnKeyAutomatically = _entryElement.enablesReturnKeyAutomatically;

self.accessoryType = UITableViewCellAccessoryNone;
self.accessoryType = _entryElement.accessoryType;

if (_entryElement.hiddenToolbar){
_textField.inputAccessoryView = nil;
Expand Down Expand Up @@ -227,14 +232,12 @@ - (void) handleActionBarPreviousNext:(UISegmentedControl *)control {
}

- (BOOL)handleActionBarDone:(UIBarButtonItem *)doneButton {
NSLog(@"is %d", _textField.isEditing);
[self endEditing:YES];
[self endEditing:NO];
[_textField resignFirstResponder];

[[[UIApplication sharedApplication] keyWindow] endEditing:YES];

NSLog(@"is %d", _textField.isEditing);
if(_entryElement && _entryElement.delegate && [_entryElement.delegate respondsToSelector:@selector(QEntryMustReturnForElement:andCell:)]){
[_entryElement.delegate QEntryMustReturnForElement:_entryElement andCell:self];
}
Expand Down
1 change: 0 additions & 1 deletion quickdialog/QFloatElement.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ - (void)fetchValueIntoObject:(id)obj {
- (CGFloat)calculateSliderWidth:(QuickDialogTableView *)view cell:(UITableViewCell *)cell {
if (_title==nil)
return view.contentSize.width-40;

return view.contentSize.width - [cell.textLabel.text sizeWithFont:[UIFont boldSystemFontOfSize:17]].width - 50;
}

Expand Down
3 changes: 3 additions & 0 deletions quickdialog/QLabelElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@
}

@property(nonatomic, strong) UIImage *image;
@property(nonatomic, assign) NSString *imageNamed;
@property(nonatomic, assign) UITableViewCellAccessoryType accessoryType;
@property(nonatomic, strong) id value;


- (QLabelElement *)initWithTitle:(NSString *)string Value:(id)value;

@end
Loading

0 comments on commit ff1e45f

Please sign in to comment.