Skip to content

Commit 5e1f792

Browse files
committed
Navigation fixes
1 parent 0689e74 commit 5e1f792

Some content is hidden

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

45 files changed

+4795
-2536
lines changed

Cluster.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
9D2EFA411BF6534400D91812 /* KlusterSearchController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D2EFA401BF6534400D91812 /* KlusterSearchController.swift */; };
5959
9D7CC5AB1C7E7958002D21D0 /* MessageTextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D7CC5AA1C7E7958002D21D0 /* MessageTextView.swift */; };
6060
9D7CC5AD1C7E8EFB002D21D0 /* Message.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D7CC5AC1C7E8EFB002D21D0 /* Message.swift */; };
61+
9DAF9F871C87A3A2000B8586 /* ProfileNameView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DAF9F861C87A3A2000B8586 /* ProfileNameView.swift */; };
6162
9DB9900C1C8009B400837993 /* MessagesTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DB9900B1C8009B400837993 /* MessagesTableViewController.swift */; };
6263
9DB9900E1C800A4E00837993 /* Map.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9DB9900D1C800A4E00837993 /* Map.storyboard */; };
6364
9DB990131C800B9000837993 /* LocationSelectViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DB990121C800B9000837993 /* LocationSelectViewController.swift */; };
@@ -162,6 +163,7 @@
162163
9D2EFA401BF6534400D91812 /* KlusterSearchController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KlusterSearchController.swift; sourceTree = "<group>"; };
163164
9D7CC5AA1C7E7958002D21D0 /* MessageTextView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MessageTextView.swift; sourceTree = "<group>"; };
164165
9D7CC5AC1C7E8EFB002D21D0 /* Message.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Message.swift; sourceTree = "<group>"; };
166+
9DAF9F861C87A3A2000B8586 /* ProfileNameView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProfileNameView.swift; sourceTree = "<group>"; };
165167
9DB9900B1C8009B400837993 /* MessagesTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MessagesTableViewController.swift; sourceTree = "<group>"; };
166168
9DB9900D1C800A4E00837993 /* Map.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Map.storyboard; sourceTree = "<group>"; };
167169
9DB990121C800B9000837993 /* LocationSelectViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LocationSelectViewController.swift; sourceTree = "<group>"; };
@@ -333,6 +335,7 @@
333335
isa = PBXGroup;
334336
children = (
335337
9D7CC5AA1C7E7958002D21D0 /* MessageTextView.swift */,
338+
9DAF9F861C87A3A2000B8586 /* ProfileNameView.swift */,
336339
);
337340
name = Views;
338341
sourceTree = "<group>";
@@ -669,6 +672,7 @@
669672
CEFEBF4A1BDC9CB500E4070D /* NewKlusterViewController.swift in Sources */,
670673
9D7CC5AB1C7E7958002D21D0 /* MessageTextView.swift in Sources */,
671674
28EE235C1BDF1F83009161AE /* SpringView.swift in Sources */,
675+
9DAF9F871C87A3A2000B8586 /* ProfileNameView.swift in Sources */,
672676
CEA8EA121B854B2100DC2AA5 /* AppDelegate.swift in Sources */,
673677
28EE235D1BDF1F83009161AE /* TransitionManager.swift in Sources */,
674678
CED4489D1BA5111900F11808 /* Kluster.swift in Sources */,

Cluster/.DS_Store

0 Bytes
Binary file not shown.

Cluster/Base.lproj/Main.storyboard

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -390,17 +390,6 @@
390390
<segue destination="U1Z-pW-EXH" kind="presentation" id="rMu-De-hLk"/>
391391
</connections>
392392
</button>
393-
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="zKP-tJ-SBJ">
394-
<rect key="frame" x="496" y="553" width="79" height="37"/>
395-
<fontDescription key="fontDescription" name="AvenirNext-Regular" family="Avenir Next" pointSize="18"/>
396-
<state key="normal" title="Lawrence">
397-
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
398-
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
399-
</state>
400-
<connections>
401-
<segue destination="3OQ-js-IE7" kind="show" id="hNZ-Sb-FEZ"/>
402-
</connections>
403-
</button>
404393
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="profile1" translatesAutoresizingMaskIntoConstraints="NO" id="wY6-33-rQn" customClass="PFImageView">
405394
<rect key="frame" x="463" y="559" width="25" height="25"/>
406395
<constraints>
@@ -431,6 +420,17 @@
431420
<color key="barTintColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
432421
<textInputTraits key="textInputTraits"/>
433422
</searchBar>
423+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="zKP-tJ-SBJ">
424+
<rect key="frame" x="496" y="553" width="79" height="37"/>
425+
<fontDescription key="fontDescription" name="AvenirNext-Regular" family="Avenir Next" pointSize="18"/>
426+
<state key="normal" title="Lawrence">
427+
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
428+
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
429+
</state>
430+
<connections>
431+
<segue destination="3OQ-js-IE7" kind="show" id="hNZ-Sb-FEZ"/>
432+
</connections>
433+
</button>
434434
</subviews>
435435
<constraints>
436436
<constraint firstItem="xnQ-be-KC7" firstAttribute="top" secondItem="hCX-O3-tyk" secondAttribute="top" constant="30" id="2iV-J5-UQe"/>
@@ -842,8 +842,9 @@
842842
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
843843
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
844844
<subviews>
845-
<searchBar contentMode="redraw" translatesAutoresizingMaskIntoConstraints="NO" id="fCC-xa-xoq">
845+
<searchBar contentMode="redraw" placeholder="Search" translatesAutoresizingMaskIntoConstraints="NO" id="fCC-xa-xoq">
846846
<rect key="frame" x="0.0" y="64" width="600" height="44"/>
847+
<color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
847848
<textInputTraits key="textInputTraits"/>
848849
</searchBar>
849850
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="60" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="k3u-R6-Vek">
@@ -1122,7 +1123,7 @@
11221123
<!--Profile View Controller-->
11231124
<scene sceneID="OZa-sa-H3w">
11241125
<objects>
1125-
<viewController id="az7-7U-rec" customClass="ProfileViewController" customModule="Cluster" customModuleProvider="target" sceneMemberID="viewController">
1126+
<viewController storyboardIdentifier="ProfileViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="az7-7U-rec" customClass="ProfileViewController" customModule="Cluster" customModuleProvider="target" sceneMemberID="viewController">
11261127
<layoutGuides>
11271128
<viewControllerLayoutGuide type="top" id="ZpO-iR-T4f"/>
11281129
<viewControllerLayoutGuide type="bottom" id="b1l-4k-PSD"/>
@@ -2064,18 +2065,6 @@
20642065
<rect key="frame" x="0.0" y="0.0" width="600" height="67.5"/>
20652066
<autoresizingMask key="autoresizingMask"/>
20662067
<subviews>
2067-
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="profile1" translatesAutoresizingMaskIntoConstraints="NO" id="uIc-BZ-8gG" customClass="PFImageView">
2068-
<rect key="frame" x="8" y="4" width="50" height="50"/>
2069-
<constraints>
2070-
<constraint firstAttribute="height" constant="50" id="Aka-3I-huA"/>
2071-
<constraint firstAttribute="width" constant="50" id="p2U-z1-kaR"/>
2072-
</constraints>
2073-
<userDefinedRuntimeAttributes>
2074-
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
2075-
<integer key="value" value="25"/>
2076-
</userDefinedRuntimeAttribute>
2077-
</userDefinedRuntimeAttributes>
2078-
</imageView>
20792068
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="What are we doing tonight?" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="lGT-du-aC0">
20802069
<rect key="frame" x="66" y="33" width="514" height="21"/>
20812070
<constraints>
@@ -2094,6 +2083,19 @@
20942083
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
20952084
<nil key="highlightedColor"/>
20962085
</label>
2086+
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="profile1" translatesAutoresizingMaskIntoConstraints="NO" id="uIc-BZ-8gG" customClass="PFImageView">
2087+
<rect key="frame" x="8" y="4" width="50" height="50"/>
2088+
<gestureRecognizers/>
2089+
<constraints>
2090+
<constraint firstAttribute="height" constant="50" id="Aka-3I-huA"/>
2091+
<constraint firstAttribute="width" constant="50" id="p2U-z1-kaR"/>
2092+
</constraints>
2093+
<userDefinedRuntimeAttributes>
2094+
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
2095+
<integer key="value" value="25"/>
2096+
</userDefinedRuntimeAttribute>
2097+
</userDefinedRuntimeAttributes>
2098+
</imageView>
20972099
</subviews>
20982100
<constraints>
20992101
<constraint firstItem="olg-OI-0pz" firstAttribute="top" secondItem="Ueo-H1-dwC" secondAttribute="topMargin" constant="-4" id="2bb-Fd-tBp"/>

Cluster/HomeViewController.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ class HomeViewController: UIViewController {
4141
self.searchBar.hidden = true
4242
self.cancelButton.hidden = true
4343

44-
// Hack to set search bar text color to white..
45-
UITextField.appearanceWhenContainedInInstancesOfClasses([UISearchBar.self]).textColor = .whiteColor()
46-
4744
// Set delegates
4845
self.locationManager.delegate = self
4946
self.searchBar.delegate = self;
@@ -75,6 +72,9 @@ class HomeViewController: UIViewController {
7572
override func viewWillAppear(animated: Bool) {
7673
super.viewWillAppear(true)
7774

75+
// Hack to set search bar text color to white..
76+
UITextField.appearanceWhenContainedInInstancesOfClasses([UISearchBar.self]).textColor = .whiteColor()
77+
7878
self.fetchKlusters()
7979

8080
let authorizationStatus = CLLocationManager.authorizationStatus()
@@ -242,7 +242,6 @@ extension HomeViewController : UICollectionViewDataSource
242242

243243
let tapRecognizer = UITapGestureRecognizer.init(target: self, action: "featuredImageViewTapped:")
244244
cell.featuredImageView.addGestureRecognizer(tapRecognizer)
245-
246245
return cell
247246
}
248247

Cluster/KlusterDataSource.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ class KlusterDataSource: NSObject {
3838
}
3939
}
4040

41+
class func deleteKluster(klusterId: String, completion: PFIdResultBlock) -> Void {
42+
PFCloud.callFunctionInBackground("deleteKluster", withParameters: ["klusterId": klusterId]) { (object, error) -> Void in
43+
completion(object, error)
44+
}
45+
}
46+
4147
class func fetchKlustersForUser(completion:PFIdResultBlock) -> Void {
4248
PFCloud.callFunctionInBackground("fetchKlustersForUser", withParameters: nil) { (object, error) -> Void in
4349
KlusterStore.sharedInstance.userKlusters = object as? [PFObject]

Cluster/Map.storyboard

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
22
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="WED-3T-02Y">
33
<dependencies>
4-
<deployment identifier="iOS"/>
54
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
65
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
76
</dependencies>

Cluster/MembersTableViewController.swift

Lines changed: 18 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -55,54 +55,28 @@ class MembersTableViewController: UITableViewController {
5555
let cell = tableView.dequeueReusableCellWithIdentifier("MembersTableViewCell", forIndexPath: indexPath) as! MembersTableViewCell
5656
let user = self.users[indexPath.row]
5757
cell.user = user
58+
59+
cell.avatarImageView.image = nil
60+
cell.avatarImageView.tag = indexPath.row
61+
cell.avatarImageView.userInteractionEnabled = true
5862
cell.avatarImageView.file = user.objectForKey("avatarThumbnail") as? PFFile
5963
cell.avatarImageView.loadInBackground()
64+
65+
// Add a tap recognizer to the cell
66+
let tapRecognizer = UITapGestureRecognizer.init(target: self, action: "avatarTapped:")
67+
cell.avatarImageView.addGestureRecognizer(tapRecognizer)
6068
return cell
6169
}
62-
63-
/*
64-
// Override to support conditional editing of the table view.
65-
override func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool {
66-
// Return NO if you do not want the specified item to be editable.
67-
return true
68-
}
69-
*/
70-
71-
/*
72-
// Override to support editing the table view.
73-
override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
74-
if editingStyle == .Delete {
75-
// Delete the row from the data source
76-
tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Fade)
77-
} else if editingStyle == .Insert {
78-
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
79-
}
80-
}
81-
*/
82-
83-
/*
84-
// Override to support rearranging the table view.
85-
override func tableView(tableView: UITableView, moveRowAtIndexPath fromIndexPath: NSIndexPath, toIndexPath: NSIndexPath) {
86-
87-
}
88-
*/
89-
90-
/*
91-
// Override to support conditional rearranging of the table view.
92-
override func tableView(tableView: UITableView, canMoveRowAtIndexPath indexPath: NSIndexPath) -> Bool {
93-
// Return NO if you do not want the item to be re-orderable.
94-
return true
95-
}
96-
*/
97-
98-
/*
99-
// MARK: - Navigation
100-
101-
// In a storyboard-based application, you will often want to do a little preparation before navigation
102-
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
103-
// Get the new view controller using [segue destinationViewController].
104-
// Pass the selected object to the new view controller.
70+
71+
// MARK: - Selector
72+
73+
func avatarTapped(sender: UITapGestureRecognizer) {
74+
let user = self.users[sender.view!.tag]
75+
// message.user
76+
let storyboard = UIStoryboard.init(name: "Main", bundle: nil)
77+
let profileViewController = storyboard.instantiateViewControllerWithIdentifier("ProfileViewController") as! ProfileViewController
78+
profileViewController.user = user
79+
self.presentViewController(profileViewController, animated: true, completion: nil)
10580
}
106-
*/
10781

10882
}

0 commit comments

Comments
 (0)