nib2objc updated

I’ve just committed version 1.2 of nib2objc to Github with the following enhancements:

  1. Compatibility with Xcode 3.2.3 and the latest iPhone SDKs;
  2. In debug mode, the tool generates stub comments for properties not currently recognized;
  3. Provides much nicer variable names; instead of “view24” you get “button53” or “tableview34”; those names are also used in the hierarchy output at the end of the generated code;
  4. Added support for MKMapView instances;
  5. Added support for some new UIView properties: autoresizesSubviews and contentStretch;
  6. Added support for UITextView’s clearButtonMode property;
  7. Added support for UIImageView’s highlighted property;
  8. Added support for the following UISearchBar properties: showsScopeBar, showsSearchResultsButton, scopeButtonTitles;
  9. Added support for the following UITableViewCell properties: editingAccessoryType, shouldIndentWhileEditing;
  10. Added support for the following UITableView properties: rowHeight, sectionFooterHeight, sectionHeaderHeight;
  11. Removed code generated for deprecated API calls (since SDK 3.0) in UIButton and UITableViewCell;

In particular, item #3 above is my preferred: the output of a simple NIB files looks like this now:

UIActivityIndicatorView *activityindicatorview8 = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
activityindicatorview8.frame = CGRectMake(309.0, 669.0, 20.0, 20.0);
activityindicatorview8.alpha = 1.000;
activityindicatorview8.autoresizesSubviews = YES;
activityindicatorview8.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin;
activityindicatorview8.clearsContextBeforeDrawing = YES;
activityindicatorview8.clipsToBounds = NO;
activityindicatorview8.contentMode = UIViewContentModeScaleToFill;
activityindicatorview8.contentStretch = CGRectFromString(@"{{0, 0}, {1, 1}}");
activityindicatorview8.hidden = NO;
activityindicatorview8.hidesWhenStopped = NO;
activityindicatorview8.multipleTouchEnabled = NO;
activityindicatorview8.opaque = NO;
activityindicatorview8.tag = 0;
activityindicatorview8.userInteractionEnabled = YES;
[activityindicatorview8 stopAnimating];
UISegmentedControl *segmentedcontrol6 = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObjects:@"First", @"Second", nil]];
segmentedcontrol6.frame = CGRectMake(174.0, 466.0, 207.0, 44.0);
segmentedcontrol6.alpha = 1.000;
segmentedcontrol6.autoresizesSubviews = YES;
segmentedcontrol6.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin;
segmentedcontrol6.clearsContextBeforeDrawing = YES;
segmentedcontrol6.clipsToBounds = NO;
segmentedcontrol6.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
segmentedcontrol6.contentMode = UIViewContentModeScaleToFill;
segmentedcontrol6.contentStretch = CGRectFromString(@"{{0, 0}, {1, 1}}");
segmentedcontrol6.contentVerticalAlignment = UIControlContentVerticalAlignmentTop;
segmentedcontrol6.enabled = YES;
segmentedcontrol6.hidden = NO;
segmentedcontrol6.highlighted = NO;
segmentedcontrol6.momentary = NO;
segmentedcontrol6.multipleTouchEnabled = NO;
segmentedcontrol6.opaque = NO;
segmentedcontrol6.segmentedControlStyle = UISegmentedControlStylePlain;
segmentedcontrol6.selected = NO;
segmentedcontrol6.selectedSegmentIndex = 0;
segmentedcontrol6.tag = 0;
segmentedcontrol6.userInteractionEnabled = YES;
UIImageView *imageview4 = [[UIImageView alloc] initWithFrame:CGRectMake(79.0, 47.0, 311.0, 260.0)];
imageview4.frame = CGRectMake(79.0, 47.0, 311.0, 260.0);
imageview4.alpha = 1.000;
imageview4.autoresizesSubviews = YES;
imageview4.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
imageview4.clearsContextBeforeDrawing = YES;
imageview4.clipsToBounds = NO;
imageview4.contentMode = UIViewContentModeScaleToFill;
imageview4.contentStretch = CGRectFromString(@"{{0, 0}, {1, 1}}");
imageview4.hidden = NO;
imageview4.highlighted = NO;
imageview4.multipleTouchEnabled = NO;
imageview4.opaque = YES;
imageview4.tag = 0;
imageview4.userInteractionEnabled = NO;
UIView *view2 = [[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, 768.0, 1004.0)];
view2.frame = CGRectMake(0.0, 0.0, 768.0, 1004.0);
view2.alpha = 1.000;
view2.autoresizesSubviews = YES;
view2.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
view2.backgroundColor = [UIColor colorWithWhite:1.000 alpha:1.000];
view2.clearsContextBeforeDrawing = YES;
view2.clipsToBounds = NO;
view2.contentMode = UIViewContentModeScaleToFill;
view2.contentStretch = CGRectFromString(@"{{0, 0}, {1, 1}}");
view2.hidden = NO;
view2.multipleTouchEnabled = NO;
view2.opaque = YES;
view2.tag = 0;
view2.userInteractionEnabled = YES;
UISlider *slider7 = [[UISlider alloc] initWithFrame:CGRectMake(520.0, 588.0, 118.0, 23.0)];
slider7.frame = CGRectMake(520.0, 588.0, 118.0, 23.0);
slider7.alpha = 1.000;
slider7.autoresizesSubviews = YES;
slider7.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin;
slider7.clearsContextBeforeDrawing = YES;
slider7.clipsToBounds = NO;
slider7.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
slider7.contentMode = UIViewContentModeScaleToFill;
slider7.contentStretch = CGRectFromString(@"{{0, 0}, {1, 1}}");
slider7.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
slider7.continuous = YES;
slider7.enabled = YES;
slider7.hidden = NO;
slider7.highlighted = NO;
slider7.maximumValue = 1.000;
slider7.minimumValue = 0.000;
slider7.multipleTouchEnabled = NO;
slider7.opaque = NO;
slider7.selected = NO;
slider7.tag = 0;
slider7.userInteractionEnabled = YES;
slider7.value = 0.500;
UILabel *label5 = [[UILabel alloc] initWithFrame:CGRectMake(478.0, 364.0, 163.0, 21.0)];
label5.frame = CGRectMake(478.0, 364.0, 163.0, 21.0);
label5.adjustsFontSizeToFitWidth = YES;
label5.alpha = 1.000;
label5.autoresizesSubviews = YES;
label5.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin;
label5.baselineAdjustment = UIBaselineAdjustmentAlignCenters;
label5.clearsContextBeforeDrawing = YES;
label5.clipsToBounds = YES;
label5.contentMode = UIViewContentModeLeft;
label5.contentStretch = CGRectFromString(@"{{0, 0}, {1, 1}}");
label5.enabled = YES;
label5.font = [UIFont fontWithName:@"Helvetica" size:17.000];
label5.hidden = NO;
label5.lineBreakMode = UILineBreakModeTailTruncation;
label5.minimumFontSize = 10.000;
label5.multipleTouchEnabled = NO;
label5.numberOfLines = 1;
label5.opaque = NO;
label5.shadowOffset = CGSizeMake(0.0, -1.0);
label5.tag = 0;
label5.text = @"Label";
label5.textAlignment = UITextAlignmentLeft;
label5.textColor = [UIColor colorWithRed:0.000 green:0.000 blue:0.000 alpha:1.000];
label5.userInteractionEnabled = NO;
[view2 addSubview:imageview4];
[view2 addSubview:label5];
[view2 addSubview:segmentedcontrol6];
[view2 addSubview:slider7];
[view2 addSubview:activityindicatorview8];

This makes the hierarchy part at the end to be much more readable and easier to understand. This was something that Rudi’s script was doing after the code was produced, and I wanted to integrate that functionality inside the tool.

Enjoy!

Similar Posts:

    None Found