Skip to content

Commit b53cb09

Browse files
ColhodmColhodm
authored andcommitted
Did more back end integration
1 parent eb37a55 commit b53cb09

9 files changed

Lines changed: 282 additions & 97 deletions

File tree

Cal-Hacks-TBD/Cal-Hacks-TBD/Base.lproj/Main.storyboard

Lines changed: 69 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,6 @@
3232
<fontDescription key="fontDescription" type="system" pointSize="14"/>
3333
<textInputTraits key="textInputTraits"/>
3434
</textField>
35-
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="i1K-gj-o2c">
36-
<rect key="frame" x="68" y="539" width="210" height="30"/>
37-
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
38-
<state key="normal" title="Continue to Map Page for Now"/>
39-
<connections>
40-
<segue destination="3h1-n7-Cyk" kind="show" identifier="mapscreensegue" id="Z69-EN-MgI"/>
41-
</connections>
42-
</button>
4335
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Username" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="h8e-9u-8wV">
4436
<rect key="frame" x="139" y="127" width="79" height="21"/>
4537
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
@@ -89,18 +81,27 @@
8981
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
9082
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
9183
</view>
92-
<navigationItem key="navigationItem" id="zbt-d5-HTa"/>
84+
<navigationItem key="navigationItem" id="zbt-d5-HTa">
85+
<barButtonItem key="rightBarButtonItem" title="Tots" id="x9y-P7-v98">
86+
<connections>
87+
<action selector="goToContracts:" destination="BYZ-38-t0r" id="cRA-HY-jal"/>
88+
</connections>
89+
</barButtonItem>
90+
</navigationItem>
9391
<connections>
9492
<outlet property="firstBox" destination="PEP-wQ-Vvf" id="CCW-wf-DbH"/>
9593
<outlet property="secondBox" destination="ZYQ-cX-gJg" id="5CF-b9-Nhd"/>
94+
<outlet property="signUpBox" destination="EGX-U1-Sqy" id="24n-yT-NBH"/>
9695
<segue destination="diG-zi-HYZ" kind="show" identifier="createContract" id="LAL-j6-ozX"/>
96+
<segue destination="3h1-n7-Cyk" kind="show" identifier="mapscreensegue" id="1iT-G4-co4"/>
97+
<segue destination="F4z-IV-P8x" kind="show" identifier="tempContractList" id="wM3-Xo-syq"/>
9798
</connections>
9899
</viewController>
99100
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
100101
</objects>
101102
<point key="canvasLocation" x="1948" y="55.322338830584712"/>
102103
</scene>
103-
<!--Map View Controller-->
104+
<!--Item-->
104105
<scene sceneID="PeV-wZ-jsx">
105106
<objects>
106107
<viewController id="3h1-n7-Cyk" customClass="MapViewController" customModule="Cal_Hacks_TBD" customModuleProvider="target" sceneMemberID="viewController">
@@ -110,6 +111,9 @@
110111
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
111112
<viewLayoutGuide key="safeArea" id="Nlh-Be-eMw"/>
112113
</view>
114+
<tabBarItem key="tabBarItem" title="Item" id="usF-FS-aLj"/>
115+
<toolbarItems/>
116+
<simulatedToolbarMetrics key="simulatedBottomBarMetrics"/>
113117
<connections>
114118
<outlet property="mapView" destination="QIN-1X-Vmf" id="eB4-3t-JLW"/>
115119
</connections>
@@ -118,6 +122,24 @@
118122
</objects>
119123
<point key="canvasLocation" x="2706.4000000000001" y="54.422788605697157"/>
120124
</scene>
125+
<!--Tab Bar Controller-->
126+
<scene sceneID="H01-QJ-eJt">
127+
<objects>
128+
<tabBarController id="B25-uf-jTB" sceneMemberID="viewController">
129+
<tabBar key="tabBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="fBz-iV-tqV">
130+
<rect key="frame" x="0.0" y="0.0" width="375" height="49"/>
131+
<autoresizingMask key="autoresizingMask"/>
132+
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
133+
</tabBar>
134+
<connections>
135+
<segue destination="3h1-n7-Cyk" kind="relationship" relationship="viewControllers" id="z37-xQ-3lb"/>
136+
<segue destination="diG-zi-HYZ" kind="relationship" relationship="viewControllers" id="rs5-1T-6wM"/>
137+
</connections>
138+
</tabBarController>
139+
<placeholder placeholderIdentifier="IBFirstResponder" id="R4T-Up-AzF" userLabel="First Responder" sceneMemberID="firstResponder"/>
140+
</objects>
141+
<point key="canvasLocation" x="167" y="968"/>
142+
</scene>
121143
<!--Sign Up-->
122144
<scene sceneID="hVF-Hd-k6n">
123145
<objects>
@@ -197,7 +219,35 @@
197219
</objects>
198220
<point key="canvasLocation" x="2453.5999999999999" y="775.86206896551732"/>
199221
</scene>
200-
<!--Login Controller-->
222+
<!--Contracts Confirm-->
223+
<scene sceneID="XP1-BD-8j2">
224+
<objects>
225+
<tableViewController id="F4z-IV-P8x" customClass="contractsConfirm" customModule="Cal_Hacks_TBD" customModuleProvider="target" sceneMemberID="viewController">
226+
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" id="T3N-1u-6Ak">
227+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
228+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
229+
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
230+
<prototypes>
231+
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" id="1i0-8i-RKj">
232+
<rect key="frame" x="0.0" y="28" width="375" height="44"/>
233+
<autoresizingMask key="autoresizingMask"/>
234+
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="1i0-8i-RKj" id="ZnP-St-vxV">
235+
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
236+
<autoresizingMask key="autoresizingMask"/>
237+
</tableViewCellContentView>
238+
</tableViewCell>
239+
</prototypes>
240+
<connections>
241+
<outlet property="dataSource" destination="F4z-IV-P8x" id="0LL-DD-X0o"/>
242+
<outlet property="delegate" destination="F4z-IV-P8x" id="Nd2-V7-seN"/>
243+
</connections>
244+
</tableView>
245+
</tableViewController>
246+
<placeholder placeholderIdentifier="IBFirstResponder" id="aNb-L7-LQw" userLabel="First Responder" sceneMemberID="firstResponder"/>
247+
</objects>
248+
<point key="canvasLocation" x="3498" y="776"/>
249+
</scene>
250+
<!--Item-->
201251
<scene sceneID="T8f-Hd-9yJ">
202252
<objects>
203253
<viewController id="diG-zi-HYZ" customClass="LoginController" customModule="Cal_Hacks_TBD" customModuleProvider="target" sceneMemberID="viewController">
@@ -264,6 +314,7 @@
264314
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
265315
<viewLayoutGuide key="safeArea" id="cIt-8d-BGC"/>
266316
</view>
317+
<tabBarItem key="tabBarItem" title="Item" id="Kpc-3s-h9T"/>
267318
<connections>
268319
<outlet property="descriptionOfQuery" destination="Cu4-Xg-vQh" id="MoR-Dj-kd9"/>
269320
<outlet property="destination" destination="G0j-yG-XO8" id="6cJ-OH-xaf"/>
@@ -275,10 +326,10 @@
275326
</objects>
276327
<point key="canvasLocation" x="3498.4000000000001" y="54.422788605697157"/>
277328
</scene>
278-
<!--View Controller-->
329+
<!--Contract Status-->
279330
<scene sceneID="MqX-uF-3LK">
280331
<objects>
281-
<viewController id="jpH-7j-rGW" sceneMemberID="viewController">
332+
<viewController id="jpH-7j-rGW" customClass="contractStatus" sceneMemberID="viewController">
282333
<view key="view" contentMode="scaleToFill" id="76q-KQ-XIM">
283334
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
284335
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -310,12 +361,16 @@
310361
</navigationBar>
311362
<nil name="viewControllers"/>
312363
<connections>
313-
<segue destination="BYZ-38-t0r" kind="relationship" relationship="rootViewController" id="lvl-2K-erJ"/>
364+
<segue destination="BYZ-38-t0r" kind="relationship" relationship="rootViewController" id="gyu-WK-Weu"/>
314365
</connections>
315366
</navigationController>
316367
<placeholder placeholderIdentifier="IBFirstResponder" id="xL5-cr-i9Q" userLabel="First Responder" sceneMemberID="firstResponder"/>
317368
</objects>
318369
<point key="canvasLocation" x="1008.8" y="55.322338830584712"/>
319370
</scene>
320371
</scenes>
372+
<inferredMetricsTieBreakers>
373+
<segue reference="LAL-j6-ozX"/>
374+
<segue reference="1iT-G4-co4"/>
375+
</inferredMetricsTieBreakers>
321376
</document>

