IOS-2008 file rename IOS-2008
authorXavier Algarra <xavier@pep-project.org>
Mon, 02 Mar 2020 03:13:30 +0100
branchIOS-2008
changeset 120126c4b831d0b3c
parent 12011 5666af38c256
child 12013 61ca8f6af5ad
IOS-2008 file rename
pEpForiOS.xcodeproj/project.pbxproj
pEpForiOS/UI/SplitView/PEPSplitViewController.swift
pEpForiOS/UI/SplitView/PrimarySplitViewController.swift
     1.1 --- a/pEpForiOS.xcodeproj/project.pbxproj	Mon Mar 02 03:05:06 2020 +0100
     1.2 +++ b/pEpForiOS.xcodeproj/project.pbxproj	Mon Mar 02 03:13:30 2020 +0100
     1.3 @@ -25,7 +25,7 @@
     1.4  		00A12CAE20D3D9AC00B82BE3 /* FullMessageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00A12CAD20D3D9AC00B82BE3 /* FullMessageCell.swift */; };
     1.5  		00AEB2F620DBA7DA00DA185A /* NeedsRefreshDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00AEB2F520DBA7DA00DA185A /* NeedsRefreshDelegate.swift */; };
     1.6  		00BEC89720B85FD300A36E60 /* NothingSelectedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00BEC89620B85FD300A36E60 /* NothingSelectedViewController.swift */; };
     1.7 -		00D3CD3E20B58976009ABBC9 /* PrimarySplitViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00D3CD3D20B58976009ABBC9 /* PrimarySplitViewController.swift */; };
     1.8 +		00D3CD3E20B58976009ABBC9 /* PEPSplitViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00D3CD3D20B58976009ABBC9 /* PEPSplitViewController.swift */; };
     1.9  		00DF2C3B2164C53F004EBA6C /* FolderViewModelTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00DF2C3A2164C53F004EBA6C /* FolderViewModelTest.swift */; };
    1.10  		00EB89AB20E3A27C00CDFA0D /* ThreadViewcontroller+SizeClasses.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00EB89AA20E3A27C00CDFA0D /* ThreadViewcontroller+SizeClasses.swift */; };
    1.11  		00EB89AD20E3D3C200CDFA0D /* ThreadedEmailViewModel+MoveToFolderDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00EB89AC20E3D3C200CDFA0D /* ThreadedEmailViewModel+MoveToFolderDelegate.swift */; };
    1.12 @@ -487,7 +487,7 @@
    1.13  		00A12CAD20D3D9AC00B82BE3 /* FullMessageCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FullMessageCell.swift; sourceTree = "<group>"; };
    1.14  		00AEB2F520DBA7DA00DA185A /* NeedsRefreshDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NeedsRefreshDelegate.swift; sourceTree = "<group>"; };
    1.15  		00BEC89620B85FD300A36E60 /* NothingSelectedViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NothingSelectedViewController.swift; sourceTree = "<group>"; };
    1.16 -		00D3CD3D20B58976009ABBC9 /* PrimarySplitViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrimarySplitViewController.swift; sourceTree = "<group>"; };
    1.17 +		00D3CD3D20B58976009ABBC9 /* PEPSplitViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PEPSplitViewController.swift; sourceTree = "<group>"; };
    1.18  		00DF2C3A2164C53F004EBA6C /* FolderViewModelTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FolderViewModelTest.swift; sourceTree = "<group>"; };
    1.19  		00EB89AA20E3A27C00CDFA0D /* ThreadViewcontroller+SizeClasses.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ThreadViewcontroller+SizeClasses.swift"; sourceTree = "<group>"; };
    1.20  		00EB89AC20E3D3C200CDFA0D /* ThreadedEmailViewModel+MoveToFolderDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ThreadedEmailViewModel+MoveToFolderDelegate.swift"; sourceTree = "<group>"; };
    1.21 @@ -608,7 +608,6 @@
    1.22  		158A565624052280003C0D7E /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/NothingSelected.strings; sourceTree = "<group>"; };
    1.23  		158A565724052280003C0D7E /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Settings.strings; sourceTree = "<group>"; };
    1.24  		158A565824052280003C0D7E /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/AccountCreation.strings; sourceTree = "<group>"; };
    1.25 -		158A565924052281003C0D7E /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Handshake.strings; sourceTree = "<group>"; };
    1.26  		158A565A24052281003C0D7E /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/LaunchScreen.strings; sourceTree = "<group>"; };
    1.27  		158A565B24052281003C0D7E /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/FolderViews.strings; sourceTree = "<group>"; };
    1.28  		158A565C24052281003C0D7E /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Reusable.strings; sourceTree = "<group>"; };
    1.29 @@ -617,7 +616,6 @@
    1.30  		158A565F24052360003C0D7E /* ca */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ca; path = ca.lproj/NothingSelected.strings; sourceTree = "<group>"; };
    1.31  		158A566024052360003C0D7E /* ca */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ca; path = ca.lproj/Settings.strings; sourceTree = "<group>"; };
    1.32  		158A566124052360003C0D7E /* ca */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ca; path = ca.lproj/AccountCreation.strings; sourceTree = "<group>"; };
    1.33 -		158A566224052360003C0D7E /* ca */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ca; path = ca.lproj/Handshake.strings; sourceTree = "<group>"; };
    1.34  		158A566324052360003C0D7E /* ca */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ca; path = ca.lproj/LaunchScreen.strings; sourceTree = "<group>"; };
    1.35  		158A566424052360003C0D7E /* ca */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ca; path = ca.lproj/FolderViews.strings; sourceTree = "<group>"; };
    1.36  		158A566524052360003C0D7E /* ca */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ca; path = ca.lproj/Reusable.strings; sourceTree = "<group>"; };
    1.37 @@ -628,7 +626,6 @@
    1.38  		158A566A2405236E003C0D7E /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/NothingSelected.strings; sourceTree = "<group>"; };
    1.39  		158A566B2405236F003C0D7E /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/Settings.strings; sourceTree = "<group>"; };
    1.40  		158A566C2405236F003C0D7E /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/AccountCreation.strings; sourceTree = "<group>"; };
    1.41 -		158A566D2405236F003C0D7E /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/Handshake.strings; sourceTree = "<group>"; };
    1.42  		158A566E2405236F003C0D7E /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/LaunchScreen.strings; sourceTree = "<group>"; };
    1.43  		158A566F2405236F003C0D7E /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/FolderViews.strings; sourceTree = "<group>"; };
    1.44  		158A56702405236F003C0D7E /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/Reusable.strings; sourceTree = "<group>"; };
    1.45 @@ -1037,7 +1034,7 @@
    1.46  		003C0FAA20B57C2E0093A987 /* SplitView */ = {
    1.47  			isa = PBXGroup;
    1.48  			children = (
    1.49 -				00D3CD3D20B58976009ABBC9 /* PrimarySplitViewController.swift */,
    1.50 +				00D3CD3D20B58976009ABBC9 /* PEPSplitViewController.swift */,
    1.51  				00BEC89620B85FD300A36E60 /* NothingSelectedViewController.swift */,
    1.52  				00FD0CE52101F7D700BA0C56 /* ScreenComposerProtocol.swift */,
    1.53  				B7B0E8F224094BB1003A34DC /* SplitViewHandlingProtocol.swift */,
    1.54 @@ -1797,15 +1794,6 @@
    1.55  			path = Reusable;
    1.56  			sourceTree = "<group>";
    1.57  		};
    1.58 -		4304FCFD1EBB8C2C0086DADA /* LanguageList */ = {
    1.59 -			isa = PBXGroup;
    1.60 -			children = (
    1.61 -				B70D32A7205BCC2D0094A92A /* CellsAndSections */,
    1.62 -				4304FCFE1EBB8C5A0086DADA /* LanguageListViewController.swift */,
    1.63 -			);
    1.64 -			path = LanguageList;
    1.65 -			sourceTree = "<group>";
    1.66 -		};
    1.67  		430D73601E9CBD0600EA6FA9 /* Background */ = {
    1.68  			isa = PBXGroup;
    1.69  			children = (
    1.70 @@ -2877,7 +2865,7 @@
    1.71  				375BA08A238BFC4100BBFE7C /* ManualAccountSetupContainerView.swift in Sources */,
    1.72  				4351C2D71F4441190053381F /* node.c in Sources */,
    1.73  				154660D42334E2FC008D2137 /* Message+SecurityBadge.swift in Sources */,
    1.74 -				00D3CD3E20B58976009ABBC9 /* PrimarySplitViewController.swift in Sources */,
    1.75 +				00D3CD3E20B58976009ABBC9 /* PEPSplitViewController.swift in Sources */,
    1.76  				B7DFEA56225397AB0080A2BA /* Folder+LocalizedName.swift in Sources */,
    1.77  				4351C2D51F4441190053381F /* latex.c in Sources */,
    1.78  				37156E4C234CDDF100845A28 /* EditableAccountSettingsTableViewModel.swift in Sources */,
    1.79 @@ -3045,7 +3033,6 @@
    1.80  				152A39D121905C3E00D9F8E4 /* AttachmentViewModel.swift in Sources */,
    1.81  				4330278E1F7BABFF00D685F8 /* GradientView.swift in Sources */,
    1.82  				3AD2CBC923FD92650003A536 /* AccountSettingsViewModel.swift in Sources */,
    1.83 -				434F40961EB0DB5E002FBF0D /* HandshakePartnerTableViewCellViewModel.swift in Sources */,
    1.84  				152A39E121905C3E00D9F8E4 /* RecipientCellViewModel+FieldType.swift in Sources */,
    1.85  				4351C2CC1F4441190053381F /* cmark_ctype.c in Sources */,
    1.86  				152A39DB21905C3E00D9F8E4 /* CellViewModel.swift in Sources */,
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/pEpForiOS/UI/SplitView/PEPSplitViewController.swift	Mon Mar 02 03:13:30 2020 +0100
     2.3 @@ -0,0 +1,74 @@
     2.4 +//
     2.5 +//  PEPSplitViewController.swift
     2.6 +//  pEp
     2.7 +//
     2.8 +//  Created by Borja González de Pablo on 23/05/2018.
     2.9 +//  Copyright © 2018 p≡p Security S.A. All rights reserved.
    2.10 +//
    2.11 +
    2.12 +import UIKit
    2.13 +import pEpIOSToolbox
    2.14 +
    2.15 +class PEPSplitViewController: UISplitViewController, UISplitViewControllerDelegate {
    2.16 +    override func viewDidLoad() {
    2.17 +        super.viewDidLoad()
    2.18 +        
    2.19 +        delegate = self
    2.20 +        preferredDisplayMode = .allVisible
    2.21 +    }
    2.22 +
    2.23 +    func splitViewController(_ splitViewController: UISplitViewController,
    2.24 +                             collapseSecondary secondaryViewController:UIViewController,
    2.25 +                             onto primaryViewController:UIViewController) -> Bool {
    2.26 +        if let navigationController = secondaryViewController as? UINavigationController,
    2.27 +            let top = navigationController.topViewController, top.collapsedBehavior == .needed,
    2.28 +            let primaryNavigationController = primaryViewController as? UINavigationController {
    2.29 +            navigationController.popViewController(animated: false)
    2.30 +            primaryNavigationController.pushViewController(top, animated: false)
    2.31 +            if let vc = top as? SplitViewHandlingProtocol {
    2.32 +                vc.splitViewControllerWill(SplitViewController: self, newStatus: .collapse)
    2.33 +            }
    2.34 +        }
    2.35 +        return true
    2.36 +    }
    2.37 +
    2.38 +    func splitViewController(_ splitViewController: UISplitViewController,
    2.39 +                             separateSecondaryFrom primaryViewController: UIViewController)
    2.40 +        -> UIViewController? {
    2.41 +            let navigationController = UINavigationController()
    2.42 +            guard let primaryView = primaryViewController as? UINavigationController else {
    2.43 +                Log.shared.errorAndCrash(message: "root view is not nav Controller?")
    2.44 +                return nil
    2.45 +            }
    2.46 +            if let topView = primaryView.topViewController, topView.separatedBehavior == .detail {
    2.47 +                primaryView.popViewController(animated: false)
    2.48 +                navigationController.pushViewController(topView, animated: false)
    2.49 +                if let vc = topView as? SplitViewHandlingProtocol {
    2.50 +                    vc.splitViewControllerWill(SplitViewController: self, newStatus: .separate)
    2.51 +                }
    2.52 +            } else {
    2.53 +                let storyboard = UIStoryboard(
    2.54 +                    name: UIStoryboard.noSelectionStoryBoard,
    2.55 +                    bundle: nil)
    2.56 +                let vc = storyboard.instantiateViewController(
    2.57 +                    withIdentifier: UIStoryboard.nothingSelectedViewController)
    2.58 +                navigationController.pushViewController(vc, animated: false)
    2.59 +            }
    2.60 +            return navigationController
    2.61 +    }
    2.62 +    
    2.63 +    func splitViewController(_ splitViewController: UISplitViewController,
    2.64 +                             showDetail vc: UIViewController, sender: Any?) -> Bool {
    2.65 +        if !onlySplitViewMasterIsShown {
    2.66 +            //apple docs say detailView will be always in the position 1 of the .viewcontrollers array
    2.67 +            let detail = 1
    2.68 +            guard splitViewController.viewControllers.count == 2,
    2.69 +                let controller = splitViewController.viewControllers[detail] as? UINavigationController else {
    2.70 +                return false
    2.71 +            }
    2.72 +            controller.viewControllers = [vc]
    2.73 +            return true
    2.74 +        }
    2.75 +        return false
    2.76 +    }
    2.77 +}
     3.1 --- a/pEpForiOS/UI/SplitView/PrimarySplitViewController.swift	Mon Mar 02 03:05:06 2020 +0100
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,74 +0,0 @@
     3.4 -//
     3.5 -//  PrimarySplitViewController.swift
     3.6 -//  pEp
     3.7 -//
     3.8 -//  Created by Borja González de Pablo on 23/05/2018.
     3.9 -//  Copyright © 2018 p≡p Security S.A. All rights reserved.
    3.10 -//
    3.11 -
    3.12 -import UIKit
    3.13 -import pEpIOSToolbox
    3.14 -
    3.15 -class PEPSplitViewController: UISplitViewController, UISplitViewControllerDelegate {
    3.16 -    override func viewDidLoad() {
    3.17 -        super.viewDidLoad()
    3.18 -        
    3.19 -        delegate = self
    3.20 -        preferredDisplayMode = .allVisible
    3.21 -    }
    3.22 -
    3.23 -    func splitViewController(_ splitViewController: UISplitViewController,
    3.24 -                             collapseSecondary secondaryViewController:UIViewController,
    3.25 -                             onto primaryViewController:UIViewController) -> Bool {
    3.26 -        if let navigationController = secondaryViewController as? UINavigationController,
    3.27 -            let top = navigationController.topViewController, top.collapsedBehavior == .needed,
    3.28 -            let primaryNavigationController = primaryViewController as? UINavigationController {
    3.29 -            navigationController.popViewController(animated: false)
    3.30 -            primaryNavigationController.pushViewController(top, animated: false)
    3.31 -            if let vc = top as? SplitViewHandlingProtocol {
    3.32 -                vc.splitViewControllerWill(SplitViewController: self, newStatus: .collapse)
    3.33 -            }
    3.34 -        }
    3.35 -        return true
    3.36 -    }
    3.37 -
    3.38 -    func splitViewController(_ splitViewController: UISplitViewController,
    3.39 -                             separateSecondaryFrom primaryViewController: UIViewController)
    3.40 -        -> UIViewController? {
    3.41 -            let navigationController = UINavigationController()
    3.42 -            guard let primaryView = primaryViewController as? UINavigationController else {
    3.43 -                Log.shared.errorAndCrash(message: "root view is not nav Controller?")
    3.44 -                return nil
    3.45 -            }
    3.46 -            if let topView = primaryView.topViewController, topView.separatedBehavior == .detail {
    3.47 -                primaryView.popViewController(animated: false)
    3.48 -                navigationController.pushViewController(topView, animated: false)
    3.49 -                if let vc = topView as? SplitViewHandlingProtocol {
    3.50 -                    vc.splitViewControllerWill(SplitViewController: self, newStatus: .separate)
    3.51 -                }
    3.52 -            } else {
    3.53 -                let storyboard = UIStoryboard(
    3.54 -                    name: UIStoryboard.noSelectionStoryBoard,
    3.55 -                    bundle: nil)
    3.56 -                let vc = storyboard.instantiateViewController(
    3.57 -                    withIdentifier: UIStoryboard.nothingSelectedViewController)
    3.58 -                navigationController.pushViewController(vc, animated: false)
    3.59 -            }
    3.60 -            return navigationController
    3.61 -    }
    3.62 -    
    3.63 -    func splitViewController(_ splitViewController: UISplitViewController,
    3.64 -                             showDetail vc: UIViewController, sender: Any?) -> Bool {
    3.65 -        if !onlySplitViewMasterIsShown {
    3.66 -            //apple docs say detailView will be always in the position 1 of the .viewcontrollers array
    3.67 -            let detail = 1
    3.68 -            guard splitViewController.viewControllers.count == 2,
    3.69 -                let controller = splitViewController.viewControllers[detail] as? UINavigationController else {
    3.70 -                return false
    3.71 -            }
    3.72 -            controller.viewControllers = [vc]
    3.73 -            return true
    3.74 -        }
    3.75 -        return false
    3.76 -    }
    3.77 -}