Skip to content

Commit 4dcfea5

Browse files
committed
More demo app work
1 parent e316bff commit 4dcfea5

37 files changed

+855
-354
lines changed

Demo/Demo.xcodeproj/project.pbxproj

+12
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,30 @@
88

99
/* Begin PBXBuildFile section */
1010
49BBBE829403C46C88EE748E /* Pods_Demo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 094A4CD596AFE2FDC36B2833 /* Pods_Demo.framework */; };
11+
8642F4361D5F7F540061BDCD /* ExploreViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8642F4351D5F7F540061BDCD /* ExploreViewController.swift */; };
1112
86AEDCE61D5D1DB70030232E /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86AEDCE51D5D1DB70030232E /* AppDelegate.swift */; };
1213
86AEDCE81D5D1DB70030232E /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86AEDCE71D5D1DB70030232E /* ViewController.swift */; };
1314
86AEDCEB1D5D1DB70030232E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 86AEDCE91D5D1DB70030232E /* Main.storyboard */; };
1415
86AEDCED1D5D1DB70030232E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 86AEDCEC1D5D1DB70030232E /* Assets.xcassets */; };
1516
86AEDCF01D5D1DB70030232E /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 86AEDCEE1D5D1DB70030232E /* LaunchScreen.storyboard */; };
17+
86C0ABA01D5E814600F76BD6 /* TacoDialogView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 86C0AB9F1D5E814600F76BD6 /* TacoDialogView.xib */; };
18+
86C0ABA21D5E816600F76BD6 /* TacoDialogView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86C0ABA11D5E816600F76BD6 /* TacoDialogView.swift */; };
1619
/* End PBXBuildFile section */
1720

1821
/* Begin PBXFileReference section */
1922
094A4CD596AFE2FDC36B2833 /* Pods_Demo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Demo.framework; sourceTree = BUILT_PRODUCTS_DIR; };
2023
160AC8A3EE68E1D705664BF8 /* Pods-Demo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Demo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Demo/Pods-Demo.debug.xcconfig"; sourceTree = "<group>"; };
2124
16131DA1E3BA049C9E4C0308 /* Pods-Demo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Demo.release.xcconfig"; path = "Pods/Target Support Files/Pods-Demo/Pods-Demo.release.xcconfig"; sourceTree = "<group>"; };
25+
8642F4351D5F7F540061BDCD /* ExploreViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExploreViewController.swift; sourceTree = "<group>"; };
2226
86AEDCE21D5D1DB70030232E /* Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Demo.app; sourceTree = BUILT_PRODUCTS_DIR; };
2327
86AEDCE51D5D1DB70030232E /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
2428
86AEDCE71D5D1DB70030232E /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
2529
86AEDCEA1D5D1DB70030232E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
2630
86AEDCEC1D5D1DB70030232E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
2731
86AEDCEF1D5D1DB70030232E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
2832
86AEDCF11D5D1DB70030232E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
33+
86C0AB9F1D5E814600F76BD6 /* TacoDialogView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TacoDialogView.xib; sourceTree = "<group>"; };
34+
86C0ABA11D5E816600F76BD6 /* TacoDialogView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TacoDialogView.swift; sourceTree = "<group>"; };
2935
/* End PBXFileReference section */
3036

3137
/* Begin PBXFrameworksBuildPhase section */
@@ -80,10 +86,13 @@
8086
children = (
8187
86AEDCE51D5D1DB70030232E /* AppDelegate.swift */,
8288
86AEDCE71D5D1DB70030232E /* ViewController.swift */,
89+
8642F4351D5F7F540061BDCD /* ExploreViewController.swift */,
8390
86AEDCE91D5D1DB70030232E /* Main.storyboard */,
8491
86AEDCEC1D5D1DB70030232E /* Assets.xcassets */,
8592
86AEDCEE1D5D1DB70030232E /* LaunchScreen.storyboard */,
8693
86AEDCF11D5D1DB70030232E /* Info.plist */,
94+
86C0ABA11D5E816600F76BD6 /* TacoDialogView.swift */,
95+
86C0AB9F1D5E814600F76BD6 /* TacoDialogView.xib */,
8796
);
8897
path = Demo;
8998
sourceTree = "<group>";
@@ -151,6 +160,7 @@
151160
files = (
152161
86AEDCF01D5D1DB70030232E /* LaunchScreen.storyboard in Resources */,
153162
86AEDCED1D5D1DB70030232E /* Assets.xcassets in Resources */,
163+
86C0ABA01D5E814600F76BD6 /* TacoDialogView.xib in Resources */,
154164
86AEDCEB1D5D1DB70030232E /* Main.storyboard in Resources */,
155165
);
156166
runOnlyForDeploymentPostprocessing = 0;
@@ -210,8 +220,10 @@
210220
isa = PBXSourcesBuildPhase;
211221
buildActionMask = 2147483647;
212222
files = (
223+
8642F4361D5F7F540061BDCD /* ExploreViewController.swift in Sources */,
213224
86AEDCE81D5D1DB70030232E /* ViewController.swift in Sources */,
214225
86AEDCE61D5D1DB70030232E /* AppDelegate.swift in Sources */,
226+
86C0ABA21D5E816600F76BD6 /* TacoDialogView.swift in Sources */,
215227
);
216228
runOnlyForDeploymentPostprocessing = 0;
217229
};
Loading

