Always present settings from OWSNavigationController
// FREEBIE
This commit is contained in:
parent
29848835f3
commit
25a2646c8b
|
@ -20,6 +20,7 @@
|
|||
#import "OWSDatabaseMigration.h"
|
||||
#import "OWSLogger.h"
|
||||
#import "OWSMessageEditing.h"
|
||||
#import "OWSNavigationController.h"
|
||||
#import "OWSProfileManager.h"
|
||||
#import "OWSProgressView.h"
|
||||
#import "OWSViewController.h"
|
||||
|
|
|
@ -4,6 +4,15 @@
|
|||
|
||||
#import "OWSTableViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class OWSNavigationController;
|
||||
|
||||
@interface AppSettingsViewController : OWSTableViewController
|
||||
|
||||
+ (OWSNavigationController *)inModalNavigationController;
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#import "NotificationSettingsViewController.h"
|
||||
#import "OWSContactsManager.h"
|
||||
#import "OWSLinkedDevicesTableViewController.h"
|
||||
#import "OWSNavigationController.h"
|
||||
#import "PrivacySettingsTableViewController.h"
|
||||
#import "ProfileViewController.h"
|
||||
#import "PropertyListPreferences.h"
|
||||
|
@ -29,6 +30,18 @@
|
|||
|
||||
@implementation AppSettingsViewController
|
||||
|
||||
/**
|
||||
* We always present the settings controller modally, from within an OWSNavigationController
|
||||
*/
|
||||
+ (OWSNavigationController *)inModalNavigationController
|
||||
{
|
||||
AppSettingsViewController *viewController = [AppSettingsViewController new];
|
||||
OWSNavigationController *navController =
|
||||
[[OWSNavigationController alloc] initWithRootViewController:viewController];
|
||||
|
||||
return navController;
|
||||
}
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
self = [super init];
|
||||
|
@ -64,6 +77,8 @@
|
|||
[super viewDidLoad];
|
||||
[self.navigationItem setHidesBackButton:YES];
|
||||
|
||||
OWSAssert([self.navigationController isKindOfClass:[OWSNavigationController class]]);
|
||||
|
||||
[self.navigationController.navigationBar setTranslucent:NO];
|
||||
self.navigationItem.leftBarButtonItem =
|
||||
[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemStop
|
||||
|
|
|
@ -905,7 +905,7 @@ class CallViewController: OWSViewController, CallObserver, CallServiceObserver,
|
|||
assert(fromViewController != nil)
|
||||
|
||||
// Construct the "settings" view & push the "privacy settings" view.
|
||||
let navigationController = UINavigationController(rootViewController:AppSettingsViewController())
|
||||
let navigationController = AppSettingsViewController.inModalNavigationController()
|
||||
navigationController.pushViewController(PrivacySettingsTableViewController(), animated:false)
|
||||
|
||||
fromViewController?.present(navigationController, animated: true, completion: nil)
|
||||
|
|
|
@ -126,7 +126,7 @@ private class CallKitExperienceUpgradeViewController: ExperienceUpgradeViewContr
|
|||
assert(fromViewController != nil)
|
||||
|
||||
// Construct the "settings" view & push the "privacy settings" view.
|
||||
let navigationController = UINavigationController(rootViewController:AppSettingsViewController())
|
||||
let navigationController = AppSettingsViewController.inModalNavigationController()
|
||||
navigationController.pushViewController(PrivacySettingsTableViewController(), animated:false)
|
||||
|
||||
fromViewController?.present(navigationController, animated: true, completion: nil)
|
||||
|
|
|
@ -95,6 +95,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
OWSAssert([self.navigationController isKindOfClass:[OWSNavigationController class]]);
|
||||
|
||||
// HACK otherwise CNContactViewController Navbar is shown as black.
|
||||
// RADAR rdar://28433898 http://www.openradar.me/28433898
|
||||
// CNContactViewController incompatible with opaque navigation bar
|
||||
|
|
|
@ -310,8 +310,7 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
|
|||
}
|
||||
|
||||
- (void)settingsButtonPressed:(id)sender {
|
||||
AppSettingsViewController *vc = [AppSettingsViewController new];
|
||||
OWSNavigationController *navigationController = [[OWSNavigationController alloc] initWithRootViewController:vc];
|
||||
OWSNavigationController *navigationController = [AppSettingsViewController inModalNavigationController];
|
||||
[self presentViewController:navigationController animated:YES completion:nil];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue