fixed white space above certain table views in storyboard. Still need to fix custom cell height issues, properly shut down peer session after logging out, and auto log in

This commit is contained in:
Okechi 2016-02-16 14:57:39 -05:00
parent 3a59370829
commit 0c4ae5b177
3 changed files with 28 additions and 7 deletions

View File

@ -67,6 +67,7 @@ class FriendsListViewController: UIViewController, UITableViewDelegate, UITableV
if( indexPath.row == 0){ if( indexPath.row == 0){
let cell = self.table.dequeueReusableCellWithIdentifier("RequestCell", forIndexPath: indexPath) as? FriendRequestCell let cell = self.table.dequeueReusableCellWithIdentifier("RequestCell", forIndexPath: indexPath) as? FriendRequestCell
self.table.rowHeight = cell!.bounds.size.height
//sets count for current number of request //sets count for current number of request
cell?.requestNumber.text = String(self.request.count) cell?.requestNumber.text = String(self.request.count)
return cell! return cell!
@ -79,6 +80,7 @@ class FriendsListViewController: UIViewController, UITableViewDelegate, UITableV
//sets display name of friend (print for debugging purposes) //sets display name of friend (print for debugging purposes)
cell!.friendName.text = friend!.displayName cell!.friendName.text = friend!.displayName
self.table.rowHeight = cell!.bounds.size.height
//println(friend!.displayName) //println(friend!.displayName)
//sets profile image of current cell //sets profile image of current cell
@ -116,6 +118,20 @@ class FriendsListViewController: UIViewController, UITableViewDelegate, UITableV
} }
/*func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
println(indexPath.row)
if indexPath.row == 0{
let cell = self.table.dequeueReusableCellWithIdentifier("RequestCell", forIndexPath: indexPath) as? FriendRequestCell
return cell?.bounds.size.height as CGFloat!
}else{
let cell = self.table.dequeueReusableCellWithIdentifier("FriendCell", forIndexPath: indexPath) as? FriendsCell
return cell?.bounds.size.height as CGFloat!
}
}*/
override func setEditing(editing: Bool, animated: Bool) { override func setEditing(editing: Bool, animated: Bool) {
super.setEditing(editing, animated: animated) super.setEditing(editing, animated: animated)
self.table.setEditing(editing, animated: true) self.table.setEditing(editing, animated: true)

View File

@ -44,13 +44,17 @@ class LoginController: UIViewController, PFLogInViewControllerDelegate {
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
//check if user already signed in //check if user already signed in
if(PFUser.currentUser() != nil){ if(PFUser.currentUser() != nil){
presentLoggedInAlert() presentLoggedInAlert()
} }
self.signIn.layer.borderWidth = 1 self.signIn.layer.borderWidth = 1
self.signIn.layer.cornerRadius = 5 self.signIn.layer.cornerRadius = 5
self.signIn.layer.borderColor = UIColor.whiteColor().CGColor self.signIn.layer.borderColor = UIColor.whiteColor().CGColor
self.navigationController?.navigationBarHidden = true //self.navigationController?.navigationBarHidden = true
} }
@ -60,7 +64,8 @@ class LoginController: UIViewController, PFLogInViewControllerDelegate {
} }
func presentLoggedInAlert() { func presentLoggedInAlert() {
self.performSegueWithIdentifier("LoginToHomeSegue", sender: self) var story = UIStoryboard(name: "Main", bundle: nil)
var homeVC: HomeScreenViewController = story.instantiateViewControllerWithIdentifier("HomeVC") as! HomeScreenViewController!
} /* } /*
// MARK: - Navigation // MARK: - Navigation

View File

@ -353,20 +353,20 @@
<!--Friends List View Controller--> <!--Friends List View Controller-->
<scene sceneID="f64-9e-nxp"> <scene sceneID="f64-9e-nxp">
<objects> <objects>
<viewController id="Wv2-hP-rqT" customClass="FriendsListViewController" customModule="GetHip" customModuleProvider="target" sceneMemberID="viewController"> <viewController automaticallyAdjustsScrollViewInsets="NO" id="Wv2-hP-rqT" customClass="FriendsListViewController" customModule="GetHip" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides> <layoutGuides>
<viewControllerLayoutGuide type="top" id="8ym-uq-Pb7"/> <viewControllerLayoutGuide type="top" id="8ym-uq-Pb7"/>
<viewControllerLayoutGuide type="bottom" id="cK5-oC-1To"/> <viewControllerLayoutGuide type="bottom" id="cK5-oC-1To"/>
</layoutGuides> </layoutGuides>
<view key="view" contentMode="scaleToFill" id="jS0-Hf-zMc"> <view key="view" contentMode="scaleToFill" id="jS0-Hf-zMc">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/> <rect key="frame" x="0.0" y="64" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="Bxz-d2-wT5"> <tableView clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="Bxz-d2-wT5">
<rect key="frame" x="0.0" y="64" width="320" height="504"/> <rect key="frame" x="0.0" y="64" width="320" height="504"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<searchBar key="tableHeaderView" contentMode="redraw" id="pFw-ta-NIX"> <searchBar key="tableHeaderView" contentMode="redraw" id="pFw-ta-NIX">
<rect key="frame" x="0.0" y="262" width="320" height="44"/> <rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<textInputTraits key="textInputTraits"/> <textInputTraits key="textInputTraits"/>
<connections> <connections>
@ -484,7 +484,7 @@
<!--Home Screen View Controller--> <!--Home Screen View Controller-->
<scene sceneID="74v-iN-Rpu"> <scene sceneID="74v-iN-Rpu">
<objects> <objects>
<viewController id="i3K-xv-zw1" customClass="HomeScreenViewController" customModule="GetHip" customModuleProvider="target" sceneMemberID="viewController"> <viewController storyboardIdentifier="HomeVC" id="i3K-xv-zw1" customClass="HomeScreenViewController" customModule="GetHip" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides> <layoutGuides>
<viewControllerLayoutGuide type="top" id="TfY-s2-B0B"/> <viewControllerLayoutGuide type="top" id="TfY-s2-B0B"/>
<viewControllerLayoutGuide type="bottom" id="nqn-B0-8f9"/> <viewControllerLayoutGuide type="bottom" id="nqn-B0-8f9"/>
@ -1153,7 +1153,7 @@
<!--Song Selection View Controller--> <!--Song Selection View Controller-->
<scene sceneID="IkJ-pX-wAP"> <scene sceneID="IkJ-pX-wAP">
<objects> <objects>
<viewController id="VGZ-6j-3c9" customClass="SongSelectionViewController" customModule="GetHip" customModuleProvider="target" sceneMemberID="viewController"> <viewController automaticallyAdjustsScrollViewInsets="NO" id="VGZ-6j-3c9" customClass="SongSelectionViewController" customModule="GetHip" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides> <layoutGuides>
<viewControllerLayoutGuide type="top" id="AfP-pS-mzX"/> <viewControllerLayoutGuide type="top" id="AfP-pS-mzX"/>
<viewControllerLayoutGuide type="bottom" id="Zss-AJ-MHl"/> <viewControllerLayoutGuide type="bottom" id="Zss-AJ-MHl"/>