Add stubs for purchase screen

With macro for presenting it everywhere.
This commit is contained in:
Davide De Rosa 2019-10-28 10:07:38 +01:00
parent f936cffe5e
commit e99cc3669d
6 changed files with 110 additions and 0 deletions

View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14868" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="fEC-GT-W4O">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14824"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Navigation Controller-->
<scene sceneID="njF-92-dZH">
<objects>
<navigationController id="fEC-GT-W4O" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="hZC-Bv-5pP">
<rect key="frame" x="0.0" y="44" width="414" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="mav-8y-ejl" kind="relationship" relationship="rootViewController" id="wpW-sp-YUJ"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="cwJ-TA-B3C" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-781" y="113"/>
</scene>
<!--Purchase View Controller-->
<scene sceneID="xj5-bV-pGe">
<objects>
<viewController id="mav-8y-ejl" customClass="PurchaseViewController" customModule="Passepartout" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="ehY-J4-Cyo">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<viewLayoutGuide key="safeArea" id="8QA-Ho-NSB"/>
</view>
<navigationItem key="navigationItem" id="X7r-gy-0QO"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="xqo-Gt-MGj" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="23" y="113"/>
</scene>
</scenes>
</document>

View File

@ -62,6 +62,12 @@ extension UIColor {
}
}
extension UIViewController {
func presentPurchaseScreen(forProduct product: Product) {
present(StoryboardScene.Purchase.initialScene.instantiate(), animated: true, completion: nil)
}
}
func delay(_ block: @escaping () -> Void) {
DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(500)) {
block()

View File

@ -41,6 +41,11 @@ internal enum StoryboardScene {
internal static let wizardHostIdentifier = SceneType<UIKit.UINavigationController>(storyboard: Organizer.self, identifier: "WizardHostIdentifier")
}
internal enum Purchase: StoryboardType {
internal static let storyboardName = "Purchase"
internal static let initialScene = InitialSceneType<UIKit.UINavigationController>(storyboard: Purchase.self)
}
internal enum Shortcuts: StoryboardType {
internal static let storyboardName = "Shortcuts"

View File

@ -0,0 +1,30 @@
//
// PurchaseViewController.swift
// Passepartout-iOS
//
// Created by Davide De Rosa on 10/27/19.
// Copyright (c) 2019 Davide De Rosa. All rights reserved.
//
// https://github.com/passepartoutvpn
//
// This file is part of Passepartout.
//
// Passepartout 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.
//
// Passepartout 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 should have received a copy of the GNU General Public License
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import UIKit
class PurchaseViewController: UIViewController {
}

View File

@ -68,6 +68,8 @@
0E45E6E422BD799700F19312 /* SwiftGen+Strings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E45E6E322BD799700F19312 /* SwiftGen+Strings.swift */; };
0E45E6FA22BD8FC500F19312 /* Core.strings in Resources */ = {isa = PBXBuildFile; fileRef = 0E3CAF98229AAE760008E5C8 /* Core.strings */; };
0E45E71022BE108100F19312 /* OpenVPNOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E45E70F22BE108100F19312 /* OpenVPNOptions.swift */; };
0E4B0D6B2366E3C100C890B4 /* PurchaseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E4B0D6A2366E3C000C890B4 /* PurchaseViewController.swift */; };
0E4B0D742366E6C800C890B4 /* Purchase.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0E4B0D762366E6C800C890B4 /* Purchase.storyboard */; };
0E4C9CBB20DCF0D600A0C59C /* DestructiveTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E4C9CBA20DCF0D600A0C59C /* DestructiveTableViewCell.swift */; };
0E4FD7F120D58618002221FF /* Macros.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E4FD7F020D58618002221FF /* Macros.swift */; };
0E533B162258E03B00EF94FC /* PoolGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E533B152258E03B00EF94FC /* PoolGroup.swift */; };
@ -208,6 +210,8 @@
0E45E6F822BD898A00F19312 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/App.strings; sourceTree = "<group>"; };
0E45E6F922BD898B00F19312 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/App.strings; sourceTree = "<group>"; };
0E45E70F22BE108100F19312 /* OpenVPNOptions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenVPNOptions.swift; sourceTree = "<group>"; };
0E4B0D6A2366E3C000C890B4 /* PurchaseViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PurchaseViewController.swift; sourceTree = "<group>"; };
0E4B0D752366E6C800C890B4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Purchase.storyboard; sourceTree = "<group>"; };
0E4C9CB820DB9BC600A0C59C /* TrustedNetworks.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrustedNetworks.swift; sourceTree = "<group>"; };
0E4C9CBA20DCF0D600A0C59C /* DestructiveTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DestructiveTableViewCell.swift; sourceTree = "<group>"; };
0E4FD7DD20D3E49A002221FF /* StandardVPNProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StandardVPNProvider.swift; sourceTree = "<group>"; };
@ -391,6 +395,14 @@
path = Resources;
sourceTree = "<group>";
};
0E4B0D6C2366E53C00C890B4 /* Purchase */ = {
isa = PBXGroup;
children = (
0E4B0D6A2366E3C000C890B4 /* PurchaseViewController.swift */,
);
path = Purchase;
sourceTree = "<group>";
};
0E4FD7D920D3E43F002221FF /* VPN */ = {
isa = PBXGroup;
children = (
@ -448,6 +460,7 @@
0E24273C225950450064A1A3 /* About.storyboard */,
0E57F63F20C83FC5008323CF /* Main.storyboard */,
0ED38ADC213F44D00004D387 /* Organizer.storyboard */,
0E4B0D762366E6C800C890B4 /* Purchase.storyboard */,
0E36D25A22403469006AF062 /* Shortcuts.storyboard */,
0E57F64220C83FC7008323CF /* Assets.xcassets */,
0E9CD788225746B300D033B4 /* Flags.xcassets */,
@ -580,6 +593,7 @@
children = (
0E24273D225950CC0064A1A3 /* About */,
0E89DFCC213EEDE700741BA1 /* Organizer */,
0E4B0D6C2366E53C00C890B4 /* Purchase */,
0E24273E225950ED0064A1A3 /* Shortcuts */,
0ED31C2820CF2A340027975F /* AccountViewController.swift */,
0ED38AEB2141260D0004D387 /* ConfigurationModificationDelegate.swift */,
@ -812,6 +826,7 @@
0E9CD7872257462800D033B4 /* Providers.xcassets in Resources */,
0E9CD789225746B300D033B4 /* Flags.xcassets in Resources */,
0E57F64120C83FC5008323CF /* Main.storyboard in Resources */,
0E4B0D742366E6C800C890B4 /* Purchase.storyboard in Resources */,
0E2AC24522EC3AC10037B4B0 /* Settings.bundle in Resources */,
0E45E6E022BD793800F19312 /* App.strings in Resources */,
);
@ -981,6 +996,7 @@
0ECEE45020E1182E00A6BB43 /* Theme+Cells.swift in Sources */,
0E242740225951B00064A1A3 /* ProductManager.swift in Sources */,
0E1066C920E0F84A004F98B7 /* Cells.swift in Sources */,
0E4B0D6B2366E3C100C890B4 /* PurchaseViewController.swift in Sources */,
0EF56BBB2185AC8500B0C8AB /* SwiftGen+Segues.swift in Sources */,
0E05C5D620D1645F006EE732 /* SwiftGen+Scenes.swift in Sources */,
0E773BF8224BF37600CDDC8E /* ShortcutsViewController.swift in Sources */,
@ -1106,6 +1122,14 @@
name = App.strings;
sourceTree = "<group>";
};
0E4B0D762366E6C800C890B4 /* Purchase.storyboard */ = {
isa = PBXVariantGroup;
children = (
0E4B0D752366E6C800C890B4 /* Base */,
);
name = Purchase.storyboard;
sourceTree = "<group>";
};
0E57F63F20C83FC5008323CF /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (

View File

@ -11,6 +11,7 @@ ib:
- Passepartout-iOS/Base.lproj/About.storyboard
- Passepartout-iOS/Base.lproj/Main.storyboard
- Passepartout-iOS/Base.lproj/Organizer.storyboard
- Passepartout-iOS/Base.lproj/Purchase.storyboard
- Passepartout-iOS/Base.lproj/Shortcuts.storyboard
outputs:
- templateName: scenes-swift4