Skip to content

Instantly share code, notes, and snippets.

@nickfox
Created November 1, 2011 01:38
Show Gist options
  • Save nickfox/1329611 to your computer and use it in GitHub Desktop.
Save nickfox/1329611 to your computer and use it in GitHub Desktop.
NSString *productName = self.product.name;
NSString *newLine = [productName stringByAppendingString:@"\n"];
NSString *description = [newLine stringByAppendingString:product.currentPackageType];
descriptionLabel.text = description;
UIFont *font = [UIFont fontWithName:@"Helvetica" size:15];
descriptionLabel.font = font;
CGSize descriptionStringSize = [description sizeWithFont:font
constrainedToSize:maximumSize
lineBreakMode:descriptionLabel.lineBreakMode];
CGRect labelFrame = CGRectMake(167, 25, 150, descriptionStringSize.height); // x,y,w,h
descriptionLabel.frame = labelFrame;
[self.view addSubview:descriptionLabel];
[descriptionLabel release];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment