Skip to content

Instantly share code, notes, and snippets.

@pmatanyc
Created March 3, 2020 04:11
Show Gist options
  • Save pmatanyc/da796d314a75ed40eb131be1e049a29f to your computer and use it in GitHub Desktop.
Save pmatanyc/da796d314a75ed40eb131be1e049a29f to your computer and use it in GitHub Desktop.
- (void)setupNavBar {
self.dismissButton = [UIButton buttonWithType:UIButtonTypeSystem];
UIImage *dismissButtonImage = [UIImage imageNamed:@"close-large"];
[self.dismissButton setImage:dismissButtonImage forState:UIControlStateNormal];
self.dismissButton.tintColor = [UIColor cookingBlack];
[self.dismissButton mas_remakeConstraints:^(MASConstraintMaker *make) {
make.height.equalTo(@44);
make.width.equalTo(@44);
}];
[self.dismissButton addTarget:self action:@selector(dismissButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
self.dismissButton.accessibilityIdentifier = @"Close";
UIBarButtonItem *dismissBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:self.dismissButton];
[self.navigationItem setLeftBarButtonItem:dismissBarButtonItem];
self.navigationItem.titleView = self.loginTopMessage;
}
@scottswezey
Copy link

This probably is a really bad idea, but perhaps it could be finessed into what your designer is looking for...
https://gist.github.com/scottswezey/f491a39421f14ac6eeaa5654a148cc32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment