Skip to content

Commit

Permalink
Merge pull request #80 from fbu-team-awesome/move-lists-to-profile
Browse files Browse the repository at this point in the history
Move lists to profile
  • Loading branch information
britphan committed Aug 1, 2018
2 parents d2ac483 + 61352c5 commit c7fa3e1
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 30 deletions.
18 changes: 9 additions & 9 deletions Storyboards/ListView.storyboard
Expand Up @@ -11,11 +11,11 @@
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--List-->
<!--Lists-->
<scene sceneID="QTe-Ut-sX3">
<objects>
<navigationController title="List" id="pmw-Zq-8ez" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="4D2-Ls-czS">
<navigationController title="Lists" id="pmw-Zq-8ez" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" translucent="NO" id="4D2-Ls-czS">
<rect key="frame" x="0.0" y="20" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
Expand All @@ -27,12 +27,12 @@
</objects>
<point key="canvasLocation" x="-967" y="82"/>
</scene>
<!--List View Controller-->
<!--Lists-->
<scene sceneID="Klx-cZ-t5e">
<objects>
<viewController id="sat-FN-Bp2" customClass="ListViewController" sceneMemberID="viewController">
<viewController storyboardIdentifier="List" title="Lists" id="sat-FN-Bp2" customClass="ListViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="4xP-YL-dwZ">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="603"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView hidden="YES" clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="tPE-SK-dLL">
Expand Down Expand Up @@ -77,10 +77,10 @@
</prototypes>
</tableView>
<view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="zxU-et-0pA">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="603"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Your Favorites is currently empty!" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7cm-3W-jhM">
<rect key="frame" x="36" y="132" width="302" height="305"/>
<rect key="frame" x="36" y="132" width="302" height="241"/>
<fontDescription key="fontDescription" name="AvenirNext-Regular" family="Avenir Next" pointSize="23"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
Expand All @@ -97,7 +97,7 @@
</constraints>
</view>
<activityIndicatorView hidden="YES" opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" hidesWhenStopped="YES" style="whiteLarge" translatesAutoresizingMaskIntoConstraints="NO" id="XQx-EJ-uQz">
<rect key="frame" x="169" y="315" width="37" height="37"/>
<rect key="frame" x="169" y="283" width="37" height="37"/>
<constraints>
<constraint firstAttribute="width" constant="37" id="NlX-c7-Prf"/>
<constraint firstAttribute="height" constant="37" id="e1u-1y-Xjr"/>
Expand Down
32 changes: 21 additions & 11 deletions Storyboards/Profile.storyboard
Expand Up @@ -16,11 +16,11 @@
<objects>
<viewController storyboardIdentifier="Profile" id="khL-MV-X4z" customClass="ProfileViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="JvN-IA-aV9">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="603"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" spacing="16" translatesAutoresizingMaskIntoConstraints="NO" id="7sQ-Dg-P8c">
<rect key="frame" x="24" y="44" width="327" height="106"/>
<rect key="frame" x="24" y="24" width="327" height="106"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="RTr-PS-Db6">
<rect key="frame" x="0.0" y="0.0" width="106" height="106"/>
Expand Down Expand Up @@ -94,7 +94,7 @@
<color key="color" name="VTR_BlackLabel"/>
</activityIndicatorView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="top" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="laX-tE-8Bk">
<rect key="frame" x="24" y="166" width="327" height="65"/>
<rect key="frame" x="24" y="146" width="327" height="65"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Hi! This is my bio. I love so and so places. Lorem ipsum dolor sit amet." textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TkC-qT-sCg">
<rect key="frame" x="0.0" y="0.0" width="300.5" height="33"/>
Expand Down Expand Up @@ -136,13 +136,13 @@
</subviews>
</stackView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="mIX-UM-qy7">
<rect key="frame" x="0.0" y="303" width="375" height="364"/>
<rect key="frame" x="0.0" y="283" width="375" height="320"/>
<subviews>
<view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="LcL-eY-fb3">
<rect key="frame" x="0.0" y="0.0" width="375" height="364"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="320"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="1wX-mj-TVr">
<rect key="frame" x="0.0" y="0.0" width="375" height="364"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="320"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="ProfileListCell" rowHeight="110" id="7rg-jY-HTT" customClass="ProfileListCell">
Expand Down Expand Up @@ -216,7 +216,7 @@
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="NLM-mN-M1T">
<rect key="frame" x="0.0" y="247" width="375" height="56"/>
<rect key="frame" x="0.0" y="227" width="375" height="56"/>
<subviews>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Wa7-5R-Sot">
<rect key="frame" x="302" y="12.5" width="51" height="31"/>
Expand Down Expand Up @@ -294,6 +294,7 @@
<outlet property="tableView" destination="1wX-mj-TVr" id="2KY-DY-j3E"/>
<outlet property="tableviewView" destination="LcL-eY-fb3" id="mMG-3S-dXu"/>
<segue destination="cn5-vb-EiL" kind="show" identifier="detailsSegue" id="Ycd-XH-Z2X"/>
<segue destination="0Ln-DV-cYv" kind="show" identifier="listSegue" id="Ua9-nV-7VO"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="NsC-ah-MfL" userLabel="First Responder" sceneMemberID="firstResponder"/>
Expand All @@ -315,7 +316,7 @@
<objects>
<viewController id="9za-gd-0ng" customClass="RelationshipsViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="IYQ-GS-q8O">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="603"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="Jm7-Zb-dTC">
Expand Down Expand Up @@ -371,7 +372,7 @@
</prototypes>
</tableView>
<activityIndicatorView hidden="YES" opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" hidesWhenStopped="YES" style="whiteLarge" translatesAutoresizingMaskIntoConstraints="NO" id="Mcp-RL-tgd">
<rect key="frame" x="169" y="315" width="37" height="37"/>
<rect key="frame" x="169" y="283" width="37" height="37"/>
<constraints>
<constraint firstAttribute="height" constant="37" id="L2f-AA-YFM"/>
<constraint firstAttribute="width" constant="37" id="qeC-g6-oz8"/>
Expand All @@ -395,6 +396,14 @@
</objects>
<point key="canvasLocation" x="1310" y="-668"/>
</scene>
<!--ListView-->
<scene sceneID="cuD-wH-X7r">
<objects>
<viewControllerPlaceholder storyboardName="ListView" id="0Ln-DV-cYv" sceneMemberID="viewController"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="7XH-DW-dKK" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1494" y="59"/>
</scene>
<!--DetailsView-->
<scene sceneID="4SR-bD-qOX">
<objects>
Expand All @@ -408,9 +417,10 @@
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="D1P-qs-9bF" sceneMemberID="viewController">
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="6ca-OI-9SX">
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" translucent="NO" id="6ca-OI-9SX">
<rect key="frame" x="0.0" y="20" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<color key="barTintColor" name="VTR_Background"/>
</navigationBar>
<nil name="viewControllers"/>
<connections>
Expand Down Expand Up @@ -439,6 +449,6 @@
<inferredMetricsTieBreakers>
<segue reference="Ycd-XH-Z2X"/>
<segue reference="X0p-Su-RlJ"/>
<segue reference="OOB-8H-gVD"/>
<segue reference="ofK-xM-JRU"/>
</inferredMetricsTieBreakers>
</document>
Binary file removed Venture.sketch
Binary file not shown.
12 changes: 5 additions & 7 deletions View Controllers/ListViewController.m
Expand Up @@ -55,10 +55,8 @@ - (void)viewDidLoad {
self.refreshControl = [UIRefreshControl new];
[self.refreshControl addTarget:self action:@selector(retrieveCurrentUserData) forControlEvents:UIControlEventValueChanged];
[self.tableView insertSubview:self.refreshControl atIndex:0];
}

