From 60f60d087e5f3de0ec07829ee9565b279e7b02e7 Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Tue, 12 May 2020 23:27:56 -0400 Subject: [PATCH] Embed views using embed segue instead of MPRootSegue. --- .../project.pbxproj | 6 --- .../Source/iOS/MPCombinedViewController.m | 1 - .../Source/iOS/MPOverlayViewController.m | 7 ---- platform-darwin/Source/iOS/MPRootSegue.h | 23 ----------- platform-darwin/Source/iOS/MPRootSegue.m | 35 ----------------- platform-darwin/Source/iOS/MPSitesSegue.m | 2 +- .../Source/iOS/Storyboard.storyboard | 39 +++++++++++++++---- 7 files changed, 32 insertions(+), 81 deletions(-) delete mode 100644 platform-darwin/Source/iOS/MPRootSegue.h delete mode 100644 platform-darwin/Source/iOS/MPRootSegue.m diff --git a/platform-darwin/MasterPassword-iOS.xcodeproj/project.pbxproj b/platform-darwin/MasterPassword-iOS.xcodeproj/project.pbxproj index f994ee84..dad64c55 100644 --- a/platform-darwin/MasterPassword-iOS.xcodeproj/project.pbxproj +++ b/platform-darwin/MasterPassword-iOS.xcodeproj/project.pbxproj @@ -49,7 +49,6 @@ 93D39A5FF670957C0AF8298D /* MPSiteCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39DEA995041A13DC9CAF7 /* MPSiteCell.m */; }; 93D39A8EA1C49CE43B63F47B /* PearlUICollectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39D8A953779B35403AF6E /* PearlUICollectionView.m */; }; 93D39AA4A0BE66A872CCC02E /* NSPersistentStore+PearlMigration.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D397F4BAFFF7CF3F1B21A4 /* NSPersistentStore+PearlMigration.h */; }; - 93D39B429C67A62E29DC02DA /* MPRootSegue.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D399493FEDDE74DD1A0C15 /* MPRootSegue.m */; }; 93D39B76DD5AB108BA8928E8 /* UIScrollView+PearlAdjustInsets.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D39DE2CB351D4E3789462B /* UIScrollView+PearlAdjustInsets.h */; }; 93D39B842AB9A5D072810D76 /* NSError+PearlFullDescription.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D398C95847261903D781D3 /* NSError+PearlFullDescription.h */; }; 93D39B8F90F58A5D158DDBA3 /* MPSitesViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D3924EE15017F8A12CB436 /* MPSitesViewController.m */; }; @@ -476,7 +475,6 @@ 93D391943675426839501BB8 /* MPLogsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPLogsViewController.h; sourceTree = ""; }; 93D391AA32F24290C424438E /* NSNotificationCenter+PearlEasyCleanup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSNotificationCenter+PearlEasyCleanup.h"; sourceTree = ""; }; 93D39246FC21C6E63E35D615 /* UICollectionView+PearlReloadItems.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UICollectionView+PearlReloadItems.h"; sourceTree = ""; }; - 93D3924D6F77E6BF41AC32D3 /* MPRootSegue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPRootSegue.h; sourceTree = ""; }; 93D3924EE15017F8A12CB436 /* MPSitesViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPSitesViewController.m; sourceTree = ""; }; 93D392876BE5C011DE73B43F /* MPPopdownSegue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPPopdownSegue.h; sourceTree = ""; }; 93D392C5A6572DB0EB5B82C8 /* mpw-types.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "mpw-types.c"; sourceTree = ""; }; @@ -505,7 +503,6 @@ 93D398C95847261903D781D3 /* NSError+PearlFullDescription.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSError+PearlFullDescription.h"; sourceTree = ""; }; 93D3990D850D76A94C6B7A4D /* mpw-algorithm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "mpw-algorithm.h"; sourceTree = ""; }; 93D3990E0CD1B5CF9FBB2C07 /* MPWebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPWebViewController.m; sourceTree = ""; }; - 93D399493FEDDE74DD1A0C15 /* MPRootSegue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPRootSegue.m; sourceTree = ""; }; 93D3995B1D4DCE5A30D882BA /* MPCoachmarkViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPCoachmarkViewController.m; sourceTree = ""; }; 93D39975CE5AEC99E3F086C7 /* MPSiteCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPSiteCell.h; sourceTree = ""; }; 93D3999693660C89A7465F4E /* MPCoachmarkViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPCoachmarkViewController.h; sourceTree = ""; }; @@ -2784,8 +2781,6 @@ 93D39B050DD5F55E9794EFD4 /* MPPopdownSegue.m */, DABD3BEA1711E2DC00CF925C /* MPPreferencesViewController.h */, DABD3BEB1711E2DC00CF925C /* MPPreferencesViewController.m */, - 93D3924D6F77E6BF41AC32D3 /* MPRootSegue.h */, - 93D399493FEDDE74DD1A0C15 /* MPRootSegue.m */, 93D39730673227EFF6DEFF19 /* MPSetupViewController.h */, 93D39A28369954D147E239BA /* MPSetupViewController.m */, 93D39975CE5AEC99E3F086C7 /* MPSiteCell.h */, @@ -3642,7 +3637,6 @@ 93D399D7E08A142776A74CB8 /* MPOverlayViewController.m in Sources */, DA46021D23D5E30B00398FF4 /* MPSecrets.m in Sources */, 93D39A27F2506C6FEEF9C588 /* MPAlgorithmV2.m in Sources */, - 93D39B429C67A62E29DC02DA /* MPRootSegue.m in Sources */, 93D392FD5E2052F7D7DB3774 /* NSString+MPMarkDown.m in Sources */, 93D395B715D15F2B56F2A2EE /* mpw-types.c in Sources */, 93D39943D01E70DAC3B0DF76 /* mpw-util.c in Sources */, diff --git a/platform-darwin/Source/iOS/MPCombinedViewController.m b/platform-darwin/Source/iOS/MPCombinedViewController.m index d8fca3be..cf60ea69 100644 --- a/platform-darwin/Source/iOS/MPCombinedViewController.m +++ b/platform-darwin/Source/iOS/MPCombinedViewController.m @@ -31,7 +31,6 @@ [super viewDidLoad]; self.mode = MPCombinedModeUserSelection; - [self performSegueWithIdentifier:@"users" sender:self]; } - (void)viewWillAppear:(BOOL)animated { diff --git a/platform-darwin/Source/iOS/MPOverlayViewController.m b/platform-darwin/Source/iOS/MPOverlayViewController.m index a4ac3b57..426e1390 100644 --- a/platform-darwin/Source/iOS/MPOverlayViewController.m +++ b/platform-darwin/Source/iOS/MPOverlayViewController.m @@ -33,13 +33,6 @@ self.dismissSegueByButton = [NSMutableDictionary dictionary]; } -- (void)viewDidLoad { - - [super viewDidLoad]; - - [self performSegueWithIdentifier:@"root" sender:self]; -} - - (UIViewController *)childViewControllerForStatusBarStyle { return [self.childViewControllers lastObject]; diff --git a/platform-darwin/Source/iOS/MPRootSegue.h b/platform-darwin/Source/iOS/MPRootSegue.h deleted file mode 100644 index c2066b6a..00000000 --- a/platform-darwin/Source/iOS/MPRootSegue.h +++ /dev/null @@ -1,23 +0,0 @@ -//============================================================================== -// This file is part of Master Password. -// Copyright (c) 2011-2017, Maarten Billemont. -// -// Master Password is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Master Password is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You can find a copy of the GNU General Public License in the -// LICENSE file. Alternatively, see . -//============================================================================== - -#import - -@interface MPRootSegue : UIStoryboardSegue - -@end diff --git a/platform-darwin/Source/iOS/MPRootSegue.m b/platform-darwin/Source/iOS/MPRootSegue.m deleted file mode 100644 index 21b3b889..00000000 --- a/platform-darwin/Source/iOS/MPRootSegue.m +++ /dev/null @@ -1,35 +0,0 @@ -//============================================================================== -// This file is part of Master Password. -// Copyright (c) 2011-2017, Maarten Billemont. -// -// Master Password is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Master Password is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You can find a copy of the GNU General Public License in the -// LICENSE file. Alternatively, see . -//============================================================================== - -#import "MPRootSegue.h" - -@implementation MPRootSegue - -- (void)perform { - - UIViewController *sourceViewController = self.sourceViewController; - UIViewController *destinationViewController = self.destinationViewController; - [sourceViewController addChildViewController:destinationViewController]; - destinationViewController.view.frame = sourceViewController.view.bounds; - destinationViewController.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; - [sourceViewController.view addSubview:destinationViewController.view]; - [destinationViewController didMoveToParentViewController:sourceViewController]; - [sourceViewController setNeedsStatusBarAppearanceUpdate]; -} - -@end diff --git a/platform-darwin/Source/iOS/MPSitesSegue.m b/platform-darwin/Source/iOS/MPSitesSegue.m index da77e624..d62c6878 100644 --- a/platform-darwin/Source/iOS/MPSitesSegue.m +++ b/platform-darwin/Source/iOS/MPSitesSegue.m @@ -43,7 +43,7 @@ UIView *sitesView = sitesVC.view; sitesView.frame = combinedVC.view.bounds; sitesView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; - [combinedVC.view insertSubview:sitesView belowSubview:combinedVC.usersVC.view]; + [combinedVC.view insertSubview:sitesView belowSubview:combinedVC.usersVC.view.superview]; [sitesVC setActive:YES animated:self.animated completion:^(BOOL finished) { if (!finished) diff --git a/platform-darwin/Source/iOS/Storyboard.storyboard b/platform-darwin/Source/iOS/Storyboard.storyboard index 3ec8ed4c..d0a3e448 100644 --- a/platform-darwin/Source/iOS/Storyboard.storyboard +++ b/platform-darwin/Source/iOS/Storyboard.storyboard @@ -3,7 +3,7 @@ - + @@ -69,7 +69,7 @@ - + @@ -531,12 +531,23 @@ + + + + + + + + + + + + + + - - - @@ -557,12 +568,25 @@ + + + + + + + + + + + + + @@ -570,7 +594,6 @@ - @@ -3143,7 +3166,7 @@ Ut in geometria, prima si dederis, danda sunt omnia. Nonne igitur tibi videntur, - + @@ -3258,7 +3281,7 @@ Ut in geometria, prima si dederis, danda sunt omnia. Nonne igitur tibi videntur, - +