Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MyOtherViewController *movc = [[MyOtherViewController alloc] init];
- [self.view addSubview:movc.view];
- UIView *newView = [[NSBundle mainBundle] loadNibNamed:@"MyNewXib" owner:self options:nil];
- // assign it to a property
- @property (strong, non atomic) UIView *viewFromXib;
- @sythesize viewFromXib=_viewFromXib;
- self.viewFromXib = newView;
- // add it to your hierarchy
- self.viewFromXib.frame = CGRectMake( /* this will start out 0,0 the size from the xib */ );
- [self.view addSubview:self.viewFromXib];
- // add gesture recognizer
- UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tap:)];
- [self.viewFromXib addGestureRecognizer:tapGR];
Add Comment
Please, Sign In to add comment