This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath | |
| { | |
| if ([tableView respondsToSelector:@selector(setSeparatorInset:)]) | |
| { | |
| [tableView setSeparatorInset:UIEdgeInsetsZero]; | |
| } | |
| if ([tableView respondsToSelector:@selector(setLayoutMargins:)]) | |
| { | |
| [tableView setLayoutMargins:UIEdgeInsetsZero]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (void)viewDidLoad | |
| { | |
| [super viewDidLoad]; | |
| [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged:) name:UIDeviceOrientationDidChangeNotification object:nil]; | |
| } | |
| - (void)orientationChanged:(NSNotification *)notification | |
| { | |
| [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait animated:YES]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| UIViewController *viewController = [[UIViewController alloc] init]; | |
| UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:viewController]; | |
| navigationController.modalPresentationStyle = UIModalPresentationFormSheet; | |
| [self presentViewController:navigationController animated:YES completion:nil]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CABasicAnimation *rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; | |
| rotationAnimation.duration = 2.0f; | |
| rotationAnimation.removedOnCompletion = NO; | |
| rotationAnimation.additive = YES; | |
| rotationAnimation.fromValue = [NSNumber numberWithFloat:0]; | |
| rotationAnimation.toValue = [NSNumber numberWithFloat:M_PI]; | |
| rotationAnimation.fillMode = kCAFillModeForwards; | |
| [self.customView.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // For UIViewController inside UINavigationController | |
| - (void)viewWillLayoutSubviews | |
| { | |
| [super viewWillLayoutSubviews]; | |
| self.navigationController.view.superview.bounds = CGRectMake(0, 0, 300, 300); | |
| self.navigationController.view.superview.layer.cornerRadius = 2.0f; | |
| } | |
| // Usual presentation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 50, 50)]; | |
| imageView.image = [UIImage imageNamed:@"custom_image"]; | |
| imageView.contentMode = UIViewContentModeScaleAspectFit; | |
| imageView.bounds = CGRectInset(imageView.frame, 20.0f, 20.0f); | |
| [self.navigationController.navigationBar addSubview:imageView]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [UIView animateWithDuration:1.0f animations:^{ | |
| }]; | |
| [UIView animateWithDuration:1.0f animations:^{ | |
| } completion:^(BOOL finished) { | |
| }]; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (void)viewDidLoad | |
| { | |
| [super viewDidLoad]; | |
| UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)]; | |
| view.backgroundColor = [UIColor redColor]; | |
| [self.view addSubview:view]; | |
| UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handler:)]; | |
| [tapGestureRecognizer setNumberOfTapsRequired:1]; |