Demo/Demo/Base.lproj/Main.storyboard

+55-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<rect key="frame" x="0.0" y="92" width="600" height="80"/>
3737
<autoresizingMask key="autoresizingMask"/>
3838
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="2n5-7h-3B5" id="Q5r-8D-38q">
39-
<rect key="frame" x="0.0" y="0.0" width="600" height="79"/>
39+
<rect key="frame" x="0.0" y="0.0" width="600" height="79.5"/>
4040
<autoresizingMask key="autoresizingMask"/>
4141
<subviews>
4242
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="252" verticalCompressionResistancePriority="752" text="TITLE" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Icl-Ci-lfe">
@@ -67,6 +67,42 @@
6767
<outlet property="titleLabel" destination="Icl-Ci-lfe" id="XnB-LL-hx6"/>
6868
</connections>
6969
</tableViewCell>
70+
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="Explore" rowHeight="80" id="4Pm-kC-YGr" userLabel="ExploreCell" customClass="TitleBodyCell" customModule="Demo" customModuleProvider="target">
71+
<rect key="frame" x="0.0" y="172" width="600" height="80"/>
72+
<autoresizingMask key="autoresizingMask"/>
73+
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="4Pm-kC-YGr" id="LmG-UL-Bu8">
74+
<rect key="frame" x="0.0" y="0.0" width="567" height="79.5"/>
75+
<autoresizingMask key="autoresizingMask"/>
76+
<subviews>
77+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="252" verticalCompressionResistancePriority="752" misplaced="YES" text="EXPLORE" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TbM-iT-SVg">
78+
<rect key="frame" x="18" y="18" width="564" height="16"/>
79+
<fontDescription key="fontDescription" type="boldSystem" pointSize="13"/>
80+
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
81+
<nil key="highlightedColor"/>
82+
</label>
83+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="Explore many of the SwiftMessages configuration options." textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Siq-Fh-MNa">
84+
<rect key="frame" x="18" y="42" width="564" height="20"/>
85+
<fontDescription key="fontDescription" type="system" pointSize="16"/>
86+
<color key="textColor" red="0.47391887630000001" green="0.47391887630000001" blue="0.47391887630000001" alpha="1" colorSpace="calibratedRGB"/>
87+
<nil key="highlightedColor"/>
88+
</label>
89+
</subviews>
90+
<constraints>
91+
<constraint firstAttribute="trailingMargin" secondItem="Siq-Fh-MNa" secondAttribute="trailing" constant="10" id="80d-y2-OaV"/>
92+
<constraint firstItem="TbM-iT-SVg" firstAttribute="top" secondItem="LmG-UL-Bu8" secondAttribute="topMargin" constant="10" id="8gG-fN-yDK"/>
93+
<constraint firstItem="TbM-iT-SVg" firstAttribute="leading" secondItem="LmG-UL-Bu8" secondAttribute="leadingMargin" constant="10" id="TRM-3t-LhI"/>
94+
<constraint firstAttribute="bottomMargin" secondItem="Siq-Fh-MNa" secondAttribute="bottom" constant="10" id="Tdt-Nk-UrS"/>
95+
<constraint firstItem="Siq-Fh-MNa" firstAttribute="leading" secondItem="LmG-UL-Bu8" secondAttribute="leadingMargin" constant="10" id="YMF-hA-DB8"/>
96+
<constraint firstItem="Siq-Fh-MNa" firstAttribute="top" secondItem="TbM-iT-SVg" secondAttribute="bottom" constant="8" id="vck-Dy-ghK"/>
97+
<constraint firstAttribute="trailingMargin" secondItem="TbM-iT-SVg" secondAttribute="trailing" constant="10" id="zxz-YD-4Rc"/>
98+
</constraints>
99+
</tableViewCellContentView>
100+
<connections>
101+
<outlet property="bodyLabel" destination="Siq-Fh-MNa" id="gAv-bW-aS2"/>
102+
<outlet property="titleLabel" destination="TbM-iT-SVg" id="qSC-ce-0UT"/>
103+
<segue destination="854-SZ-S2N" kind="show" id="OlK-CU-oJU"/>
104+
</connections>
105+
</tableViewCell>
70106
</prototypes>
71107
<connections>
72108
<outlet property="dataSource" destination="vur-BZ-g1e" id="rfz-yY-IL6"/>
@@ -79,6 +115,24 @@
79115
</objects>
80116
<point key="canvasLocation" x="1283" y="305"/>
81117
</scene>
118+
<!--View Controller-->
119+
<scene sceneID="xrF-fl-h7J">
120+
<objects>
121+
<viewController id="854-SZ-S2N" sceneMemberID="viewController">
122+
<layoutGuides>
123+
<viewControllerLayoutGuide type="top" id="H6A-wl-vtP"/>
124+
<viewControllerLayoutGuide type="bottom" id="SMQ-5x-TCN"/>
125+
</layoutGuides>
126+
<view key="view" contentMode="scaleToFill" id="4Qp-xZ-Cso">
127+
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
128+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
129+
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
130+
</view>
131+
</viewController>
132+
<placeholder placeholderIdentifier="IBFirstResponder" id="ae5-g8-r3f" userLabel="First Responder" sceneMemberID="firstResponder"/>
133+
</objects>
134+
<point key="canvasLocation" x="2092" y="305"/>
135+
</scene>
82136
<!--Demo-->
83137
<scene sceneID="TNg-VF-1BI">
84138
<objects>

