Skip to content

Commit eb8d4a0

Browse files
committed
Login pulls user info properly
1 parent b7fad88 commit eb8d4a0

7 files changed

Lines changed: 103 additions & 157 deletions

File tree

BrickHack-Mobile/Base.lproj/Main.storyboard

Lines changed: 25 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
<constraint firstAttribute="height" constant="80" id="2aR-zI-khn"/>
125125
</constraints>
126126
<connections>
127-
<segue destination="g8Z-Z9-XAz" kind="embed" id="6YJ-qq-hy4"/>
127+
<segue destination="g8Z-Z9-XAz" kind="embed" id="rKf-pF-j4O"/>
128128
</connections>
129129
</containerView>
130130
<containerView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="r4I-Sq-rhl">
@@ -133,20 +133,32 @@
133133
<segue destination="S2k-45-cUt" kind="embed" id="zvN-Lw-JtR"/>
134134
</connections>
135135
</containerView>
136-
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Schedule" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="EIp-cK-tIz">
137-
<rect key="frame" x="37" y="184" width="149" height="41"/>
136+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Schedule" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="EIp-cK-tIz">
137+
<rect key="frame" x="15" y="184" width="149" height="41"/>
138138
<fontDescription key="fontDescription" type="boldSystem" pointSize="34"/>
139139
<color key="textColor" name="primaryColor"/>
140140
<nil key="highlightedColor"/>
141141
</label>
142+
<button opaque="NO" contentMode="scaleToFill" ambiguous="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="IRw-ic-oiK">
143+
<rect key="frame" x="260" y="184" width="48" height="30"/>
144+
<state key="normal" title="Logout">
145+
<color key="titleColor" name="primaryColor"/>
146+
</state>
147+
<connections>
148+
<segue destination="YN7-JW-ZjW" kind="unwind" unwindAction="unwindToLoginWithSegue:" id="tYC-F5-XOA"/>
149+
</connections>
150+
</button>
142151
</subviews>
143152
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
144153
<accessibility key="accessibilityConfiguration" hint="checked-out"/>
145154
<constraints>
146155
<constraint firstAttribute="bottom" secondItem="r4I-Sq-rhl" secondAttribute="bottom" id="BN2-m4-c1v"/>
147-
<constraint firstItem="EIp-cK-tIz" firstAttribute="leading" secondItem="DgF-Zc-fiO" secondAttribute="leading" constant="37" id="Sbf-iJ-jhh"/>
156+
<constraint firstItem="IRw-ic-oiK" firstAttribute="leading" secondItem="EIp-cK-tIz" secondAttribute="trailing" constant="97" id="JjK-JR-g0L"/>
157+
<constraint firstItem="EIp-cK-tIz" firstAttribute="leading" secondItem="DgF-Zc-fiO" secondAttribute="leading" constant="15" id="Sbf-iJ-jhh"/>
148158
<constraint firstItem="r4I-Sq-rhl" firstAttribute="leading" secondItem="DgF-Zc-fiO" secondAttribute="leading" id="W7l-yf-cpg"/>
159+
<constraint firstItem="IRw-ic-oiK" firstAttribute="top" secondItem="EIp-cK-tIz" secondAttribute="top" id="Ykj-6C-89D"/>
149160
<constraint firstItem="8Zp-wc-XHQ" firstAttribute="top" secondItem="DgF-Zc-fiO" secondAttribute="top" constant="30" id="akc-RA-5my"/>
161+
<constraint firstItem="DgF-Zc-fiO" firstAttribute="trailing" secondItem="IRw-ic-oiK" secondAttribute="trailing" constant="68" id="gCO-DS-Sn1"/>
150162
<constraint firstItem="DgF-Zc-fiO" firstAttribute="trailing" secondItem="r4I-Sq-rhl" secondAttribute="trailing" id="hEf-sD-53f"/>
151163
<constraint firstItem="EIp-cK-tIz" firstAttribute="top" secondItem="8Zp-wc-XHQ" secondAttribute="bottom" constant="30" id="iEV-uN-BmU"/>
152164
<constraint firstItem="r4I-Sq-rhl" firstAttribute="top" secondItem="EIp-cK-tIz" secondAttribute="bottom" constant="19" id="qjP-wh-bpo"/>
@@ -185,48 +197,35 @@
185197
<sections>
186198
<tableViewSection id="feo-F1-UGk">
187199
<cells>
188-
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="default" accessoryType="disclosureIndicator" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" rowHeight="85" id="tz9-qS-mNz">
200+
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="none" accessoryType="disclosureIndicator" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" rowHeight="85" id="tz9-qS-mNz">
189201
<rect key="frame" x="0.0" y="28" width="375" height="85"/>
190202
<autoresizingMask key="autoresizingMask"/>
191203
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="tz9-qS-mNz" id="AW9-B6-GKe">
192204
<rect key="frame" x="0.0" y="0.0" width="348" height="85"/>
193205
<autoresizingMask key="autoresizingMask"/>
194206
<subviews>
195207
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Name" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hsb-w8-ZIH">
196-
<rect key="frame" x="101" y="11" width="232" height="21"/>
208+
<rect key="frame" x="24.999999999999996" y="11" width="47.666666666666657" height="21"/>
197209
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
198210
<nil key="textColor"/>
199211
<nil key="highlightedColor"/>
200212
</label>
201-
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="hkF-3N-0ov">
202-
<rect key="frame" x="15" y="11" width="63" height="63"/>
203-
<color key="backgroundColor" name="primaryColor"/>
204-
<constraints>
205-
<constraint firstAttribute="width" secondItem="hkF-3N-0ov" secondAttribute="height" multiplier="1:1" id="SY6-vg-mAx"/>
206-
</constraints>
207-
</imageView>
208213
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="School" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qg9-Cb-5fT">
209-
<rect key="frame" x="101" y="40" width="232" height="21"/>
214+
<rect key="frame" x="24.999999999999996" y="40" width="52.666666666666657" height="21"/>
210215
<fontDescription key="fontDescription" type="system" pointSize="17"/>
211216
<nil key="textColor"/>
212217
<nil key="highlightedColor"/>
213218
</label>
214219
</subviews>
215220
<constraints>
216-
<constraint firstAttribute="trailing" secondItem="hsb-w8-ZIH" secondAttribute="trailing" constant="15" id="0Ib-47-ZfT"/>
221+
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="hsb-w8-ZIH" secondAttribute="trailing" constant="100" id="0Ib-47-ZfT"/>
217222
<constraint firstItem="hsb-w8-ZIH" firstAttribute="top" secondItem="AW9-B6-GKe" secondAttribute="top" constant="11" id="P26-Xv-1TR"/>
218-
<constraint firstItem="qg9-Cb-5fT" firstAttribute="leading" secondItem="hkF-3N-0ov" secondAttribute="trailing" constant="23" id="eoo-LW-wwz"/>
219-
<constraint firstItem="hkF-3N-0ov" firstAttribute="top" secondItem="AW9-B6-GKe" secondAttribute="top" constant="11" id="i5u-4k-XVQ"/>
220-
<constraint firstItem="hkF-3N-0ov" firstAttribute="leading" secondItem="AW9-B6-GKe" secondAttribute="leading" constant="15" id="j1D-RF-ZBj"/>
221-
<constraint firstAttribute="bottom" secondItem="hkF-3N-0ov" secondAttribute="bottom" constant="11" id="nTU-J8-SgW"/>
222-
<constraint firstAttribute="trailing" secondItem="qg9-Cb-5fT" secondAttribute="trailing" constant="15" id="oNn-Z3-4Ma"/>
223+
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="qg9-Cb-5fT" secondAttribute="trailing" constant="100" id="oNn-Z3-4Ma"/>
224+
<constraint firstItem="qg9-Cb-5fT" firstAttribute="leading" secondItem="AW9-B6-GKe" secondAttribute="leading" constant="25" id="pSC-NH-9yL"/>
223225
<constraint firstAttribute="bottom" secondItem="qg9-Cb-5fT" secondAttribute="bottom" constant="24" id="q6n-pt-qXo"/>
224-
<constraint firstItem="hsb-w8-ZIH" firstAttribute="leading" secondItem="hkF-3N-0ov" secondAttribute="trailing" constant="23" id="uCc-xS-DU4"/>
226+
<constraint firstItem="hsb-w8-ZIH" firstAttribute="leading" secondItem="AW9-B6-GKe" secondAttribute="leading" constant="25" id="qjf-Xc-Uf2"/>
225227
</constraints>
226228
</tableViewCellContentView>
227-
<connections>
228-
<segue destination="aXh-cU-cZb" kind="showDetail" id="SR2-aC-sBk"/>
229-
</connections>
230229
</tableViewCell>
231230
</cells>
232231
</tableViewSection>
@@ -238,35 +237,19 @@
238237
</tableView>
239238
<connections>
240239
<outlet property="nameLabel" destination="hsb-w8-ZIH" id="Zfk-sA-jV1"/>
241-
<outlet property="profileImage" destination="hkF-3N-0ov" id="6Dp-Bi-d77"/>
242240
<outlet property="schoolLabel" destination="qg9-Cb-5fT" id="qeS-yG-kTG"/>
243241
</connections>
244242
</tableViewController>
245243
<placeholder placeholderIdentifier="IBFirstResponder" id="yNf-Aa-cwx" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
246244
</objects>
247-
<point key="canvasLocation" x="3690" y="-27"/>
248-
</scene>
249-
<!--View Controller-->
250-
<scene sceneID="xmh-eR-hkz">
251-
<objects>
252-
<viewController id="aXh-cU-cZb" sceneMemberID="viewController">
253-
<view key="view" contentMode="scaleToFill" id="4b2-aF-V9H">
254-
<rect key="frame" x="0.0" y="0.0" width="375" height="80"/>
255-
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
256-
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
257-
<viewLayoutGuide key="safeArea" id="hdK-Am-Svz"/>
258-
</view>
259-
</viewController>
260-
<placeholder placeholderIdentifier="IBFirstResponder" id="OSu-Wr-JTZ" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
261-
</objects>
262-
<point key="canvasLocation" x="4612" y="-84"/>
245+
<point key="canvasLocation" x="4442" y="-101"/>
263246
</scene>
264247
<!--Schedule Table View Controller-->
265248
<scene sceneID="up2-D5-I0e">
266249
<objects>
267250
<tableViewController id="S2k-45-cUt" customClass="ScheduleTableViewController" customModule="BrickHack_Mobile" customModuleProvider="target" sceneMemberID="viewController">
268251
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" id="mcs-hP-1ut">
269-
<rect key="frame" x="0.0" y="0.0" width="375" height="534"/>
252+
<rect key="frame" x="0.0" y="0.0" width="375" height="568"/>
270253
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
271254
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
272255
<prototypes>