- (void)viewWillAppear:(BOOL)animated {
[self.navigationController setNavigationBarHidden:YES];

[self.navigationController.navigationBar setBackgroundColor:[UIColor colorNamed:@"VTR_Background"]];
}

- (void)addNotificationObservers {
Expand Down Expand Up @@ -117,7 +115,7 @@ - (void)retrieveCurrentUserData {

- (void)setSegmentControlView {
// get status bar height
CGRect statusBarFrame = [[UIApplication sharedApplication] statusBarFrame];
CGRect statusBarFrame = self.navigationController.navigationBar.frame;
CGFloat statusBarHeight = statusBarFrame.size.height;

self.edgesForExtendedLayout = UIRectEdgeNone;
Expand All @@ -127,7 +125,7 @@ - (void)setSegmentControlView {
HMSegmentedControl *segmentedControl = [[HMSegmentedControl alloc] initWithSectionTitles:@[@"Favorites", @"Wishlist"]];

// Customize appearance
[segmentedControl setFrame:CGRectMake(0, statusBarHeight, width, 60)];
[segmentedControl setFrame:CGRectMake(0, 0, width, 60)];
segmentedControl.selectionIndicatorHeight = 4.0f;
segmentedControl.backgroundColor = [UIColor colorNamed:@"VTR_LightOrange"];
segmentedControl.titleTextAttributes = @{NSForegroundColorAttributeName : [UIColor colorWithRed:1.00 green:0.60 blue:0.47 alpha:1.0]};
Expand Down Expand Up @@ -177,7 +175,7 @@ - (void)setSegmentControlView {
}];

CGRect tableViewFrame = self.tableView.frame;
tableViewFrame.origin.y = statusBarHeight + 60;
tableViewFrame.origin.y = segmentedControl.frame.size.height;
tableViewFrame.size.width = width;
self.tableView.frame = tableViewFrame;
}
Expand Down
13 changes: 10 additions & 3 deletions View Controllers/ProfileViewController.m
Expand Up @@ -18,6 +18,7 @@
#import "RelationshipsViewController.h"
#import "Relationships.h"
#import "NCHelper.h"
#import "ListViewController.h"

@interface ProfileViewController () <CLLocationManagerDelegate, GMSMapViewDelegate, UITableViewDataSource, UITableViewDelegate>
// Outlet Definitions //
Expand Down Expand Up @@ -94,8 +95,8 @@ - (void)viewDidLoad {
self.mapView.settings.myLocationButton = YES;
[self.mapView setMyLocationEnabled:YES];

// hide follow button
self.followButton.hidden = YES;
// show list button instead
[self.followButton setTitle:@"View Lists" forState:UIControlStateNormal];
}

// init tableview
Expand Down Expand Up @@ -318,7 +319,13 @@ - (IBAction)switchClicked:(id)sender {
}

- (IBAction)followClicked:(id)sender {
if([self.followButton.titleLabel.text isEqualToString:@"Follow"])
//if we are on our own profile, show lists instead
if([[PFUser currentUser].objectId isEqualToString:self.user.objectId]) {
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"ListView" bundle:[NSBundle mainBundle]];
ListViewController *listVC = (ListViewController *)[storyboard instantiateViewControllerWithIdentifier:@"List"];
[self.navigationController pushViewController:listVC animated:YES];
}
else if([self.followButton.titleLabel.text isEqualToString:@"Follow"])
{
[[PFUser currentUser] follow:self.user];
[self.followButton setTitle:@"Unfollow" forState:UIControlStateNormal];
Expand Down

0 comments on commit c7fa3e1

Please sign in to comment.