Skip to content
This repository was archived by the owner on Feb 3, 2019. It is now read-only.

Commit 6a95f38

Browse files
committed
demo code
1 parent a49be4f commit 6a95f38

File tree

11 files changed

+445
-15
lines changed

11 files changed

+445
-15
lines changed

Diff for: Info.plist

+5
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
<string>1</string>
2121
<key>LSRequiresIPhoneOS</key>
2222
<true/>
23+
<key>NSAppTransportSecurity</key>
24+
<dict>
25+
<key>NSAllowsArbitraryLoads</key>
26+
<true/>
27+
</dict>
2328
<key>UILaunchStoryboardName</key>
2429
<string>LaunchScreen</string>
2530
<key>UIMainStoryboardFile</key>

Diff for: Pods/APIManager/Sources/APIManager/Protocols/APIReturnable.swift

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: twilight.xcodeproj/project.pbxproj

+14-6
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
950366B61FB8068A003A22B0 /* LoginAwareTabBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 950366B51FB8068A003A22B0 /* LoginAwareTabBarController.swift */; };
2424
95350ABA1FB7C7DE00B3D0F5 /* twilightTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95350AB91FB7C7DE00B3D0F5 /* twilightTests.swift */; };
2525
95350AC51FB7C7DE00B3D0F5 /* twilightUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95350AC41FB7C7DE00B3D0F5 /* twilightUITests.swift */; };
26+
955ACCF11FD529B200080C37 /* DemoService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 955ACCF01FD529B200080C37 /* DemoService.swift */; };
27+
955ACCF31FD52C1B00080C37 /* DemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 955ACCF21FD52C1B00080C37 /* DemoViewController.swift */; };
2628
9587371C1FBA7BBC0049951F /* TwilightNodeDatasource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9587371B1FBA7BBC0049951F /* TwilightNodeDatasource.swift */; };
2729
9587371E1FBA7C5C0049951F /* TwilightNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9587371D1FBA7C5C0049951F /* TwilightNode.swift */; };
2830
958B824C1FB927750024095E /* ControlPanelViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 958B824B1FB927750024095E /* ControlPanelViewController.swift */; };
@@ -83,6 +85,8 @@
8385
95350AC01FB7C7DE00B3D0F5 /* twilightUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = twilightUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
8486
95350AC41FB7C7DE00B3D0F5 /* twilightUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = twilightUITests.swift; sourceTree = "<group>"; };
8587
95350AC61FB7C7DE00B3D0F5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
88+
955ACCF01FD529B200080C37 /* DemoService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoService.swift; sourceTree = "<group>"; };
89+
955ACCF21FD52C1B00080C37 /* DemoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoViewController.swift; sourceTree = "<group>"; };
8690
9587371B1FBA7BBC0049951F /* TwilightNodeDatasource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TwilightNodeDatasource.swift; sourceTree = "<group>"; };
8791
9587371D1FBA7C5C0049951F /* TwilightNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TwilightNode.swift; sourceTree = "<group>"; };
8892
958B824B1FB927750024095E /* ControlPanelViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ControlPanelViewController.swift; sourceTree = "<group>"; };
@@ -191,6 +195,7 @@
191195
950366A11FB7DDDA003A22B0 /* GrootService.swift */,
192196
9503669D1FB7DC9F003A22B0 /* GrootUsersService.swift */,
193197
9503669F1FB7DCB1003A22B0 /* GrootTwilightService.swift */,
198+
955ACCF01FD529B200080C37 /* DemoService.swift */,
194199
);
195200
path = APIServices;
196201
sourceTree = "<group>";
@@ -223,6 +228,7 @@
223228
958D167F1FB81F910010AC66 /* SystemStatusViewController.swift */,
224229
95C942081FB9067E00722946 /* SettingsViewController.swift */,
225230
958B824B1FB927750024095E /* ControlPanelViewController.swift */,
231+
955ACCF21FD52C1B00080C37 /* DemoViewController.swift */,
226232
);
227233
path = ControlViewControllers;
228234
sourceTree = "<group>";
@@ -610,7 +616,9 @@
610616
950366AF1FB7FF33003A22B0 /* UIViewController.swift in Sources */,
611617
9503669A1FB7DC59003A22B0 /* AppDelegate.swift in Sources */,
612618
950366A41FB7E1EF003A22B0 /* GrootReturnDataContainer.swift in Sources */,
619+
955ACCF31FD52C1B00080C37 /* DemoViewController.swift in Sources */,
613620
95A24D1D1FBA8EB600541873 /* CellLoading.swift in Sources */,
621+
955ACCF11FD529B200080C37 /* DemoService.swift in Sources */,
614622
95C942091FB9067E00722946 /* SettingsViewController.swift in Sources */,
615623
9587371E1FBA7C5C0049951F /* TwilightNode.swift in Sources */,
616624
950366B41FB802D0003A22B0 /* LoginController.swift in Sources */,
@@ -707,7 +715,7 @@
707715
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
708716
GCC_WARN_UNUSED_FUNCTION = YES;
709717
GCC_WARN_UNUSED_VARIABLE = YES;
710-
IPHONEOS_DEPLOYMENT_TARGET = 11.1;
718+
IPHONEOS_DEPLOYMENT_TARGET = 11.2;
711719
MTL_ENABLE_DEBUG_INFO = YES;
712720
ONLY_ACTIVE_ARCH = YES;
713721
SDKROOT = iphoneos;
@@ -758,7 +766,7 @@
758766
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
759767
GCC_WARN_UNUSED_FUNCTION = YES;
760768
GCC_WARN_UNUSED_VARIABLE = YES;
761-
IPHONEOS_DEPLOYMENT_TARGET = 11.1;
769+
IPHONEOS_DEPLOYMENT_TARGET = 11.2;
762770
MTL_ENABLE_DEBUG_INFO = NO;
763771
SDKROOT = iphoneos;
764772
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
@@ -772,10 +780,10 @@
772780
buildSettings = {
773781
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
774782
CODE_SIGN_STYLE = Automatic;
775-
DEVELOPMENT_TEAM = P3FJ87836G;
783+
DEVELOPMENT_TEAM = 8VNQTQM2L6;
776784
INFOPLIST_FILE = "$(SRCROOT)/Info.plist";
777785
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
778-
PRODUCT_BUNDLE_IDENTIFIER = acm.twilight;
786+
PRODUCT_BUNDLE_IDENTIFIER = com.acm.twilight;
779787
PRODUCT_NAME = "$(TARGET_NAME)";
780788
SWIFT_VERSION = 4.0;
781789
TARGETED_DEVICE_FAMILY = "1,2";
@@ -788,10 +796,10 @@
788796
buildSettings = {
789797
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
790798
CODE_SIGN_STYLE = Automatic;
791-
DEVELOPMENT_TEAM = P3FJ87836G;
799+
DEVELOPMENT_TEAM = 8VNQTQM2L6;
792800
INFOPLIST_FILE = "$(SRCROOT)/Info.plist";
793801
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
794-
PRODUCT_BUNDLE_IDENTIFIER = acm.twilight;
802+
PRODUCT_BUNDLE_IDENTIFIER = com.acm.twilight;
795803
PRODUCT_NAME = "$(TARGET_NAME)";
796804
SWIFT_VERSION = 4.0;
797805
TARGETED_DEVICE_FAMILY = "1,2";
Binary file not shown.

Diff for: twilight.xcworkspace/xcuserdata/rauhul.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

+146
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,150 @@
22
<Bucket
33
type = "0"
44
version = "2.0">
5+
<Breakpoints>
6+
<BreakpointProxy
7+
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
8+
<BreakpointContent
9+
shouldBeEnabled = "No"
10+
ignoreCount = "0"
11+
continueAfterRunningActions = "No"
12+
filePath = "twilight/ViewControllers/ControlViewControllers/LoginViewController.swift"
13+
timestampString = "534064642.38915"
14+
startingColumnNumber = "9223372036854775807"
15+
endingColumnNumber = "9223372036854775807"
16+
startingLineNumber = "111"
17+
endingLineNumber = "111"
18+
landmarkName = "login(sender:)"
19+
landmarkType = "7">
20+
<Locations>
21+
<Location
22+
shouldBeEnabled = "No"
23+
ignoreCount = "0"
24+
continueAfterRunningActions = "No"
25+
symbolName = "closure #2 (Swift.String) -&gt; () in twilight.LoginViewController.login(sender: Swift.Optional&lt;Any&gt;) -&gt; ()"
26+
moduleName = "twilight"
27+
usesParentBreakpointCondition = "Yes"
28+
urlString = "file:///Users/rauhul/Developer/twilight/ios/twilight/ViewControllers/ControlViewControllers/LoginViewController.swift"
29+
timestampString = "533592515.59514"
30+
startingColumnNumber = "9223372036854775807"
31+
endingColumnNumber = "9223372036854775807"
32+
startingLineNumber = "111"
33+
endingLineNumber = "111"
34+
offsetFromSymbolStart = "29">
35+
</Location>
36+
<Location
37+
shouldBeEnabled = "No"
38+
ignoreCount = "0"
39+
continueAfterRunningActions = "No"
40+
symbolName = "closure #1 () -&gt; () in closure #2 (Swift.String) -&gt; () in twilight.LoginViewController.login(sender: Swift.Optional&lt;Any&gt;) -&gt; ()"
41+
moduleName = "twilight"
42+
usesParentBreakpointCondition = "Yes"
43+
urlString = "file:///Users/rauhul/Developer/twilight/ios/twilight/ViewControllers/ControlViewControllers/LoginViewController.swift"
44+
timestampString = "533592515.597776"
45+
startingColumnNumber = "9223372036854775807"
46+
endingColumnNumber = "9223372036854775807"
47+
startingLineNumber = "112"
48+
endingLineNumber = "112"
49+
offsetFromSymbolStart = "29">
50+
</Location>
51+
</Locations>
52+
</BreakpointContent>
53+
</BreakpointProxy>
54+
<BreakpointProxy
55+
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
56+
<BreakpointContent
57+
shouldBeEnabled = "No"
58+
ignoreCount = "0"
59+
continueAfterRunningActions = "No"
60+
filePath = "twilight/ViewControllers/ControlViewControllers/LoginViewController.swift"
61+
timestampString = "534064642.389241"
62+
startingColumnNumber = "9223372036854775807"
63+
endingColumnNumber = "9223372036854775807"
64+
startingLineNumber = "98"
65+
endingLineNumber = "98"
66+
landmarkName = "login(sender:)"
67+
landmarkType = "7">
68+
</BreakpointContent>
69+
</BreakpointProxy>
70+
<BreakpointProxy
71+
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
72+
<BreakpointContent
73+
shouldBeEnabled = "No"
74+
ignoreCount = "0"
75+
continueAfterRunningActions = "No"
76+
filePath = "Pods/APIManager/Sources/APIManager/Classes/APIRequest.swift"
77+
timestampString = "534068461.291599"
78+
startingColumnNumber = "9223372036854775807"
79+
endingColumnNumber = "9223372036854775807"
80+
startingLineNumber = "143"
81+
endingLineNumber = "143"
82+
landmarkName = "perform(withAuthorization:)"
83+
landmarkType = "7">
84+
</BreakpointContent>
85+
</BreakpointProxy>
86+
<BreakpointProxy
87+
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
88+
<BreakpointContent
89+
shouldBeEnabled = "No"
90+
ignoreCount = "0"
91+
continueAfterRunningActions = "No"
92+
filePath = "Pods/APIManager/Sources/APIManager/Classes/APIRequest.swift"
93+
timestampString = "534068461.291657"
94+
startingColumnNumber = "9223372036854775807"
95+
endingColumnNumber = "9223372036854775807"
96+
startingLineNumber = "148"
97+
endingLineNumber = "148"
98+
landmarkName = "perform(withAuthorization:)"
99+
landmarkType = "7">
100+
</BreakpointContent>
101+
</BreakpointProxy>
102+
<BreakpointProxy
103+
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
104+
<BreakpointContent
105+
shouldBeEnabled = "No"
106+
ignoreCount = "0"
107+
continueAfterRunningActions = "No"
108+
filePath = "Pods/APIManager/Sources/APIManager/Classes/APIRequest.swift"
109+
timestampString = "534068461.2917"
110+
startingColumnNumber = "9223372036854775807"
111+
endingColumnNumber = "9223372036854775807"
112+
startingLineNumber = "151"
113+
endingLineNumber = "151"
114+
landmarkName = "perform(withAuthorization:)"
115+
landmarkType = "7">
116+
</BreakpointContent>
117+
</BreakpointProxy>
118+
<BreakpointProxy
119+
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
120+
<BreakpointContent
121+
shouldBeEnabled = "No"
122+
ignoreCount = "0"
123+
continueAfterRunningActions = "No"
124+
filePath = "Pods/APIManager/Sources/APIManager/Classes/APIRequest.swift"
125+
timestampString = "534068461.29174"
126+
startingColumnNumber = "9223372036854775807"
127+
endingColumnNumber = "9223372036854775807"
128+
startingLineNumber = "154"
129+
endingLineNumber = "154"
130+
landmarkName = "perform(withAuthorization:)"
131+
landmarkType = "7">
132+
</BreakpointContent>
133+
</BreakpointProxy>
134+
<BreakpointProxy
135+
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
136+
<BreakpointContent
137+
shouldBeEnabled = "No"
138+
ignoreCount = "0"
139+
continueAfterRunningActions = "No"
140+
filePath = "Pods/APIManager/Sources/APIManager/Classes/APIRequest.swift"
141+
timestampString = "534068461.291777"
142+
startingColumnNumber = "9223372036854775807"
143+
endingColumnNumber = "9223372036854775807"
144+
startingLineNumber = "157"
145+
endingLineNumber = "157"
146+
landmarkName = "perform(withAuthorization:)"
147+
landmarkType = "7">
148+
</BreakpointContent>
149+
</BreakpointProxy>
150+
</Breakpoints>
5151
</Bucket>

Diff for: twilight/APIServices/DemoService.swift

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
//
2+
// DemoService.swift
3+
// twilight
4+
//
5+
// Created by Rauhul Varma on 12/4/17.
6+
// Copyright © 2017 acm. All rights reserved.
7+
//
8+
9+
import Foundation
10+
import APIManager
11+
12+
13+
14+
class DemoService: APIService {
15+
open class var baseURL: String {
16+
return "http://192.168.1.182:5000"
17+
}
18+
19+
open class var headers: HTTPHeaders? {
20+
return [
21+
"Content-Type": "application/json",
22+
]
23+
}
24+
25+
class func sendColor(r: UInt8, g: UInt8, b: UInt8) -> APIRequest<DemoService, Data> {
26+
return APIRequest<DemoService, Data>(endpoint: "/color", params: ["r": "\(r)", "g": "\(g)", "b": "\(b)"], method: .GET)
27+
}
28+
29+
}
30+
31+
extension Data: APIReturnable {
32+
public init(from data: Data) throws {
33+
self = data
34+
}
35+
}

Diff for: twilight/Models/GrootReturnDataContainer.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import Foundation
1010
import APIManager
1111

12+
1213
class GrootReturnDataContainer<ReturnData: Codable>: Codable, APIReturnable {
1314

1415
var data: ReturnData?
@@ -26,4 +27,3 @@ class GrootReturnDataContainer<ReturnData: Codable>: Codable, APIReturnable {
2627
}
2728

2829
}
29-

0 commit comments

Comments
 (0)