Skip to content

Commit 1ce0b8a

Browse files
committed
Presents businessViewController upon selecting an item in the google GMSAutoComplete search bar
1 parent 00c5777 commit 1ce0b8a

File tree

3 files changed

+11
-25
lines changed

3 files changed

+11
-25
lines changed

CommentBox/Base.lproj/Main.storyboard

+5-22
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@
4444
</barButtonItem>
4545
<barButtonItem key="rightBarButtonItem" style="plain" id="R7A-1d-DnO">
4646
<button key="customView" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="Fns-6e-7zd">
47-
<rect key="frame" x="299" y="6" width="95" height="32"/>
47+
<rect key="frame" x="292" y="6" width="102" height="32"/>
4848
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
4949
<fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="17"/>
50-
<state key="normal" title="Create Page">
50+
<state key="normal" title="Login/Signup">
5151
<color key="titleColor" red="0.94231703369999997" green="0.94231703369999997" blue="0.94231703369999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
5252
</state>
5353
</button>
@@ -78,30 +78,15 @@
7878
<rect key="frame" x="55.666666666666657" y="353" width="303" height="30"/>
7979
<connections>
8080
<action selector="autocompleteClicked:" destination="BYZ-38-t0r" eventType="touchUpInside" id="BR0-aS-a5n"/>
81+
<segue destination="0h9-Er-Te5" kind="show" identifier="businessSegue" id="PaX-jW-DDc"/>
8182
</connections>
8283
</button>
83-
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="iPS-g5-5ho">
84+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" business, company, place..." textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="iPS-g5-5ho">
8485
<rect key="frame" x="55.666666666666657" y="353" width="303" height="30"/>
8586
<fontDescription key="fontDescription" type="system" pointSize="17"/>
86-
<nil key="textColor"/>
87+
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
8788
<nil key="highlightedColor"/>
8889
</label>
89-
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="RXs-3K-Spe">
90-
<rect key="frame" x="149" y="413" width="116" height="30"/>
91-
<color key="backgroundColor" red="0.6228105675404666" green="0.63093933042646067" blue="0.65444559010152292" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
92-
<constraints>
93-
<constraint firstAttribute="height" constant="30" id="69V-Yl-4Yq"/>
94-
<constraint firstAttribute="width" secondItem="RXs-3K-Spe" secondAttribute="height" multiplier="58:15" id="NZB-z9-EHx"/>
95-
<constraint firstAttribute="width" constant="116" id="tLW-hD-ECs"/>
96-
</constraints>
97-
<fontDescription key="fontDescription" type="system" pointSize="18"/>
98-
<state key="normal" title="Search">
99-
<color key="titleColor" red="0.12190141694626314" green="0.12349244279821046" blue="0.12809327411167515" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
100-
</state>
101-
<connections>
102-
<segue destination="0h9-Er-Te5" kind="show" identifier="businessSegue" id="exV-Kb-4w2"/>
103-
</connections>
104-
</button>
10590
</subviews>
10691
<color key="backgroundColor" red="0.11440455168485641" green="0.36420160531997681" blue="0.55502784252166748" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
10792
<constraints>
@@ -110,14 +95,12 @@
11095
<constraint firstItem="hBX-tC-v5J" firstAttribute="top" secondItem="iPS-g5-5ho" secondAttribute="top" id="Eo1-gJ-BIM"/>
11196
<constraint firstItem="g7J-mX-avo" firstAttribute="centerY" secondItem="8bC-Xf-vdC" secondAttribute="centerY" id="H9C-jx-q7Y"/>
11297
<constraint firstItem="hBX-tC-v5J" firstAttribute="centerY" secondItem="8bC-Xf-vdC" secondAttribute="centerY" id="PZR-G9-4M4"/>
113-
<constraint firstItem="RXs-3K-Spe" firstAttribute="centerY" secondItem="8bC-Xf-vdC" secondAttribute="centerY" constant="60" id="WP1-Hm-1K1"/>
11498
<constraint firstItem="hBX-tC-v5J" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="a4I-eu-k0K"/>
11599
<constraint firstItem="hBX-tC-v5J" firstAttribute="bottom" secondItem="iPS-g5-5ho" secondAttribute="bottom" id="bBW-jl-gIw"/>
116100
<constraint firstItem="hBX-tC-v5J" firstAttribute="height" secondItem="g7J-mX-avo" secondAttribute="height" id="bv1-oS-gcp"/>
117101
<constraint firstItem="zPO-2Y-vcr" firstAttribute="centerY" secondItem="8bC-Xf-vdC" secondAttribute="centerY" constant="-150" id="eqe-CM-yKY"/>
118102
<constraint firstItem="hBX-tC-v5J" firstAttribute="leading" secondItem="iPS-g5-5ho" secondAttribute="leading" id="kYB-xl-gZ7"/>
119103
<constraint firstItem="hBX-tC-v5J" firstAttribute="width" secondItem="g7J-mX-avo" secondAttribute="width" id="neK-gf-EMp"/>
120-
<constraint firstItem="RXs-3K-Spe" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="r1A-RO-roR"/>
121104
<constraint firstItem="zPO-2Y-vcr" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="wfq-2F-N5W"/>
122105
</constraints>
123106
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>

CommentBox/ViewController.swift

+6-3
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class ViewController: UIViewController {
4949
//HTTP GET request to the API to receive all relevant comments
5050
let commentsURL = "http://167.99.107.99:5000/comments"
5151
Alamofire.request(commentsURL).responseJSON { response in
52-
print("\n\n\n\n\n\n - HTTP GET response: \(response)\n\n\n\n\n\n")
52+
print("\nHTTP GET response: \(response)\n")
5353
var json = JSON(response.data!)
5454
for var i in 0...json.count {
5555
if json[i]["placeID"].stringValue == businessID {
@@ -87,8 +87,11 @@ extension ViewController: GMSAutocompleteViewControllerDelegate {
8787
commentDict = downloadComments(place.placeID)
8888

8989
// Set label over search bar to place.name so the user knows their selection was received
90-
label.text = " " + place.name
91-
dismiss(animated: true, completion: nil)
90+
//presentViewController(BusinessViewController, animated: true, completion: nil)
91+
//performSegue(withIdentifier: "businessSegue", sender: self)
92+
dismiss(animated: true, completion: { () in
93+
self.performSegue(withIdentifier: "businessSegue", sender: nil)
94+
})
9295
}
9396

9497

0 commit comments

Comments
 (0)