Link Device To An Accout: add segues and view controller

Change-Id: I29c3862d0a732c276583a9f6c6561aca825923da
parent 6ae4a1b6
......@@ -118,6 +118,7 @@
5669A7FA1EA904AF003C7B93 /* SwitchCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5669A7F91EA904AF003C7B93 /* SwitchCell.xib */; };
5669A7FC1EA904D2003C7B93 /* TextFieldCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5669A7FB1EA904D2003C7B93 /* TextFieldCell.xib */; };
5669A7FE1EA904E4003C7B93 /* TextCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5669A7FD1EA904E4003C7B93 /* TextCell.xib */; };
5669A8031EAA58E6003C7B93 /* LinkDeviceToAccountViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5669A8021EAA58E6003C7B93 /* LinkDeviceToAccountViewController.swift */; };
568F56751EA7E5DE00132D7D /* PKHUD.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 568F56721EA7E38F00132D7D /* PKHUD.framework */; };
56AC64D51E7C7F4000EA1AA9 /* WelcomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56AC64D41E7C7F4000EA1AA9 /* WelcomeViewController.swift */; };
56AC64D91E8012CA00EA1AA9 /* Walkthrough.strings in Resources */ = {isa = PBXBuildFile; fileRef = 56AC64DB1E8012CA00EA1AA9 /* Walkthrough.strings */; };
......@@ -271,6 +272,7 @@
5669A7F91EA904AF003C7B93 /* SwitchCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SwitchCell.xib; sourceTree = "<group>"; };
5669A7FB1EA904D2003C7B93 /* TextFieldCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TextFieldCell.xib; sourceTree = "<group>"; };
5669A7FD1EA904E4003C7B93 /* TextCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TextCell.xib; sourceTree = "<group>"; };
5669A8021EAA58E6003C7B93 /* LinkDeviceToAccountViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LinkDeviceToAccountViewController.swift; sourceTree = "<group>"; };
568F56721EA7E38F00132D7D /* PKHUD.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PKHUD.framework; path = Carthage/Build/iOS/PKHUD.framework; sourceTree = "<group>"; };
56AC64D41E7C7F4000EA1AA9 /* WelcomeViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WelcomeViewController.swift; sourceTree = "<group>"; };
56AC64DA1E8012CA00EA1AA9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Walkthrough.strings; sourceTree = "<group>"; };
......@@ -375,6 +377,7 @@
56AC64DD1E804EB500EA1AA9 /* Cells */,
0273C3031E0C68B100CF00BA /* CreateProfileViewController.swift */,
0273C3041E0C68B100CF00BA /* CreateRingAccountViewController.swift */,
5669A8021EAA58E6003C7B93 /* LinkDeviceToAccountViewController.swift */,
);
name = Walkthrough;
sourceTree = "<group>";
......@@ -854,6 +857,7 @@
buildActionMask = 2147483647;
files = (
557086521E8ADB9D001A7CE4 /* SystemAdapter.mm in Sources */,
5669A8031EAA58E6003C7B93 /* LinkDeviceToAccountViewController.swift in Sources */,
0273C3051E0C68B100CF00BA /* CreateProfileViewController.swift in Sources */,
02E1A0251DDE4ABA00D75B59 /* BoolStringExtension.swift in Sources */,
04399AAC1D1C304300E99CD9 /* AccountAdapter.mm in Sources */,
......
/*
* Copyright (C) 2017 Savoir-faire Linux Inc.
*
* Author: Silbino Goncalves Matado <silbino.gmatado@savoirfairelinux.com>
*
* This program 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.
*
* This program 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 this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
import UIKit
class LinkDeviceToAccountViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
}
......@@ -20,8 +20,20 @@
import UIKit
enum ProfileCreationType {
case linkDeviceToAccount
case createProfile
}
class CreateProfileViewController: UIViewController {
var profileCreationType :ProfileCreationType?
@IBAction func skip(_ sender: Any) {
performSegue(withIdentifier: "ProfileToAccountSegue", sender: sender)
if profileCreationType == .linkDeviceToAccount {
performSegue(withIdentifier: "ProfileToLinkSegue", sender: sender)
} else if profileCreationType == .createProfile {
performSegue(withIdentifier: "ProfileToAccountSegue", sender: sender)
}
}
}
......@@ -27,7 +27,7 @@
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="c5B-LX-9rY" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-489" y="24"/>
<point key="canvasLocation" x="-1016" y="365"/>
</scene>
<!--Welcome View Controller-->
<scene sceneID="BPo-UM-NNL">
......@@ -116,12 +116,12 @@
<outlet property="linkDeviceButton" destination="R0q-9u-3WR" id="W2P-ar-nh0"/>
<outlet property="welcomeLabel" destination="SnZ-RF-3dF" id="Rgf-TM-GFn"/>
<segue destination="dmb-i6-bo9" kind="show" identifier="CreateProfileSegue" id="GoD-mz-wCr"/>
<segue destination="Pvr-wr-tIH" kind="show" identifier="LinkDeviceToAccountSegue" id="0fW-pa-Kqe"/>
<segue destination="dmb-i6-bo9" kind="show" identifier="LinkDeviceToAccountSegue" id="k4b-a3-FoK"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="PWI-c5-979" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="324.375" y="23.75"/>
<point key="canvasLocation" x="-66" y="366"/>
</scene>
<!--Create Profile View Controller-->
<scene sceneID="NEP-n0-rvD">
......@@ -154,12 +154,72 @@
</view>
<connections>
<segue destination="kzh-87-Ao9" kind="show" identifier="ProfileToAccountSegue" id="CDO-bH-qiw"/>
<segue destination="bDM-Sb-hbx" kind="show" identifier="ProfileToLinkSegue" id="dop-gF-ixP"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="YDh-Qj-wfv" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1105" y="367"/>
</scene>
<!--Table View Controller-->
<scene sceneID="2lN-mL-RUf">
<objects>
<tableViewController id="bDM-Sb-hbx" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="eFu-ir-jgw">
<rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="0.039215686270000001" green="0.4549019608" blue="0.53725490200000003" alpha="1" colorSpace="calibratedRGB"/>
<view key="tableHeaderView" contentMode="scaleToFill" id="3uF-hj-J2O" userLabel="Header">
<rect key="frame" x="0.0" y="0.0" width="320" height="130"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Link this device" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hEw-Wn-alu">
<rect key="frame" x="8" y="8" width="304" height="114"/>
<fontDescription key="fontDescription" type="system" pointSize="24"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="hEw-Wn-alu" firstAttribute="leading" secondItem="3uF-hj-J2O" secondAttribute="leading" constant="8" id="00U-c3-n95"/>
<constraint firstAttribute="trailing" secondItem="hEw-Wn-alu" secondAttribute="trailing" constant="8" id="Aut-xd-LuF"/>
<constraint firstAttribute="bottom" secondItem="hEw-Wn-alu" secondAttribute="bottom" constant="8" id="TDc-e8-wb3"/>
<constraint firstItem="hEw-Wn-alu" firstAttribute="top" secondItem="3uF-hj-J2O" secondAttribute="top" constant="8" id="auu-2K-J6Y"/>
</constraints>
</view>
<view key="tableFooterView" contentMode="scaleToFill" id="bQ2-6Y-CIW" userLabel="Footer">
<rect key="frame" x="0.0" y="130" width="320" height="54"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="UQJ-hF-j2O" customClass="RoundedButton" customModule="Ring" customModuleProvider="target">
<rect key="frame" x="120.5" y="8" width="79" height="30"/>
<color key="backgroundColor" red="0.0" green="0.29803921570000003" blue="0.37647058820000001" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="RGF-Ib-dT9"/>
</constraints>
<state key="normal" title="Link Device">
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</state>
</button>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="UQJ-hF-j2O" firstAttribute="centerX" secondItem="bQ2-6Y-CIW" secondAttribute="centerX" id="7LD-pW-9BH"/>
<constraint firstItem="UQJ-hF-j2O" firstAttribute="top" secondItem="bQ2-6Y-CIW" secondAttribute="top" constant="8" id="FY8-ef-pse"/>
<constraint firstAttribute="bottom" secondItem="UQJ-hF-j2O" secondAttribute="bottom" constant="16" id="pmA-aY-Do4"/>
</constraints>
</view>
<connections>
<outlet property="dataSource" destination="bDM-Sb-hbx" id="4fq-3g-DLG"/>
<outlet property="delegate" destination="bDM-Sb-hbx" id="caJ-9P-wkv"/>
</connections>
</tableView>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Xl1-4e-7qX" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="2078" y="-216"/>
</scene>
<!--Create Ring Account View Controller-->
<scene sceneID="XTt-go-ZNJ">
<objects>
......@@ -222,7 +282,7 @@
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="W0G-TV-Z9c" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1913" y="291"/>
<point key="canvasLocation" x="2078" y="581"/>
</scene>
<!--View Controller-->
<scene sceneID="c8H-6M-3dO">
......@@ -240,28 +300,13 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="bS8-E0-lOu" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="2852" y="367"/>
</scene>
<!--View Controller-->
<scene sceneID="JGg-HD-FXJ">
<objects>
<viewController id="Pvr-wr-tIH" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="gkO-23-STp"/>
<viewControllerLayoutGuide type="bottom" id="6TZ-Qs-gfp"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="q5g-8U-TUZ">
<rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="aLY-Iv-Nss" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1106" y="-330"/>
<point key="canvasLocation" x="3049" y="581"/>
</scene>
</scenes>
<resources>
<image name="logo-ring-beta2-blanc" width="180" height="66"/>
</resources>
<inferredMetricsTieBreakers>
<segue reference="k4b-a3-FoK"/>
</inferredMetricsTieBreakers>
</document>
......@@ -58,6 +58,18 @@ class WelcomeViewController: UIViewController {
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
self.navigationController?.setNavigationBarHidden(false, animated: true)
var profileCreationType :ProfileCreationType?
if segue.identifier == createProfileSegueIdentifier {
profileCreationType = .createProfile
} else if segue.identifier == linkDeviceToAccountSegueIdentifier {
profileCreationType = .linkDeviceToAccount
}
if let createProfileViewController = segue.destination as? CreateProfileViewController {
createProfileViewController.profileCreationType = profileCreationType
}
}
func setupUI() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment