Skip to content

Commit 3a42cab

Browse files
committed
Fixed facebook login code and made it actually link to the user's profile
1 parent a0957e2 commit 3a42cab

File tree

782 files changed

+23609
-11276
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

782 files changed

+23609
-11276
lines changed

.DS_Store

8 KB
Binary file not shown.

Cluster.xcodeproj/project.pbxproj

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,7 @@
499499
CEA8EA091B854B2100DC2AA5 /* Frameworks */,
500500
CEA8EA0A1B854B2100DC2AA5 /* Resources */,
501501
67C7258CA93F6017F945BE8E /* Copy Pods Resources */,
502+
91D3F04E5B04B3B231BC4B43 /* Embed Pods Frameworks */,
502503
);
503504
buildRules = (
504505
);
@@ -608,6 +609,21 @@
608609
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n";
609610
showEnvVarsInLog = 0;
610611
};
612+
91D3F04E5B04B3B231BC4B43 /* Embed Pods Frameworks */ = {
613+
isa = PBXShellScriptBuildPhase;
614+
buildActionMask = 2147483647;
615+
files = (
616+
);
617+
inputPaths = (
618+
);
619+
name = "Embed Pods Frameworks";
620+
outputPaths = (
621+
);
622+
runOnlyForDeploymentPostprocessing = 0;
623+
shellPath = /bin/sh;
624+
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-frameworks.sh\"\n";
625+
showEnvVarsInLog = 0;
626+
};
611627
E5B909E5E21E55AF0E88B3DA /* Check Pods Manifest.lock */ = {
612628
isa = PBXShellScriptBuildPhase;
613629
buildActionMask = 2147483647;
Binary file not shown.

Cluster.xcworkspace/xcuserdata/mafellows.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@
7373
shouldBeEnabled = "Yes"
7474
ignoreCount = "0"
7575
continueAfterRunningActions = "No"
76-
filePath = "Cluster/LoginViewController.swift"
77-
timestampString = "469119866.505887"
76+
filePath = "Cluster/Controllers/HomeViewController.swift"
77+
timestampString = "477519586.059292"
7878
startingColumnNumber = "9223372036854775807"
7979
endingColumnNumber = "9223372036854775807"
80-
startingLineNumber = "18"
81-
endingLineNumber = "18"
82-
landmarkName = "loginWithFacebookPressed(_:)"
80+
startingLineNumber = "78"
81+
endingLineNumber = "78"
82+
landmarkName = "featureImageTapped(_:)"
8383
landmarkType = "5">
8484
</BreakpointContent>
8585
</BreakpointProxy>
@@ -89,29 +89,13 @@
8989
shouldBeEnabled = "Yes"
9090
ignoreCount = "0"
9191
continueAfterRunningActions = "No"
92-
filePath = "Cluster/LoginViewController.swift"
93-
timestampString = "469119869.588651"
92+
filePath = "Cluster/ProfileViewController.swift"
93+
timestampString = "477857364.1742"
9494
startingColumnNumber = "9223372036854775807"
9595
endingColumnNumber = "9223372036854775807"
96-
startingLineNumber = "62"
97-
endingLineNumber = "62"
98-
landmarkName = "loginWithFacebookPressed(_:)"
99-
landmarkType = "5">
100-
</BreakpointContent>
101-
</BreakpointProxy>
102-
<BreakpointProxy
103-
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
104-
<BreakpointContent
105-
shouldBeEnabled = "Yes"
106-
ignoreCount = "0"
107-
continueAfterRunningActions = "No"
108-
filePath = "Cluster/LoginViewController.swift"
109-
timestampString = "469119870.376238"
110-
startingColumnNumber = "9223372036854775807"
111-
endingColumnNumber = "9223372036854775807"
112-
startingLineNumber = "66"
113-
endingLineNumber = "66"
114-
landmarkName = "loginWithFacebookPressed(_:)"
96+
startingLineNumber = "98"
97+
endingLineNumber = "98"
98+
landmarkName = "addPhotoClicked(_:)"
11599
landmarkType = "5">
116100
</BreakpointContent>
117101
</BreakpointProxy>

Cluster/.DS_Store

10 KB
Binary file not shown.

Cluster/Base.lproj/Main.storyboard

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,12 @@
216216
<rect key="frame" x="0.0" y="0.0" width="280" height="380"/>
217217
<autoresizingMask key="autoresizingMask"/>
218218
<subviews>
219-
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="1" translatesAutoresizingMaskIntoConstraints="NO" id="gWe-vd-goW">
219+
<imageView contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="1" translatesAutoresizingMaskIntoConstraints="NO" id="gWe-vd-goW">
220220
<rect key="frame" x="0.0" y="0.0" width="280" height="380"/>
221+
<gestureRecognizers/>
222+
<connections>
223+
<outletCollection property="gestureRecognizers" destination="afW-Aw-stA" appends="YES" id="Zpt-lw-xiu"/>
224+
</connections>
221225
</imageView>
222226
<visualEffectView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="eF0-X5-oi1">
223227
<rect key="frame" x="0.0" y="300" width="280" height="80"/>
@@ -393,7 +397,7 @@
393397
<segue destination="3OQ-js-IE7" kind="show" id="hNZ-Sb-FEZ"/>
394398
</connections>
395399
</button>
396-
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="profile1" translatesAutoresizingMaskIntoConstraints="NO" id="wY6-33-rQn">
400+
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="profile1" translatesAutoresizingMaskIntoConstraints="NO" id="wY6-33-rQn" customClass="PFImageView">
397401
<rect key="frame" x="463" y="559" width="25" height="25"/>
398402
<constraints>
399403
<constraint firstAttribute="width" constant="25" id="CDR-80-lQq"/>
@@ -456,11 +460,13 @@
456460
<connections>
457461
<outlet property="backgroundImageView" destination="Gj7-j4-4EP" id="zlh-7t-HDI"/>
458462
<outlet property="collectionView" destination="1j1-AO-gLe" id="JAQ-JG-Pcw"/>
463+
<outlet property="currentUserFullNameButton" destination="zKP-tJ-SBJ" id="YJw-Nn-tjg"/>
459464
<outlet property="menuButton" destination="KmD-j0-W6W" id="e46-68-Afr"/>
460-
<outlet property="profileAvatar" destination="wY6-33-rQn" id="d5d-Yi-IWU"/>
465+
<outlet property="profileAvatar" destination="wY6-33-rQn" id="l8q-SZ-cHl"/>
461466
</connections>
462467
</viewController>
463468
<placeholder placeholderIdentifier="IBFirstResponder" id="gao-46-dDc" userLabel="First Responder" sceneMemberID="firstResponder"/>
469+
<tapGestureRecognizer id="afW-Aw-stA"/>
464470
</objects>
465471
<point key="canvasLocation" x="448" y="454"/>
466472
</scene>
@@ -835,13 +841,13 @@
835841
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Miami Strollers" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="A4I-CP-tPN">
836842
<rect key="frame" x="86" y="8" width="122" height="25"/>
837843
<fontDescription key="fontDescription" name="AvenirNext-Regular" family="Avenir Next" pointSize="18"/>
838-
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
844+
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
839845
<nil key="highlightedColor"/>
840846
</label>
841847
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="7 Members" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0z0-k3-Ece">
842848
<rect key="frame" x="86" y="33" width="63" height="21"/>
843849
<fontDescription key="fontDescription" name="AvenirNext-Regular" family="Avenir Next" pointSize="12"/>
844-
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
850+
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
845851
<nil key="highlightedColor"/>
846852
</label>
847853
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Creator" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="t8Z-UX-Xcn">
@@ -975,7 +981,7 @@
975981
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Lawrence O." textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3e8-bv-kFd">
976982
<rect key="frame" x="75" y="13" width="283" height="25"/>
977983
<fontDescription key="fontDescription" name="AvenirNext-Regular" family="Avenir Next" pointSize="18"/>
978-
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
984+
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
979985
<nil key="highlightedColor"/>
980986
</label>
981987
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Sgu-qv-hwX" customClass="DesignableButton" customModule="Cluster" customModuleProvider="target">
@@ -1058,14 +1064,14 @@
10581064
<rect key="frame" x="15" y="6" width="31.5" height="19.5"/>
10591065
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
10601066
<fontDescription key="fontDescription" type="system" pointSize="16"/>
1061-
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
1067+
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
10621068
<nil key="highlightedColor"/>
10631069
</label>
10641070
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Subtitle" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="YBH-69-znl">
10651071
<rect key="frame" x="15" y="25.5" width="40.5" height="13.5"/>
10661072
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
10671073
<fontDescription key="fontDescription" type="system" pointSize="11"/>
1068-
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
1074+
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
10691075
<nil key="highlightedColor"/>
10701076
</label>
10711077
</subviews>
@@ -1331,7 +1337,7 @@
13311337
<constraint firstAttribute="height" constant="200" id="BRc-Gv-hn4"/>
13321338
</constraints>
13331339
</imageView>
1334-
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="profile1" translatesAutoresizingMaskIntoConstraints="NO" id="oAd-jH-lfd">
1340+
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="profile1" translatesAutoresizingMaskIntoConstraints="NO" id="oAd-jH-lfd" customClass="PFImageView">
13351341
<rect key="frame" x="200" y="100" width="200" height="200"/>
13361342
<constraints>
13371343
<constraint firstAttribute="height" constant="200" id="79R-yx-1nE"/>
@@ -1459,7 +1465,7 @@
14591465
<outlet property="editButton" destination="YPD-vd-zbQ" id="mLd-pS-D6B"/>
14601466
<outlet property="menuButton" destination="RxG-pW-nCC" id="RBu-x0-Iy0"/>
14611467
<outlet property="nameLabel" destination="vXs-zw-kMo" id="4kV-IU-uj9"/>
1462-
<outlet property="profileImage" destination="oAd-jH-lfd" id="1Sm-Lh-F9u"/>
1468+
<outlet property="profileImageView" destination="oAd-jH-lfd" id="rnr-mN-J5N"/>
14631469
<outlet property="scroller" destination="m1R-zb-4Qd" id="ABs-qr-7n8"/>
14641470
</connections>
14651471
</viewController>
@@ -2070,7 +2076,7 @@
20702076
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Michael Fellows" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="iY3-9w-MFL">
20712077
<rect key="frame" x="66" y="13" width="526" height="23"/>
20722078
<fontDescription key="fontDescription" type="system" pointSize="19"/>
2073-
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
2079+
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
20742080
<nil key="highlightedColor"/>
20752081
</label>
20762082
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="62 yrs" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eYn-6z-dRX">

Cluster/Cluster-Bridging-Header.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
#import <Parse/Parse.h>
66
#import <FBSDKCoreKit/FBSDKCoreKit.h>
77
#import <ParseFacebookUtilsV4/PFFacebookUtils.h>
8+
#import <ParseUI/PFImageView.h>
89
#import <MBProgressHUD/MBProgressHUD.h>
910
#import "SWRevealViewController.h"

Cluster/Controllers/.DS_Store

6 KB
Binary file not shown.

Cluster/HomeViewController.swift

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ class HomeViewController: UIViewController {
1717
@IBOutlet weak var menuButton: UIButton!
1818
@IBOutlet weak var currentUserProfileImageButton:UIButton!
1919
@IBOutlet weak var currentUserFullNameButton:UIButton!
20-
@IBOutlet weak var profileAvatar: UIImageView!
20+
@IBOutlet weak var profileAvatar: PFImageView!
21+
2122
//MARK: - UICollectionViewDataSource
2223
private var klusters = Kluster.createKlusters()
2324

@@ -28,7 +29,15 @@ class HomeViewController: UIViewController {
2829

2930
override func viewDidLoad() {
3031
super.viewDidLoad()
31-
32+
33+
// Update the user profile information
34+
let user = PFUser.currentUser()
35+
self.profileAvatar.file = user?.objectForKey("avatarThumbnail") as? PFFile
36+
self.profileAvatar.loadInBackground()
37+
38+
let firstName = user?.objectForKey("firstName") as? String
39+
self.currentUserFullNameButton.setTitle(firstName, forState: .Normal)
40+
3241
profileAvatar.layer.cornerRadius = 10.0
3342
profileAvatar.clipsToBounds = true
3443

@@ -39,15 +48,6 @@ class HomeViewController: UIViewController {
3948
}
4049
}
4150

42-
override func viewWillAppear(animated: Bool) {
43-
super.viewWillAppear(true)
44-
45-
if (PFUser.currentUser() == nil) {
46-
// show login
47-
self.showLogin()
48-
}
49-
}
50-
5151
private func showLogin() {
5252
let storyboard = UIStoryboard.init(name: "Login", bundle: nil)
5353
let loginVC = storyboard.instantiateViewControllerWithIdentifier("LoginViewController") as! LoginViewController
@@ -81,9 +81,21 @@ extension HomeViewController : UICollectionViewDataSource
8181
cell.joinKlusterButton.tag = indexPath.row
8282
cell.joinKlusterButton.addTarget(self, action: "joinKluster:", forControlEvents: UIControlEvents.TouchUpInside)
8383

84+
let tapRecognizer = UITapGestureRecognizer.init(target: self, action: "featuredImageViewTapped:")
85+
cell.featuredImageView.addGestureRecognizer(tapRecognizer)
86+
8487
return cell
8588
}
8689

90+
func featuredImageViewTapped(sender: UITapGestureRecognizer) {
91+
let storyboard = UIStoryboard.init(name: "Main", bundle: nil)
92+
let klusterVC = storyboard.instantiateViewControllerWithIdentifier("KlusterViewController") as! KlusterViewController;
93+
94+
// Show kluster
95+
let navigationController = UINavigationController.init(rootViewController: klusterVC)
96+
self.presentViewController(navigationController, animated: true, completion: nil);
97+
}
98+
8799
func joinKluster(sender: UIButton) {
88100
// let k = self.klusters[sender.tag] as? Kluster
89101

0 commit comments

Comments
 (0)