BrickHack-Mobile/Controllers/EventsViewController.swift

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
//
88

99
import UIKit
10-
import p2_OAuth2
1110
import TimelineTableViewCell
1211

1312
class EventsViewController: UIViewController { //UserDataHandler {
@@ -16,9 +15,7 @@ class EventsViewController: UIViewController { //UserDataHandler {
1615
// MARK: UI
1716

1817
// General properties
19-
// @FIXME When login works
20-
// var oauthGrant: OAuth2ImplicitGrant!
21-
// var userID: Int!
18+
var currentUser: User!
2219

2320
override func viewDidLoad() {
2421
super.viewDidLoad()
@@ -43,11 +40,8 @@ class EventsViewController: UIViewController { //UserDataHandler {
4340

4441
// @FIXME: Fill using user data once login is working
4542
// (either here or in helper function or in previous VC)
46-
tableVC.nameLabel.text = "Aanya Schroeder"
47-
tableVC.schoolLabel.text = "University of Buffalo"
48-
49-
// @TODO: Emoji picker for ImageView? Don't think backend supports images atm.
50-
43+
tableVC.nameLabel.text = currentUser.firstName + " " + currentUser.lastName
44+
tableVC.schoolLabel.text = "Unknown School"
5145

5246
}
5347
}

0 commit comments

Comments
 (0)