Skip to content

Instantly share code, notes, and snippets.



Block or report user

Report or block cemck

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View UIView.m
UIView *newView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 35)];
newView.backgroundColor=[UIColor redColor];
UITextView *mytext = [[UITextView alloc] initWithFrame:CGRectMake(5.0, 0.0, 100.0, 28.0)];
mytext.backgroundColor = [UIColor clearColor];
mytext.textColor = [UIColor blackColor];
mytext.editable = NO;
mytext.font = [UIFont systemFontOfSize:15];
mytext.text = @"Mytext";
cemck / listSubviews.m
Last active May 24, 2019
objc - list all subviews of some view
View listSubviews.m
- (void)listSubviewsOfView:(UIView *)view {
// Get the subviews of the view
NSArray *subviews = [view subviews];
// Return if there are no subviews
if ([subviews count] == 0) return; // COUNT CHECK LINE
for (UIView *subview in subviews) {
// Do what you want to do with the subview
NSLog(@"%@", subview);
You can’t perform that action at this time.