diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2020-09-03 13:26:46 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2020-09-03 19:45:32 +0200 |
| commit | 6e3e7293ae76d00830eca34083d2c2b036be0d09 (patch) | |
| tree | 795bf8f5fe2d86f926b8d95ea7893fdb8f745f5f /ios | |
| parent | d2616e190f805ec452692b9c1b2d194e5c822c91 (diff) | |
| download | mullvadvpn-6e3e7293ae76d00830eca34083d2c2b036be0d09.tar.xz mullvadvpn-6e3e7293ae76d00830eca34083d2c2b036be0d09.zip | |
Move LoginViewController to XIB
Diffstat (limited to 'ios')
| -rw-r--r-- | ios/MullvadVPN.xcodeproj/project.pbxproj | 8 | ||||
| -rw-r--r-- | ios/MullvadVPN/AppDelegate.swift | 15 | ||||
| -rw-r--r-- | ios/MullvadVPN/Base.lproj/Main.storyboard | 179 | ||||
| -rw-r--r-- | ios/MullvadVPN/LoginViewController.swift | 9 | ||||
| -rw-r--r-- | ios/MullvadVPN/LoginViewController.xib | 192 | ||||
| -rw-r--r-- | ios/MullvadVPN/SegueIdentifier.swift | 33 | ||||
| -rw-r--r-- | ios/MullvadVPN/ViewControllerIdentifier.swift | 1 |
7 files changed, 218 insertions, 219 deletions
diff --git a/ios/MullvadVPN.xcodeproj/project.pbxproj b/ios/MullvadVPN.xcodeproj/project.pbxproj index 1c70034bdc..ffc7c9d393 100644 --- a/ios/MullvadVPN.xcodeproj/project.pbxproj +++ b/ios/MullvadVPN.xcodeproj/project.pbxproj @@ -96,7 +96,6 @@ 5860F1C223A785C600CEA666 /* WireguardDevice.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5860F1C123A785C600CEA666 /* WireguardDevice.swift */; }; 5860F1C423A8D25F00CEA666 /* WireguardConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5860F1C323A8D25F00CEA666 /* WireguardConfiguration.swift */; }; 5862805422428EF100F5A6E1 /* TranslucentButtonBlurView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5862805322428EF100F5A6E1 /* TranslucentButtonBlurView.swift */; }; - 5867A51C2248F26A005513C0 /* SegueIdentifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5867A51B2248F26A005513C0 /* SegueIdentifier.swift */; }; 5868585524054096000B8131 /* AppButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5868585424054096000B8131 /* AppButton.swift */; }; 586AA296234B696B00502875 /* WireguardAssociatedAddresses.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58B8743122B25A7600015324 /* WireguardAssociatedAddresses.swift */; }; 586BD68322B7BBD800BB7F9F /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 586BD68222B7BBD800BB7F9F /* NetworkExtension.framework */; }; @@ -134,6 +133,7 @@ 58A8BE81239FBE62006B74AC /* IPEndpoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58561C98239A5D1500BD6B5E /* IPEndpoint.swift */; }; 58A99ED3240014A0006599E9 /* ConsentViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58A99ED2240014A0006599E9 /* ConsentViewController.swift */; }; 58AB9DEC2501040C006C5526 /* ConsentViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 58AB9DEB2501040C006C5526 /* ConsentViewController.xib */; }; + 58AB9DEE25010636006C5526 /* LoginViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 58AB9DED25010636006C5526 /* LoginViewController.xib */; }; 58AEEF652344A36000C9BBD5 /* KeychainError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58AEEF642344A36000C9BBD5 /* KeychainError.swift */; }; 58AEEF662344A37400C9BBD5 /* KeychainError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58AEEF642344A36000C9BBD5 /* KeychainError.swift */; }; 58AEEF6B2344A46200C9BBD5 /* TunnelSettingsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58AEEF6A2344A46200C9BBD5 /* TunnelSettingsManager.swift */; }; @@ -306,7 +306,6 @@ 5860F1C323A8D25F00CEA666 /* WireguardConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WireguardConfiguration.swift; sourceTree = "<group>"; }; 5862805322428EF100F5A6E1 /* TranslucentButtonBlurView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TranslucentButtonBlurView.swift; sourceTree = "<group>"; }; 5866F39B2243B82D00168AE5 /* MullvadVPN.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = MullvadVPN.entitlements; sourceTree = "<group>"; }; - 5867A51B2248F26A005513C0 /* SegueIdentifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SegueIdentifier.swift; sourceTree = "<group>"; }; 5868585424054096000B8131 /* AppButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppButton.swift; sourceTree = "<group>"; }; 586BD68222B7BBD800BB7F9F /* NetworkExtension.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NetworkExtension.framework; path = System/Library/Frameworks/NetworkExtension.framework; sourceTree = SDKROOT; }; 58723E7422A54C63009837F5 /* libwg-go.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libwg-go.a"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -334,6 +333,7 @@ 58A1AA8B23F5584B009F7EA6 /* ConnectionPanelView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConnectionPanelView.swift; sourceTree = "<group>"; }; 58A99ED2240014A0006599E9 /* ConsentViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConsentViewController.swift; sourceTree = "<group>"; }; 58AB9DEB2501040C006C5526 /* ConsentViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ConsentViewController.xib; sourceTree = "<group>"; }; + 58AB9DED25010636006C5526 /* LoginViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = LoginViewController.xib; sourceTree = "<group>"; }; 58AEEF642344A36000C9BBD5 /* KeychainError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeychainError.swift; sourceTree = "<group>"; }; 58AEEF6A2344A46200C9BBD5 /* TunnelSettingsManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TunnelSettingsManager.swift; sourceTree = "<group>"; }; 58B0A2A0238EE67E00BC001D /* MullvadVPNTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MullvadVPNTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -594,7 +594,6 @@ 58781CD422AFBA39009B9D8E /* RelaySelector.swift */, 5888AD7E2279B6BF0051EB06 /* RelayStatusIndicatorView.swift */, 587425C02299833500CA2045 /* RootContainerViewController.swift */, - 5867A51B2248F26A005513C0 /* SegueIdentifier.swift */, 5888AD82227B11080051EB06 /* SelectLocationCell.swift */, 5888AD86227B17950051EB06 /* SelectLocationController.swift */, 5857F24224C8662600CF6F47 /* SelectLocationHeaderView.swift */, @@ -625,6 +624,7 @@ 58C6B35322BB87C4003C19AD /* WireguardPrivateKey.swift */, 58F3C098249B978C003E76BE /* x25519.c */, 58F3C097249B978C003E76BE /* x25519.h */, + 58AB9DED25010636006C5526 /* LoginViewController.xib */, ); path = MullvadVPN; sourceTree = "<group>"; @@ -854,6 +854,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 58AB9DEE25010636006C5526 /* LoginViewController.xib in Resources */, 58F3C0A624A50157003E76BE /* relays.json in Resources */, 58CE5E6E224146210008646E /* LaunchScreen.storyboard in Resources */, 58CE5E6B224146210008646E /* Assets.xcassets in Resources */, @@ -1048,7 +1049,6 @@ 589AB4F7227B64450039131E /* BasicTableViewCell.swift in Sources */, 58B9EB152489139B00095626 /* DisplayChainedError.swift in Sources */, 5888AD7F2279B6BF0051EB06 /* RelayStatusIndicatorView.swift in Sources */, - 5867A51C2248F26A005513C0 /* SegueIdentifier.swift in Sources */, 58CCA01E2242787B004F3011 /* AccountTextField.swift in Sources */, 587AD7CA2342283900E93A53 /* Account.swift in Sources */, 58F840AF2464382C0044E708 /* KeychainItemRevision.swift in Sources */, diff --git a/ios/MullvadVPN/AppDelegate.swift b/ios/MullvadVPN/AppDelegate.swift index a278a52d6e..c6045f0766 100644 --- a/ios/MullvadVPN/AppDelegate.swift +++ b/ios/MullvadVPN/AppDelegate.swift @@ -101,9 +101,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate { animated: Bool, completionHandler: @escaping () -> Void) { - let loginViewController = self.mainStoryboard.instantiateViewController(withIdentifier: ViewControllerIdentifier.login.rawValue) + let loginViewController = LoginViewController() + loginViewController.delegate = self - var viewControllers = [loginViewController] + var viewControllers: [UIViewController] = [loginViewController] if Account.shared.isLoggedIn { let mainViewController = self.mainStoryboard.instantiateViewController(withIdentifier: ViewControllerIdentifier.main.rawValue) @@ -134,6 +135,16 @@ extension AppDelegate: RootContainerViewControllerDelegate { } } +extension AppDelegate: LoginViewControllerDelegate { + + func loginViewControllerDidLogin(_ controller: LoginViewController) { + let mainViewController = self.mainStoryboard.instantiateViewController(withIdentifier: ViewControllerIdentifier.main.rawValue) + + rootContainer?.pushViewController(mainViewController, animated: true) + } + +} + extension AppDelegate: SettingsViewControllerDelegate { func settingsViewController(_ controller: SettingsViewController, didFinishWithReason reason: SettingsDismissReason) { diff --git a/ios/MullvadVPN/Base.lproj/Main.storyboard b/ios/MullvadVPN/Base.lproj/Main.storyboard index 0c9a2e80e0..159bc2b48c 100644 --- a/ios/MullvadVPN/Base.lproj/Main.storyboard +++ b/ios/MullvadVPN/Base.lproj/Main.storyboard @@ -22,180 +22,7 @@ </viewController> <placeholder placeholderIdentifier="IBFirstResponder" id="2sf-Y1-Ntj" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/> </objects> - <point key="canvasLocation" x="-1306" y="27"/> - </scene> - <!--Login View Controller--> - <scene sceneID="tne-QT-ifu"> - <objects> - <viewController storyboardIdentifier="Login" id="BYZ-38-t0r" customClass="LoginViewController" customModule="MullvadVPN" customModuleProvider="target" sceneMemberID="viewController"> - <view key="view" contentMode="scaleToFill" id="xpu-Q8-m8b"> - <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> - <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> - <subviews> - <view contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" translatesAutoresizingMaskIntoConstraints="NO" id="0ZY-Kh-JiM" userLabel="Container"> - <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> - <subviews> - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="pID-oa-Rrg" customClass="SpinnerActivityIndicatorView" customModule="MullvadVPN" customModuleProvider="target"> - <rect key="frame" x="163.5" y="173" width="48" height="48"/> - <color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> - <constraints> - <constraint firstAttribute="height" constant="48" id="2J4-Qc-ctc"/> - <constraint firstAttribute="width" constant="48" id="ohE-fk-mg9"/> - </constraints> - </view> - <imageView clipsSubviews="YES" userInteractionEnabled="NO" alpha="0.0" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="IconSuccess" translatesAutoresizingMaskIntoConstraints="NO" id="7ux-Tb-Fzq"> - <rect key="frame" x="157.5" y="167" width="60" height="60"/> - </imageView> - <view contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" translatesAutoresizingMaskIntoConstraints="NO" id="V3j-Lb-fSQ" userLabel="Form"> - <rect key="frame" x="0.0" y="251" width="375" height="125.5"/> - <subviews> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Login" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Nxn-Fc-EGe"> - <rect key="frame" x="24" y="0.0" width="327" height="39"/> - <fontDescription key="fontDescription" type="system" pointSize="32"/> - <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> - <nil key="highlightedColor"/> - </label> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Enter your account number" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="XSV-Lk-dj4"> - <rect key="frame" x="24" y="47" width="327" height="20.5"/> - <fontDescription key="fontDescription" type="system" pointSize="17"/> - <color key="textColor" white="1" alpha="0.60359589041095896" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> - <nil key="highlightedColor"/> - </label> - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="VmT-ya-ufe" customClass="AccountInputGroupView" customModule="MullvadVPN" customModuleProvider="target"> - <rect key="frame" x="24" y="77.5" width="327" height="48"/> - <subviews> - <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="0000 0000 0000 0000" textAlignment="natural" adjustsFontSizeToFit="NO" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="XOB-ct-yLU" userLabel="Account Text Field" customClass="AccountTextField" customModule="MullvadVPN" customModuleProvider="target"> - <rect key="frame" x="0.0" y="0.0" width="327" height="48"/> - <accessibility key="accessibilityConfiguration" identifier="LoginTextField"/> - <fontDescription key="fontDescription" type="system" pointSize="20"/> - <textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no" keyboardType="numberPad" enablesReturnKeyAutomatically="YES" smartDashesType="no" smartInsertDeleteType="no" smartQuotesType="no" textContentType="username"/> - </textField> - </subviews> - <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> - <constraints> - <constraint firstItem="XOB-ct-yLU" firstAttribute="top" secondItem="VmT-ya-ufe" secondAttribute="top" id="6gC-g8-WvR"/> - <constraint firstAttribute="trailing" secondItem="XOB-ct-yLU" secondAttribute="trailing" id="8oc-Rn-csw"/> - <constraint firstAttribute="height" constant="48" placeholder="YES" id="Str-4H-10Q"/> - <constraint firstItem="XOB-ct-yLU" firstAttribute="leading" secondItem="VmT-ya-ufe" secondAttribute="leading" id="dLW-t4-NiY"/> - <constraint firstAttribute="bottom" secondItem="XOB-ct-yLU" secondAttribute="bottom" id="ykb-mC-noi"/> - </constraints> - <connections> - <outlet property="textField" destination="XOB-ct-yLU" id="7VW-eF-gMr"/> - </connections> - </view> - </subviews> - <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> - <constraints> - <constraint firstAttribute="trailingMargin" secondItem="Nxn-Fc-EGe" secondAttribute="trailing" id="1ea-k3-78I"/> - <constraint firstItem="XSV-Lk-dj4" firstAttribute="leading" secondItem="Nxn-Fc-EGe" secondAttribute="leading" id="2Yu-kr-QsE"/> - <constraint firstItem="VmT-ya-ufe" firstAttribute="leading" secondItem="Nxn-Fc-EGe" secondAttribute="leading" id="8FN-nm-t0F"/> - <constraint firstItem="VmT-ya-ufe" firstAttribute="top" secondItem="XSV-Lk-dj4" secondAttribute="bottom" constant="10" id="9pH-T3-2jW"/> - <constraint firstItem="Nxn-Fc-EGe" firstAttribute="leading" secondItem="V3j-Lb-fSQ" secondAttribute="leadingMargin" id="Ce0-1J-FJc"/> - <constraint firstItem="XSV-Lk-dj4" firstAttribute="trailing" secondItem="Nxn-Fc-EGe" secondAttribute="trailing" id="OLs-m1-xHT"/> - <constraint firstAttribute="bottom" secondItem="VmT-ya-ufe" secondAttribute="bottom" id="OhO-fH-gIS"/> - <constraint firstItem="VmT-ya-ufe" firstAttribute="trailing" secondItem="Nxn-Fc-EGe" secondAttribute="trailing" id="RMD-VJ-u4j"/> - <constraint firstItem="XSV-Lk-dj4" firstAttribute="top" secondItem="Nxn-Fc-EGe" secondAttribute="bottom" constant="8" id="aBF-3y-LX5"/> - <constraint firstItem="Nxn-Fc-EGe" firstAttribute="top" secondItem="V3j-Lb-fSQ" secondAttribute="top" id="nCa-l7-I8c"/> - </constraints> - </view> - </subviews> - <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> - <constraints> - <constraint firstItem="7ux-Tb-Fzq" firstAttribute="centerX" secondItem="pID-oa-Rrg" secondAttribute="centerX" id="0pe-6n-wrA"/> - <constraint firstItem="V3j-Lb-fSQ" firstAttribute="top" secondItem="pID-oa-Rrg" secondAttribute="bottom" constant="30" id="2Sy-bS-AZZ"/> - <constraint firstItem="V3j-Lb-fSQ" firstAttribute="centerY" secondItem="0ZY-Kh-JiM" secondAttribute="centerY" constant="-20" id="3Uk-YZ-4C3"/> - <constraint firstItem="7ux-Tb-Fzq" firstAttribute="centerY" secondItem="pID-oa-Rrg" secondAttribute="centerY" id="BRH-Bd-Pe8"/> - <constraint firstAttribute="trailing" secondItem="V3j-Lb-fSQ" secondAttribute="trailing" id="EHy-Cx-cGj"/> - <constraint firstItem="pID-oa-Rrg" firstAttribute="centerX" secondItem="0ZY-Kh-JiM" secondAttribute="centerX" id="Ojm-D5-HnO"/> - <constraint firstItem="V3j-Lb-fSQ" firstAttribute="leading" secondItem="0ZY-Kh-JiM" secondAttribute="leading" id="alr-G1-L4w"/> - </constraints> - </view> - <view contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Ire-2z-eJu" userLabel="Footer"> - <rect key="frame" x="0.0" y="556.5" width="375" height="110.5"/> - <subviews> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Don't have an account number?" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QcG-Tf-YdQ"> - <rect key="frame" x="24" y="16" width="327" height="20.5"/> - <fontDescription key="fontDescription" type="system" pointSize="17"/> - <color key="textColor" white="1" alpha="0.60327482876712324" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> - <nil key="highlightedColor"/> - </label> - <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="osm-vd-aTb" customClass="AppButton" customModule="MullvadVPN" customModuleProvider="target"> - <rect key="frame" x="24" y="44.5" width="327" height="42"/> - <constraints> - <constraint firstAttribute="height" constant="42" placeholder="YES" id="NNo-Ki-ThF"/> - </constraints> - <state key="normal" title="Create account" backgroundImage="DefaultButton"> - <color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> - </state> - <connections> - <action selector="createNewAccount" destination="BYZ-38-t0r" eventType="touchUpInside" id="d7p-Uy-6Wc"/> - </connections> - </button> - </subviews> - <color key="backgroundColor" name="Secondary"/> - <constraints> - <constraint firstAttribute="trailingMargin" secondItem="osm-vd-aTb" secondAttribute="trailing" id="MCf-FB-2AL"/> - <constraint firstAttribute="bottomMargin" secondItem="osm-vd-aTb" secondAttribute="bottom" id="g0d-lW-N4P"/> - <constraint firstItem="QcG-Tf-YdQ" firstAttribute="leading" secondItem="Ire-2z-eJu" secondAttribute="leadingMargin" id="hLO-0a-7p0"/> - <constraint firstItem="QcG-Tf-YdQ" firstAttribute="top" secondItem="Ire-2z-eJu" secondAttribute="topMargin" id="pOc-kU-kNJ"/> - <constraint firstAttribute="trailingMargin" secondItem="QcG-Tf-YdQ" secondAttribute="trailing" id="rEw-4o-orE"/> - <constraint firstItem="osm-vd-aTb" firstAttribute="leading" secondItem="Ire-2z-eJu" secondAttribute="leadingMargin" id="sLm-Ug-jLY"/> - <constraint firstItem="osm-vd-aTb" firstAttribute="top" secondItem="QcG-Tf-YdQ" secondAttribute="bottom" constant="8" id="yAE-m3-6y0"/> - </constraints> - <edgeInsets key="layoutMargins" top="16" left="0.0" bottom="24" right="0.0"/> - </view> - </subviews> - <color key="backgroundColor" name="Primary"/> - <constraints> - <constraint firstAttribute="bottom" secondItem="0ZY-Kh-JiM" secondAttribute="bottom" id="09L-EV-qfI"/> - <constraint firstItem="0ZY-Kh-JiM" firstAttribute="leading" secondItem="xpu-Q8-m8b" secondAttribute="leading" id="5T5-Un-Bbw"/> - <constraint firstItem="Ire-2z-eJu" firstAttribute="leading" secondItem="xpu-Q8-m8b" secondAttribute="leading" id="8MY-2T-1p9"/> - <constraint firstItem="0ZY-Kh-JiM" firstAttribute="top" secondItem="RSb-dJ-fKl" secondAttribute="top" id="XTe-ZF-Txi"/> - <constraint firstAttribute="trailing" secondItem="0ZY-Kh-JiM" secondAttribute="trailing" id="ZCl-FF-h79"/> - <constraint firstAttribute="bottom" secondItem="Ire-2z-eJu" secondAttribute="bottom" id="okj-M8-3PQ"/> - <constraint firstAttribute="trailing" secondItem="Ire-2z-eJu" secondAttribute="trailing" id="uZQ-0R-5JT"/> - </constraints> - <edgeInsets key="layoutMargins" top="0.0" left="24" bottom="0.0" right="24"/> - <viewLayoutGuide key="safeArea" id="RSb-dJ-fKl"/> - </view> - <connections> - <outlet property="accountInputGroup" destination="VmT-ya-ufe" id="ku3-qa-yfV"/> - <outlet property="accountTextField" destination="XOB-ct-yLU" id="mXd-SV-E16"/> - <outlet property="activityIndicator" destination="pID-oa-Rrg" id="GG2-Hv-FWl"/> - <outlet property="createAccountButton" destination="osm-vd-aTb" id="2Gr-84-Sg5"/> - <outlet property="keyboardToolbar" destination="waX-JF-VTG" id="kav-5t-mkA"/> - <outlet property="keyboardToolbarLoginButton" destination="0VH-wf-oEs" id="fsM-6o-9nL"/> - <outlet property="loginForm" destination="V3j-Lb-fSQ" id="tYu-S8-ylm"/> - <outlet property="loginFormWrapperBottomConstraint" destination="09L-EV-qfI" id="fYF-OK-trh"/> - <outlet property="messageLabel" destination="XSV-Lk-dj4" id="8bd-TU-yhD"/> - <outlet property="statusImageView" destination="7ux-Tb-Fzq" id="UhU-kS-PKR"/> - <outlet property="titleLabel" destination="Nxn-Fc-EGe" id="lOm-uS-4Ff"/> - <segue destination="Ki6-Mt-b6R" kind="custom" identifier="ShowConnect" customClass="RootContainerPushSegue" customModule="MullvadVPN" customModuleProvider="target" id="ccw-Nc-l0Q"/> - </connections> - </viewController> - <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/> - <toolbar opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="waX-JF-VTG"> - <rect key="frame" x="0.0" y="0.0" width="375" height="44"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/> - <items> - <barButtonItem style="plain" systemItem="cancel" id="hYv-Qq-TND"> - <connections> - <action selector="cancelLogin" destination="BYZ-38-t0r" id="5UA-Vf-AE0"/> - </connections> - </barButtonItem> - <barButtonItem style="plain" systemItem="flexibleSpace" id="Llz-4U-rOT"/> - <barButtonItem title="Log in" style="done" id="0VH-wf-oEs"> - <userDefinedRuntimeAttributes> - <userDefinedRuntimeAttribute type="string" keyPath="accessibilityIdentifier" value="LoginBarButtonItem"/> - </userDefinedRuntimeAttributes> - <connections> - <action selector="doLogin" destination="BYZ-38-t0r" id="8Mv-Di-I6Y"/> - </connections> - </barButtonItem> - </items> - </toolbar> - </objects> - <point key="canvasLocation" x="669.60000000000002" y="27.436281859070466"/> + <point key="canvasLocation" x="670" y="-57"/> </scene> <!--Connect View Controller--> <scene sceneID="Fnf-X9-B7i"> @@ -294,7 +121,7 @@ </viewController> <placeholder placeholderIdentifier="IBFirstResponder" id="gkg-dm-hcG" userLabel="First Responder" sceneMemberID="firstResponder"/> </objects> - <point key="canvasLocation" x="1688.8" y="26.53673163418291"/> + <point key="canvasLocation" x="1689" y="-57"/> </scene> <!--Settings--> <scene sceneID="3oF-uu-3Bk"> @@ -478,8 +305,6 @@ </scene> </scenes> <resources> - <image name="DefaultButton" width="9" height="9"/> - <image name="IconSuccess" width="60" height="60"/> <namedColor name="Primary"> <color red="0.16078431372549021" green="0.30196078431372547" blue="0.45098039215686275" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> </namedColor> diff --git a/ios/MullvadVPN/LoginViewController.swift b/ios/MullvadVPN/LoginViewController.swift index 1ee718b534..e92186f502 100644 --- a/ios/MullvadVPN/LoginViewController.swift +++ b/ios/MullvadVPN/LoginViewController.swift @@ -22,6 +22,10 @@ enum LoginState { case success(AuthenticationMethod) } +protocol LoginViewControllerDelegate: class { + func loginViewControllerDidLogin(_ controller: LoginViewController) +} + class LoginViewController: UIViewController, RootContainment { @IBOutlet var keyboardToolbar: UIToolbar! @@ -44,6 +48,8 @@ class LoginViewController: UIViewController, RootContainment { } } + weak var delegate: LoginViewControllerDelegate? + override var preferredStatusBarStyle: UIStatusBarStyle { return .lightContent } @@ -261,8 +267,7 @@ class LoginViewController: UIViewController, RootContainment { DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(1)) { self.rootContainerController?.setEnableSettingsButton(true) - self.performSegue(withIdentifier: SegueIdentifier.Login.showConnect.rawValue, - sender: self) + self.delegate?.loginViewControllerDidLogin(self) } } } diff --git a/ios/MullvadVPN/LoginViewController.xib b/ios/MullvadVPN/LoginViewController.xib new file mode 100644 index 0000000000..44055f78f6 --- /dev/null +++ b/ios/MullvadVPN/LoginViewController.xib @@ -0,0 +1,192 @@ +<?xml version="1.0" encoding="UTF-8"?> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097.2" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> + <device id="retina6_1" orientation="portrait" appearance="light"/> + <dependencies> + <deployment identifier="iOS"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/> + <capability name="Named colors" minToolsVersion="9.0"/> + <capability name="Safe area layout guides" minToolsVersion="9.0"/> + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> + </dependencies> + <objects> + <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="LoginViewController" customModule="MullvadVPN" customModuleProvider="target"> + <connections> + <outlet property="accountInputGroup" destination="fmY-Fe-bhX" id="lRy-3H-p77"/> + <outlet property="accountTextField" destination="M05-uw-Xgl" id="d7E-mT-gts"/> + <outlet property="activityIndicator" destination="kcs-fP-UuB" id="nTJ-wH-MFm"/> + <outlet property="createAccountButton" destination="yyj-Bk-eOB" id="A6e-QQ-2Hz"/> + <outlet property="keyboardToolbar" destination="eMY-ag-aGA" id="MXd-lD-jRp"/> + <outlet property="keyboardToolbarLoginButton" destination="vJz-hf-rNV" id="IcH-iY-AI6"/> + <outlet property="loginForm" destination="h09-lb-ltN" id="4pC-oh-SiV"/> + <outlet property="loginFormWrapperBottomConstraint" destination="a30-Jy-fnc" id="LXy-zf-zOf"/> + <outlet property="messageLabel" destination="BPK-kZ-9lL" id="eKD-KS-aq8"/> + <outlet property="statusImageView" destination="L2c-40-K8a" id="6xq-lK-xjr"/> + <outlet property="titleLabel" destination="edY-81-swW" id="7HS-3s-d6L"/> + <outlet property="view" destination="mbj-X6-VW9" id="7jT-Iq-dEp"/> + </connections> + </placeholder> + <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> + <view contentMode="scaleToFill" id="mbj-X6-VW9"> + <rect key="frame" x="0.0" y="0.0" width="414" height="896"/> + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> + <subviews> + <view contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Hlu-LB-fs2" userLabel="Container"> + <rect key="frame" x="0.0" y="44" width="414" height="852"/> + <subviews> + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="kcs-fP-UuB" customClass="SpinnerActivityIndicatorView" customModule="MullvadVPN" customModuleProvider="target"> + <rect key="frame" x="183" y="265.5" width="48" height="48"/> + <color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> + <constraints> + <constraint firstAttribute="width" constant="48" id="ayU-NN-NND"/> + <constraint firstAttribute="height" constant="48" id="tdi-f8-eAx"/> + </constraints> + </view> + <imageView clipsSubviews="YES" userInteractionEnabled="NO" alpha="0.0" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="IconSuccess" translatesAutoresizingMaskIntoConstraints="NO" id="L2c-40-K8a"> + <rect key="frame" x="177" y="259.5" width="60" height="60"/> + </imageView> + <view contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" translatesAutoresizingMaskIntoConstraints="NO" id="h09-lb-ltN" userLabel="Form"> + <rect key="frame" x="0.0" y="343.5" width="414" height="125.5"/> + <subviews> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Login" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="edY-81-swW"> + <rect key="frame" x="24" y="0.0" width="366" height="39"/> + <fontDescription key="fontDescription" type="system" pointSize="32"/> + <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> + <nil key="highlightedColor"/> + </label> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Enter your account number" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="BPK-kZ-9lL"> + <rect key="frame" x="24" y="47" width="366" height="20.5"/> + <fontDescription key="fontDescription" type="system" pointSize="17"/> + <color key="textColor" white="1" alpha="0.60359589039999995" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> + <nil key="highlightedColor"/> + </label> + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="fmY-Fe-bhX" customClass="AccountInputGroupView" customModule="MullvadVPN" customModuleProvider="target"> + <rect key="frame" x="24" y="77.5" width="366" height="48"/> + <subviews> + <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="0000 0000 0000 0000" textAlignment="natural" adjustsFontSizeToFit="NO" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="M05-uw-Xgl" userLabel="Account Text Field" customClass="AccountTextField" customModule="MullvadVPN" customModuleProvider="target"> + <rect key="frame" x="0.0" y="0.0" width="366" height="48"/> + <accessibility key="accessibilityConfiguration" identifier="LoginTextField"/> + <fontDescription key="fontDescription" type="system" pointSize="20"/> + <textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no" keyboardType="numberPad" enablesReturnKeyAutomatically="YES" smartDashesType="no" smartInsertDeleteType="no" smartQuotesType="no" textContentType="username"/> + </textField> + </subviews> + <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> + <constraints> + <constraint firstItem="M05-uw-Xgl" firstAttribute="top" secondItem="fmY-Fe-bhX" secondAttribute="top" id="9ld-io-34b"/> + <constraint firstAttribute="height" constant="48" placeholder="YES" id="QKg-Me-fbd"/> + <constraint firstAttribute="trailing" secondItem="M05-uw-Xgl" secondAttribute="trailing" id="XbY-CL-4DV"/> + <constraint firstAttribute="bottom" secondItem="M05-uw-Xgl" secondAttribute="bottom" id="qle-Bq-Gwu"/> + <constraint firstItem="M05-uw-Xgl" firstAttribute="leading" secondItem="fmY-Fe-bhX" secondAttribute="leading" id="ti3-Jt-gIj"/> + </constraints> + <connections> + <outlet property="textField" destination="M05-uw-Xgl" id="Stn-EF-XKw"/> + </connections> + </view> + </subviews> + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> + <constraints> + <constraint firstAttribute="trailingMargin" secondItem="edY-81-swW" secondAttribute="trailing" id="1OY-3d-amx"/> + <constraint firstItem="edY-81-swW" firstAttribute="leading" secondItem="h09-lb-ltN" secondAttribute="leadingMargin" id="2EO-AX-dOa"/> + <constraint firstItem="fmY-Fe-bhX" firstAttribute="leading" secondItem="edY-81-swW" secondAttribute="leading" id="6Yg-wS-lQA"/> + <constraint firstItem="edY-81-swW" firstAttribute="top" secondItem="h09-lb-ltN" secondAttribute="top" id="L7R-pW-kDT"/> + <constraint firstItem="BPK-kZ-9lL" firstAttribute="leading" secondItem="edY-81-swW" secondAttribute="leading" id="Luz-tR-dyN"/> + <constraint firstItem="BPK-kZ-9lL" firstAttribute="top" secondItem="edY-81-swW" secondAttribute="bottom" constant="8" id="RQ5-p6-Tcp"/> + <constraint firstItem="fmY-Fe-bhX" firstAttribute="top" secondItem="BPK-kZ-9lL" secondAttribute="bottom" constant="10" id="T6H-O9-mQp"/> + <constraint firstItem="fmY-Fe-bhX" firstAttribute="trailing" secondItem="edY-81-swW" secondAttribute="trailing" id="lqk-t6-mkw"/> + <constraint firstItem="BPK-kZ-9lL" firstAttribute="trailing" secondItem="edY-81-swW" secondAttribute="trailing" id="mit-be-kUU"/> + <constraint firstAttribute="bottom" secondItem="fmY-Fe-bhX" secondAttribute="bottom" id="r57-ni-R5Y"/> + </constraints> + </view> + </subviews> + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> + <constraints> + <constraint firstItem="h09-lb-ltN" firstAttribute="leading" secondItem="Hlu-LB-fs2" secondAttribute="leading" id="6ui-Qt-KHA"/> + <constraint firstItem="L2c-40-K8a" firstAttribute="centerX" secondItem="kcs-fP-UuB" secondAttribute="centerX" id="Bn8-0h-4u1"/> + <constraint firstItem="L2c-40-K8a" firstAttribute="centerY" secondItem="kcs-fP-UuB" secondAttribute="centerY" id="EmV-jB-7A5"/> + <constraint firstItem="kcs-fP-UuB" firstAttribute="centerX" secondItem="Hlu-LB-fs2" secondAttribute="centerX" id="aHt-jx-l4c"/> + <constraint firstItem="h09-lb-ltN" firstAttribute="top" secondItem="kcs-fP-UuB" secondAttribute="bottom" constant="30" id="b9G-Ra-uTL"/> + <constraint firstItem="h09-lb-ltN" firstAttribute="centerY" secondItem="Hlu-LB-fs2" secondAttribute="centerY" constant="-20" id="d3Q-mn-gqk"/> + <constraint firstAttribute="trailing" secondItem="h09-lb-ltN" secondAttribute="trailing" id="hkn-ig-VGd"/> + </constraints> + </view> + <view contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" translatesAutoresizingMaskIntoConstraints="NO" id="OWx-up-Gr3" userLabel="Footer"> + <rect key="frame" x="0.0" y="751.5" width="414" height="144.5"/> + <subviews> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Don't have an account number?" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Kmh-Zz-WX7"> + <rect key="frame" x="24" y="16" width="366" height="20.5"/> + <fontDescription key="fontDescription" type="system" pointSize="17"/> + <color key="textColor" white="1" alpha="0.60327482880000005" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> + <nil key="highlightedColor"/> + </label> + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="yyj-Bk-eOB" customClass="AppButton" customModule="MullvadVPN" customModuleProvider="target"> + <rect key="frame" x="24" y="44.5" width="366" height="42"/> + <constraints> + <constraint firstAttribute="height" constant="42" placeholder="YES" id="aLH-Os-Yhl"/> + </constraints> + <state key="normal" title="Create account" backgroundImage="DefaultButton"> + <color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> + </state> + <connections> + <action selector="createNewAccount" destination="-1" eventType="touchUpInside" id="Sat-eK-Sfr"/> + </connections> + </button> + </subviews> + <color key="backgroundColor" name="Secondary"/> + <constraints> + <constraint firstItem="Kmh-Zz-WX7" firstAttribute="top" secondItem="OWx-up-Gr3" secondAttribute="topMargin" id="2gd-XW-al2"/> + <constraint firstAttribute="bottomMargin" secondItem="yyj-Bk-eOB" secondAttribute="bottom" id="5sc-Gk-BLo"/> + <constraint firstItem="yyj-Bk-eOB" firstAttribute="top" secondItem="Kmh-Zz-WX7" secondAttribute="bottom" constant="8" id="6ep-aF-S3v"/> + <constraint firstAttribute="trailingMargin" secondItem="yyj-Bk-eOB" secondAttribute="trailing" id="JZr-eV-Ptz"/> + <constraint firstItem="yyj-Bk-eOB" firstAttribute="leading" secondItem="OWx-up-Gr3" secondAttribute="leadingMargin" id="aF1-ha-Rup"/> + <constraint firstItem="Kmh-Zz-WX7" firstAttribute="leading" secondItem="OWx-up-Gr3" secondAttribute="leadingMargin" id="joi-NK-b3p"/> + <constraint firstAttribute="trailingMargin" secondItem="Kmh-Zz-WX7" secondAttribute="trailing" id="pJv-fq-yMY"/> + </constraints> + <edgeInsets key="layoutMargins" top="16" left="0.0" bottom="24" right="0.0"/> + </view> + </subviews> + <color key="backgroundColor" name="Primary"/> + <constraints> + <constraint firstItem="Hlu-LB-fs2" firstAttribute="top" secondItem="nNG-OH-fpp" secondAttribute="top" id="9Wj-KC-bOY"/> + <constraint firstAttribute="bottom" secondItem="OWx-up-Gr3" secondAttribute="bottom" id="Gtb-JS-xnU"/> + <constraint firstItem="OWx-up-Gr3" firstAttribute="leading" secondItem="mbj-X6-VW9" secondAttribute="leading" id="HGZ-UR-R1R"/> + <constraint firstItem="Hlu-LB-fs2" firstAttribute="leading" secondItem="mbj-X6-VW9" secondAttribute="leading" id="Psd-xu-SF5"/> + <constraint firstAttribute="bottom" secondItem="Hlu-LB-fs2" secondAttribute="bottom" id="a30-Jy-fnc"/> + <constraint firstAttribute="trailing" secondItem="Hlu-LB-fs2" secondAttribute="trailing" id="eE0-5M-Lr5"/> + <constraint firstAttribute="trailing" secondItem="OWx-up-Gr3" secondAttribute="trailing" id="jUk-Gq-dMy"/> + </constraints> + <edgeInsets key="layoutMargins" top="0.0" left="24" bottom="0.0" right="24"/> + <viewLayoutGuide key="safeArea" id="nNG-OH-fpp"/> + <point key="canvasLocation" x="139" y="153"/> + </view> + <toolbar opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="eMY-ag-aGA"> + <rect key="frame" x="0.0" y="0.0" width="375" height="44"/> + <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/> + <items> + <barButtonItem style="plain" systemItem="cancel" id="JeF-aH-YXy"> + <connections> + <action selector="cancelLogin" destination="-1" id="Bil-lr-11g"/> + </connections> + </barButtonItem> + <barButtonItem style="plain" systemItem="flexibleSpace" id="VXP-Mz-kgj"/> + <barButtonItem title="Log in" style="done" id="vJz-hf-rNV"> + <userDefinedRuntimeAttributes> + <userDefinedRuntimeAttribute type="string" keyPath="accessibilityIdentifier" value="LoginBarButtonItem"/> + </userDefinedRuntimeAttributes> + <connections> + <action selector="doLogin" destination="-1" id="Tif-Kp-Pkt"/> + </connections> + </barButtonItem> + </items> + <point key="canvasLocation" x="138" y="517"/> + </toolbar> + </objects> + <resources> + <image name="DefaultButton" width="9" height="9"/> + <image name="IconSuccess" width="60" height="60"/> + <namedColor name="Primary"> + <color red="0.16078431372549021" green="0.30196078431372547" blue="0.45098039215686275" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> + </namedColor> + <namedColor name="Secondary"> + <color red="0.098039215686274508" green="0.1803921568627451" blue="0.27058823529411763" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> + </namedColor> + </resources> +</document> diff --git a/ios/MullvadVPN/SegueIdentifier.swift b/ios/MullvadVPN/SegueIdentifier.swift deleted file mode 100644 index 529e0e8ec4..0000000000 --- a/ios/MullvadVPN/SegueIdentifier.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// SegueIdentifier.swift -// MullvadVPN -// -// Created by pronebird on 25/03/2019. -// Copyright © 2019 Mullvad VPN AB. All rights reserved. -// - -import UIKit - -// A phantom struct holding the storyboard segue identifiers for each view controller -enum SegueIdentifier {} - -extension SegueIdentifier { - - enum Login: String, SegueConvertible { - case showConnect = "ShowConnect" - } -} - -protocol SegueConvertible: RawRepresentable { - static func from(segue: UIStoryboardSegue) -> Self? -} - -extension SegueConvertible where RawValue == String { - static func from(segue: UIStoryboardSegue) -> Self? { - if let identifier = segue.identifier { - return self.init(rawValue: identifier) - } else { - return nil - } - } -} diff --git a/ios/MullvadVPN/ViewControllerIdentifier.swift b/ios/MullvadVPN/ViewControllerIdentifier.swift index f5e227bc06..fd3defdfb5 100644 --- a/ios/MullvadVPN/ViewControllerIdentifier.swift +++ b/ios/MullvadVPN/ViewControllerIdentifier.swift @@ -9,7 +9,6 @@ import Foundation enum ViewControllerIdentifier: String { - case login = "Login" case main = "Main" case settings = "Settings" case selectLocation = "SelectLocation" |
