Skip to content

Commit 6652f96

Browse files
committed
Implement basic navigation
1 parent 35ce4ea commit 6652f96

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2391
-142
lines changed

.gitmodules

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,15 @@
99
url = https://github.com/ReactiveX/RxSwift.git
1010
[submodule "Carthage/Checkouts/MirrorDiffKit"]
1111
url = https://github.com/Kuniwak/MirrorDiffKit.git
12+
[submodule "Carthage/Checkouts/Unbox"]
13+
path = Carthage/Checkouts/Unbox
14+
url = https://github.com/JohnSundell/Unbox.git
15+
[submodule "Carthage/Checkouts/PromiseKit"]
16+
path = Carthage/Checkouts/PromiseKit
17+
url = https://github.com/mxcl/PromiseKit.git
18+
[submodule "Carthage/Checkouts/KeychainAccess"]
19+
path = Carthage/Checkouts/KeychainAccess
20+
url = https://github.com/kishikawakatsumi/KeychainAccess.git
21+
[submodule "Carthage/Checkouts/Result"]
22+
path = Carthage/Checkouts/Result
23+
url = https://github.com/antitypical/Result.git

Cartfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
github "mac-cain13/R.swift.Library" "594965c3c1d42d9a4390eec3ecf159ab8210cb78"
2-
github "xmartlabs/XLPagerTabStrip" ~> 7.0.0
32
github "ReactiveX/RxSwift" ~> 3.0
43
github "Kuniwak/MirrorDiffKit" ~> 0.0.3
4+
github "JohnSundell/Unbox" ~> 2.4.0
5+
github "mxcl/PromiseKit" ~> 4.1.8
6+
github "antitypical/Result" ~> 3.2.1

Cartfile.resolved

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
github "kishikawakatsumi/KeychainAccess" "v3.0.1"
12
github "Kuniwak/MirrorDiffKit" "0.0.3"
3+
github "mxcl/PromiseKit" "4.1.8"
24
github "mac-cain13/R.swift.Library" "594965c3c1d42d9a4390eec3ecf159ab8210cb78"
5+
github "antitypical/Result" "3.2.1"
36
github "ReactiveX/RxSwift" "3.2.0"
7+
github "JohnSundell/Unbox" "2.4.0"
48
github "xmartlabs/XLPagerTabStrip" "7.0.0"

Carthage/Checkouts/KeychainAccess

Submodule KeychainAccess added at 20f0c12

Carthage/Checkouts/PromiseKit

Submodule PromiseKit added at fec457a

Carthage/Checkouts/Result

Submodule Result added at 2af7c14

Carthage/Checkouts/Unbox

Submodule Unbox added at ba42e01

TestableDesignExample.xcodeproj/project.pbxproj

Lines changed: 291 additions & 16 deletions
Large diffs are not rendered by default.
Lines changed: 16 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,32 @@
1-
//
2-
// AppDelegate.swift
3-
// TestableDesignExample
4-
//
5-
// Created by yuki.kokubun on 2017/03/11.
6-
// Copyright (c) 2017 Kuniwak. All rights reserved.
7-
//
8-
91
import UIKit
102

113

124
@UIApplicationMain
135
class AppDelegate: UIResponder, UIApplicationDelegate {
14-
156
var window: UIWindow?
167

178

18-
199
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
20-
// Override point for customization after application launch.
21-
return true
22-
}
23-
24-
25-
func applicationWillResignActive(_ application: UIApplication) {
26-
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
27-
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
28-
29-
}
30-
10+
let window = UIWindow(frame: UIScreen.main.bounds)
11+
window.rootViewController = BootstrapViewController.create()
12+
self.window = window
3113

32-
func applicationDidEnterBackground(_ application: UIApplication) {
33-
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
34-
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
35-
36-
}
14+
switch BootstrapResourceRegistry.create() {
15+
case let .success(registry):
3716

17+
let rootNavigator = RootNavigator(
18+
willUpdate: window,
19+
byReading: registry
20+
)
3821

39-
func applicationWillEnterForeground(_ application: UIApplication) {
40-
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
41-
}
22+
rootNavigator.navigateToRoot()
4223

24+
case let .failure(error):
25+
window.rootViewController = FatalErrorViewController.create(
26+
debugInfo: error
27+
)
28+
}
4329

44-
func applicationDidBecomeActive(_ application: UIApplication) {
45-
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
30+
return true
4631
}
47-
48-
49-
func applicationWillTerminate(_ application: UIApplication) {
50-
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
51-
}
52-
53-
54-
5532
}

TestableDesignExample/Base.lproj/Main.storyboard

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,35 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11134" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
3+
<device id="retina4_7" orientation="portrait">
4+
<adaptation id="fullscreen"/>
5+
</device>
36
<dependencies>
4-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11106"/>
7+
<deployment identifier="iOS"/>
8+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
59
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
610
</dependencies>
711
<scenes>
8-
<!--View Controller-->
12+
<!--Bootstrap View Controller-->
913
<scene sceneID="tne-QT-ifu">
1014
<objects>
11-
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
15+
<viewController storyboardIdentifier="BootstrapViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="BYZ-38-t0r" customClass="BootstrapViewController" customModule="TestableDesignExample" sceneMemberID="viewController">
1216
<layoutGuides>
13-
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
14-
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
17+
<viewControllerLayoutGuide type="top" id="yBr-vd-44h"/>
18+
<viewControllerLayoutGuide type="bottom" id="CnS-oS-6tW"/>
1519
</layoutGuides>
16-
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
20+
<view key="view" contentMode="scaleToFill" id="ivO-8p-0zj">
1721
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
18-
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
19-
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
22+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
23+
<subviews>
24+
<activityIndicatorView opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" style="white" translatesAutoresizingMaskIntoConstraints="NO" id="Wde-fx-Mlm">
25+
<rect key="frame" x="177.5" y="323" width="20" height="20"/>
26+
</activityIndicatorView>
27+
</subviews>
28+
<color key="backgroundColor" cocoaTouchSystemColor="darkTextColor"/>
29+
<constraints>
30+
<constraint firstItem="Wde-fx-Mlm" firstAttribute="centerY" secondItem="ivO-8p-0zj" secondAttribute="centerY" id="OZE-4T-erC"/>
31+
<constraint firstItem="Wde-fx-Mlm" firstAttribute="centerX" secondItem="ivO-8p-0zj" secondAttribute="centerX" id="Pzq-wl-S6I"/>
32+
</constraints>
2033
</view>
2134
</viewController>
2235
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>

0 commit comments

Comments
 (0)