Skip to content

Commit

Permalink
Improve Back Icon (RootOptionsController.m)
Browse files Browse the repository at this point in the history
  • Loading branch information
arichornlover authored May 14, 2024
1 parent da68054 commit f526432
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions Sources/RootOptionsController.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ - (void)viewDidLoad {
]];
}

- (UIImage *)resizeImage:(UIImage *)image newSize:(CGSize)newSize {
UIGraphicsBeginImageContextWithOptions(newSize, NO, [UIScreen mainScreen].scale);
[image drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)];
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return newImage;
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 2;
}
Expand Down Expand Up @@ -179,23 +187,6 @@ - (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection {

@implementation RootOptionsController (Privates)

- (UIImage *)resizeImage:(UIImage *)image toSize:(CGSize)size {
UIGraphicsBeginImageContextWithOptions(size, NO, [UIScreen mainScreen].scale);
[image drawInRect:CGRectMake(0, 0, size.width, size.height)];
UIImage *resizedImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

return resizedImage;
}

- (UIImage *)resizeImage:(UIImage *)image newSize:(CGSize)newSize {
UIGraphicsBeginImageContextWithOptions(newSize, NO, [UIScreen mainScreen].scale);
[image drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)];
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return newImage;
}

- (void)back {
[self.navigationController popViewControllerAnimated:YES];
}
Expand Down

0 comments on commit f526432

Please sign in to comment.