diff --git a/GetHip.xcodeproj/project.pbxproj b/GetHip.xcodeproj/project.pbxproj index 0377100..c799bc8 100644 --- a/GetHip.xcodeproj/project.pbxproj +++ b/GetHip.xcodeproj/project.pbxproj @@ -7,6 +7,8 @@ objects = { /* Begin PBXBuildFile section */ + 3E0B78B91C6E3756001DF21E /* Pause-52.png in Resources */ = {isa = PBXBuildFile; fileRef = 3E0B78B71C6E3756001DF21E /* Pause-52.png */; }; + 3E0B78BA1C6E3756001DF21E /* Play-52.png in Resources */ = {isa = PBXBuildFile; fileRef = 3E0B78B81C6E3756001DF21E /* Play-52.png */; }; 3E101F061C52E5FD00C895CA /* MultipeerConnectivity.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E101F051C52E5FD00C895CA /* MultipeerConnectivity.framework */; }; 3E101F081C52E65300C895CA /* PartyServiceManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E101F071C52E65300C895CA /* PartyServiceManager.swift */; }; 3E101F0A1C52F14A00C895CA /* InviteFriendsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E101F091C52F14A00C895CA /* InviteFriendsView.swift */; }; @@ -102,6 +104,7 @@ 3E627FF11C55AE35005C0372 /* TDAudioInputStreamer.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E627FE11C55AE35005C0372 /* TDAudioInputStreamer.m */; }; 3E627FF21C55AE35005C0372 /* TDAudioOutputStreamer.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E627FE31C55AE35005C0372 /* TDAudioOutputStreamer.m */; }; 3E627FF31C55AE35005C0372 /* TDAudioPlayerConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E627FE51C55AE35005C0372 /* TDAudioPlayerConstants.m */; }; + 3E6738F51C6E9C7700B47C3E /* LoginController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E6738F41C6E9C7700B47C3E /* LoginController.swift */; }; 3E76CF261C38258600193B58 /* Parse.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E76CF231C38258600193B58 /* Parse.framework */; }; 3E76CF271C38258600193B58 /* ParseFacebookUtilsV4.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E76CF241C38258600193B58 /* ParseFacebookUtilsV4.framework */; }; 3E76CF281C38258600193B58 /* ParseUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E76CF251C38258600193B58 /* ParseUI.framework */; }; @@ -119,6 +122,7 @@ 3EBE97731C5413240079B54A /* TestInviteFriendsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EBE97721C5413240079B54A /* TestInviteFriendsCell.swift */; }; 3EDA82E11C473E900081ED53 /* FriendData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EDA82E01C473E900081ED53 /* FriendData.swift */; }; 3EDA82E31C4741C70081ED53 /* FriendDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EDA82E21C4741C70081ED53 /* FriendDataSource.swift */; }; + 3EF36C761C71694C00CD0DC0 /* SignInController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EF36C751C71694C00CD0DC0 /* SignInController.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -132,6 +136,8 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 3E0B78B71C6E3756001DF21E /* Pause-52.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Pause-52.png"; path = "../../../Dropbox/Gethip/Screens/Song Playing/5 Play Screen/Assets/Pause-52.png"; sourceTree = ""; }; + 3E0B78B81C6E3756001DF21E /* Play-52.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Play-52.png"; path = "../../../Dropbox/Gethip/Screens/Song Playing/5 Play Screen/Assets/Play-52.png"; sourceTree = ""; }; 3E101F051C52E5FD00C895CA /* MultipeerConnectivity.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MultipeerConnectivity.framework; path = System/Library/Frameworks/MultipeerConnectivity.framework; sourceTree = SDKROOT; }; 3E101F071C52E65300C895CA /* PartyServiceManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PartyServiceManager.swift; sourceTree = ""; }; 3E101F091C52F14A00C895CA /* InviteFriendsView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InviteFriendsView.swift; sourceTree = ""; }; @@ -249,6 +255,7 @@ 3E627FE31C55AE35005C0372 /* TDAudioOutputStreamer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TDAudioOutputStreamer.m; sourceTree = ""; }; 3E627FE41C55AE35005C0372 /* TDAudioPlayerConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TDAudioPlayerConstants.h; path = "../../../../Downloads/TDAudioPlayer-master/TDAudioPlayer/AudioPlayerLibrary/TDAudioPlayerConstants.h"; sourceTree = ""; }; 3E627FE51C55AE35005C0372 /* TDAudioPlayerConstants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TDAudioPlayerConstants.m; path = "../../../../Downloads/TDAudioPlayer-master/TDAudioPlayer/AudioPlayerLibrary/TDAudioPlayerConstants.m"; sourceTree = ""; }; + 3E6738F41C6E9C7700B47C3E /* LoginController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoginController.swift; sourceTree = ""; }; 3E76CF231C38258600193B58 /* Parse.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Parse.framework; path = "../../Parse-iOS/Parse.framework"; sourceTree = ""; }; 3E76CF241C38258600193B58 /* ParseFacebookUtilsV4.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ParseFacebookUtilsV4.framework; path = "../../Parse-iOS/ParseFacebookUtilsV4.framework"; sourceTree = ""; }; 3E76CF251C38258600193B58 /* ParseUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ParseUI.framework; path = "../../Parse-iOS/ParseUI.framework"; sourceTree = ""; }; @@ -268,6 +275,7 @@ 3EBE97721C5413240079B54A /* TestInviteFriendsCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestInviteFriendsCell.swift; sourceTree = ""; }; 3EDA82E01C473E900081ED53 /* FriendData.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FriendData.swift; sourceTree = ""; }; 3EDA82E21C4741C70081ED53 /* FriendDataSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FriendDataSource.swift; sourceTree = ""; }; + 3EF36C751C71694C00CD0DC0 /* SignInController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SignInController.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -459,6 +467,8 @@ 3E438AE01C57387B0055C97A /* iPhone5 */ = { isa = PBXGroup; children = ( + 3E0B78B71C6E3756001DF21E /* Pause-52.png */, + 3E0B78B81C6E3756001DF21E /* Play-52.png */, 3EB8845B1C6C647700CCDCCE /* Add More@2x.png */, 3EB8845C1C6C647700CCDCCE /* Leave Party@2x.png */, 3E5BD3121C6C45CE00266B16 /* Home Copy@2x.png */, @@ -560,6 +570,8 @@ 3E330B191C38502F00276FE4 /* LoginViewController.swift */, 3E4169541C398A5B00B193AF /* SignUpViewController.swift */, 3E1BDA561C37111D00EE3B84 /* ViewController.swift */, + 3E6738F41C6E9C7700B47C3E /* LoginController.swift */, + 3EF36C751C71694C00CD0DC0 /* SignInController.swift */, ); name = "User Authentication"; sourceTree = ""; @@ -773,6 +785,7 @@ 3E438AEA1C5738EF0055C97A /* Turntable@2x.png in Resources */, 3E5952801C39DDA800C88C71 /* Group@3x.png in Resources */, 3E5952631C39DBC900C88C71 /* Friends.png in Resources */, + 3E0B78B91C6E3756001DF21E /* Pause-52.png in Resources */, 3E5952811C39DDA800C88C71 /* Settings.png in Resources */, 3E59527E1C39DDA800C88C71 /* Group.png in Resources */, 3E5952711C39DC1E00C88C71 /* Rectangle 10 + Change Photo + voice_presentation copy + voice_presentation copy 2 + voice_presentation + Music 2 + Music 2@3x.png in Resources */, @@ -790,6 +803,7 @@ 3EBE976A1C53E4290079B54A /* Blue Check.png in Resources */, 3E438AE71C5738EF0055C97A /* Friends@2x.png in Resources */, 3E59528A1C39EB6100C88C71 /* Turntable@2x.png in Resources */, + 3E0B78BA1C6E3756001DF21E /* Play-52.png in Resources */, 3E438ADE1C572DFD0055C97A /* Main.storyboard in Resources */, 3E438AE81C5738EF0055C97A /* Settings@2x.png in Resources */, 3E5952681C39DBC900C88C71 /* Settings@3x.png in Resources */, @@ -829,6 +843,7 @@ 3E5485B51C69CE2F00E7D5AB /* InvitedCollectionViewCell.swift in Sources */, 3E3412571C54C31F006226E0 /* SongSelectionViewController.swift in Sources */, 3E627FE81C55AE35005C0372 /* TDAudioMetaInfo.m in Sources */, + 3E6738F51C6E9C7700B47C3E /* LoginController.swift in Sources */, 3E34125B1C54C73A006226E0 /* PartySession.swift in Sources */, 3E627FF01C55AE35005C0372 /* TDAudioStream.m in Sources */, 3E627FE91C55AE35005C0372 /* TDAudioPlayer.m in Sources */, @@ -848,6 +863,7 @@ 3E627FEF1C55AE35005C0372 /* TDAudioQueueFiller.m in Sources */, 3E1BDA551C37111D00EE3B84 /* GetHip.xcdatamodeld in Sources */, 3E326BCC1C51C20000F785CF /* SettingsTableViewController.swift in Sources */, + 3EF36C761C71694C00CD0DC0 /* SignInController.swift in Sources */, 3EBE97731C5413240079B54A /* TestInviteFriendsCell.swift in Sources */, 3E101F0A1C52F14A00C895CA /* InviteFriendsView.swift in Sources */, 3E1B5E451C5274E700D1AB62 /* SettingsDetailViewWrapper.swift in Sources */, diff --git a/GetHip/CurrentlyPlayingViewController.swift b/GetHip/CurrentlyPlayingViewController.swift index 8a257c4..c6684b7 100644 --- a/GetHip/CurrentlyPlayingViewController.swift +++ b/GetHip/CurrentlyPlayingViewController.swift @@ -66,7 +66,8 @@ class CurrentlyPlayingViewController: UIViewController { // Pass the selected object to the new view controller. if(segue.identifier == "InPartySegue"){ - + let vc: InPartyViewController = (segue.destinationViewController as? InPartyViewController)! + vc.setData(self.party) } } diff --git a/GetHip/FriendDataSource.swift b/GetHip/FriendDataSource.swift index 01a2628..26eab22 100644 --- a/GetHip/FriendDataSource.swift +++ b/GetHip/FriendDataSource.swift @@ -43,7 +43,7 @@ class FriendDataSource{ (imgData, error) -> Void in var downloadedImg = UIImage(data: imgData!) - newFriend.profileImg.image = downloadedImg + newFriend.profileImg = UIImageView(image: downloadedImg) }) }) //print(userName) @@ -75,7 +75,7 @@ class FriendDataSource{ (imgData, error) -> Void in var downloadedImg = UIImage(data: imgData!) - newFriend.profileImg.image = downloadedImg + newFriend.profileImg = UIImageView(image: downloadedImg) }) }) diff --git a/GetHip/HomeScreenViewController.swift b/GetHip/HomeScreenViewController.swift index f6bc6cb..51d47db 100644 --- a/GetHip/HomeScreenViewController.swift +++ b/GetHip/HomeScreenViewController.swift @@ -93,7 +93,7 @@ class HomeScreenViewController: UIViewController { let nav: UINavigationController = (segue.destinationViewController as? UINavigationController)! let vc: SettingsTableViewController = (nav.viewControllers[0] as? SettingsTableViewController)! - vc.setData(self.userData) + vc.setData(self.userData, prty: self.partyData) } if segue.identifier == "FriendListSegue" { diff --git a/GetHip/InPartyViewController.swift b/GetHip/InPartyViewController.swift index 23f8e37..1f1caf5 100644 --- a/GetHip/InPartyViewController.swift +++ b/GetHip/InPartyViewController.swift @@ -8,7 +8,7 @@ import UIKit -class InPartyViewController: UIViewController { +class InPartyViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate{ var party: PartyServiceManager! @IBOutlet var friendsInParty: UICollectionView! @IBOutlet var AddMore: UIButton! @@ -24,10 +24,16 @@ class InPartyViewController: UIViewController { } + func setData(prty: PartyServiceManager){ + self.party = prty + } + override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. + self.friendsInParty.dataSource = self + self.friendsInParty.delegate = self } override func didReceiveMemoryWarning() { @@ -36,6 +42,33 @@ class InPartyViewController: UIViewController { } + func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell { + + let friend = self.party.invitedFriends[indexPath.row] + let cell: InvitedCollectionViewCell = self.friendsInParty.dequeueReusableCellWithReuseIdentifier("InvitedCollectionCell", forIndexPath: indexPath) as! InvitedCollectionViewCell + + if friend.profileImg == nil { + cell.friendImage.backgroundColor = UIColor.grayColor() + } + else{ + cell.friendImage.image = friend.profileImg.image! + } + + //rounds uiimage and configures UIImageView + //cell!.proImage.layer.borderWidth = 3.0 + //cell!.proImage.clipsToBounds = true + cell.friendImage.layer.cornerRadius = cell.friendImage.frame.size.width/2 + //cell.alpha = 0.5 + //cell!.proImage.layer.borderColor = UIColor.whiteColor().CGColor + //cell!.proImage.layer.masksToBounds = true + + return cell + + } + + func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + return self.party.invitedFriends.count + } /* // MARK: - Navigation diff --git a/GetHip/LoadingPartyViewController.swift b/GetHip/LoadingPartyViewController.swift index d8a562b..f73c599 100644 --- a/GetHip/LoadingPartyViewController.swift +++ b/GetHip/LoadingPartyViewController.swift @@ -72,7 +72,7 @@ class LoadingPartyViewController: UIViewController, UICollectionViewDataSource, cell.friendImage.backgroundColor = UIColor.grayColor() } else{ - + cell.friendImage.image = friend.profileImg.image! } //rounds uiimage and configures UIImageView diff --git a/GetHip/LoginController.swift b/GetHip/LoginController.swift new file mode 100644 index 0000000..77fac1b --- /dev/null +++ b/GetHip/LoginController.swift @@ -0,0 +1,75 @@ +// +// LoginController.swift +// GetHip +// +// Created by Okechi on 2/12/16. +// Copyright (c) 2016 Kroleo. All rights reserved. +// + +import UIKit + +class LoginController: UIViewController, PFLogInViewControllerDelegate { + @IBOutlet var userEmailField: UITextField! + @IBOutlet var password: UITextField! + @IBOutlet var signIn: UIButton! + @IBOutlet var signUpButton: UIButton! + @IBOutlet var forgotPassBtn: UIButton! + + + + @IBAction func loginBtnPressed(sender: UIButton){ + //check if user logging in with email, implement later + + PFUser.logInWithUsernameInBackground(userEmailField.text!, password: password.text!, block: { + (user, error) -> Void in + + if(user != nil){ + self.performSegueWithIdentifier("LoginToHomeSegue", sender: self) + }else{ + var alert = UIAlertController(title: "Invalid Login", message: "Your friend request was sent successfully!", preferredStyle: .Alert) + alert.addAction(UIAlertAction(title: "OK", style: .Default, handler:{(action: UIAlertAction!) in alert.dismissViewControllerAnimated(true, completion: nil)})) + + self.presentViewController(alert, animated: true, completion: nil) + } + }) + + } + + @IBAction func signUpBtnPressed(sender: UIButton){ + self.performSegueWithIdentifier("signUpSegue", sender: self) + } + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + //check if user already signed in + if(PFUser.currentUser() != nil){ + presentLoggedInAlert() + } + + self.signIn.layer.borderWidth = 1 + self.signIn.layer.cornerRadius = 5 + self.signIn.layer.borderColor = UIColor.whiteColor().CGColor + self.navigationController?.navigationBarHidden = true + + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + func presentLoggedInAlert() { + self.performSegueWithIdentifier("LoginToHomeSegue", sender: self) + + } /* + // MARK: - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { + // Get the new view controller using segue.destinationViewController. + // Pass the selected object to the new view controller. + } + */ + +} diff --git a/GetHip/LoginViewController.swift b/GetHip/LoginViewController.swift index 5c106f6..adbd61a 100644 --- a/GetHip/LoginViewController.swift +++ b/GetHip/LoginViewController.swift @@ -6,6 +6,7 @@ // Copyright (c) 2016 Kroleo. All rights reserved. // +//DEPRECATED WILL DELETE WHEN PROJECT COMPLETED import UIKit class LoginViewController: PFLogInViewController{ diff --git a/GetHip/Main.storyboard b/GetHip/Main.storyboard index 3ff5cd2..8b1d8cc 100644 --- a/GetHip/Main.storyboard +++ b/GetHip/Main.storyboard @@ -1,9 +1,186 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -24,7 +201,7 @@ - + @@ -145,6 +322,23 @@ + + + + + + + + + + + + + + + + + @@ -169,6 +363,23 @@ + + + + + + + + + + + + + + + + + @@ -256,6 +467,7 @@ + @@ -346,6 +558,7 @@ + @@ -522,7 +735,7 @@ - + @@ -785,7 +998,7 @@ - +