Demo/Demo/ExploreViewController.swift

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
//
2+
// ExploreViewController.swift
3+
// Demo
4+
//
5+
// Created by Tim Moose on 8/13/16.
6+
// Copyright © 2016 SwiftKick Mobile. All rights reserved.
7+
//
8+
9+
import UIKit
10+
11+
class ExploreViewController: UIViewController {
12+
13+
override func viewDidLoad() {
14+
super.viewDidLoad()
15+
16+
// Do any additional setup after loading the view.
17+
}
18+
19+
override func didReceiveMemoryWarning() {
20+
super.didReceiveMemoryWarning()
21+
// Dispose of any resources that can be recreated.
22+
}
23+
24+
25+
/*
26+
// MARK: - Navigation
27+
28+
// In a storyboard-based application, you will often want to do a little preparation before navigation
29+
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
30+
// Get the new view controller using segue.destinationViewController.
31+
// Pass the selected object to the new view controller.
32+
}
33+
*/
34+
35+
}

Demo/Demo/TacoDialogView.swift

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
//
2+
// TacoDialogView.swift
3+
// Demo
4+
//
5+
// Created by Tim Moose on 8/12/16.
6+
// Copyright © 2016 SwiftKick Mobile. All rights reserved.
7+
//
8+
9+
import UIKit
10+
import SwiftMessages
11+
12+
class TacoDialogView: MessageView {
13+
14+
private static var tacoTitles = [
15+
1 : "One, Please",
16+
2 : "Make it two!",
17+
3 : "Three!!!",
18+
]
19+
20+
var getTacosAction: ((count: Int) -> Void)?
21+
var cancelAction: (() -> Void)?
22+
23+
private var count = 1 {
24+
didSet {
25+
iconLabel?.text = String(count: count, repeatedValue: "🌮" as Character)
26+
titleLabel?.text = TacoDialogView.tacoTitles[count]
27+
}
28+
}
29+
30+
@IBAction func getTacos() {
31+
getTacosAction?(count: Int(tacoSlider.value))
32+
}
33+
34+
@IBAction func cancel() {
35+
cancelAction?()
36+
}
37+
38+
@IBOutlet weak var tacoSlider: UISlider!
39+
40+
@IBAction func tacoSliderSlided(slider: UISlider) {
41+
count = Int(slider.value)
42+
}
43+
}

0 commit comments

Comments
 (0)