Cal-Hacks-TBD/Cal-Hacks-TBD/LoginController.swift

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -33,33 +33,30 @@ class LoginController: UIViewController, UITextFieldDelegate {
3333

3434

3535
@IBAction func sendContractReq(_ sender: Any) {
36-
print("RUNNING THIS FUNCTION")
3736
sendSubmitRequest()
3837
}
3938
func sendSubmitRequest(){
4039
//create the url with URL
4140
var request = URLRequest(url: URL(string: "http://54.193.17.183:5000/new_contract_info")!)
4241
request.httpMethod = HTTPMethod.post.rawValue
4342
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
44-
print("HERE")
45-
//if !destination.endEditing(false){
46-
// print("EXITING HERE")
47-
// return
48-
// }
49-
//let quick = "(" + (placeNames[finalDest]?.coordinate.latitude.description)!
50-
// let temp = quick
51-
// + "," + (placeNames[finalDest]?.coordinate.longitude.description)!
52-
//let final = temp + ")"
43+
if !destination.endEditing(false){
44+
print("EXITING HERE")
45+
return
46+
}
47+
// TODO FIX
48+
// let quick = "(" + (placeNames[finalDest]?.coordinate.latitude.description)!
49+
// let temp = quick
50+
// + "," + (placeNames[finalDest]?.coordinate.longitude.description)!
51+
// let final = temp + ")"
5352

5453
let myCoords = (locationManager.location?.coordinate)!
5554
let quickone = "(" + myCoords.latitude.description
5655
let tempone = quickone
57-
+ "," + myCoords.latitude.description
56+
+ "," + myCoords.longitude.description
5857
let sourcefinal = tempone + ")"
59-
print("XXXXXX")
60-
print(sourcefinal)
61-
print("XXXXXX")
62-
let parameters = ["destination":"(20,10)", "price": price.text,"userid":userid,"source":sourcefinal,"description":descriptionOfQuery.text!] as! Dictionary<String, Any>
58+
let final = "(68.77,-122.24)"
59+
let parameters = ["destination":final, "price": price.text!,"userid":userid,"source":sourcefinal,"description":descriptionOfQuery.text!] as! Dictionary<String, String>
6360

6461

6562
do {
@@ -69,7 +66,6 @@ class LoginController: UIViewController, UITextFieldDelegate {
6966
print(error.localizedDescription)
7067
}
7168
Alamofire.request(request).responseJSON { (response) in
72-
print(response)
7369
if response.description == "You were right!"{
7470
//self.userid = Int(response.description)!
7571
self.performSegue(withIdentifier: "victory", sender: self)
@@ -93,6 +89,10 @@ class LoginController: UIViewController, UITextFieldDelegate {
9389

9490
// Do any additional setup after loading the view, typically from a nib.
9591
}
92+
override func didReceiveMemoryWarning() {
93+
super.didReceiveMemoryWarning()
94+
// Dispose of any resources that can be recreated.
95+
}
9696
@objc func searchRecords(textField:UITextField){
9797
if destination.text!.count >= 4 {
9898
if destination.text!.count == 4{
@@ -159,13 +159,7 @@ class LoginController: UIViewController, UITextFieldDelegate {
159159

160160
}
161161
}
162-
163-
override func didReceiveMemoryWarning() {
164-
super.didReceiveMemoryWarning()
165-
// Dispose of any resources that can be recreated.
166-
}
167-
168-
162+
169163
}
170164

171165
extension LoginController: CLLocationManagerDelegate {

0 commit comments

Comments
 (0)