diff --git a/GetHip.xcodeproj/project.pbxproj b/GetHip.xcodeproj/project.pbxproj index 91f2419..834ae03 100644 --- a/GetHip.xcodeproj/project.pbxproj +++ b/GetHip.xcodeproj/project.pbxproj @@ -35,6 +35,7 @@ 3E3412591C54C6B7006226E0 /* SongCellWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E3412581C54C6B7006226E0 /* SongCellWrapper.swift */; }; 3E34125B1C54C73A006226E0 /* PartySession.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E34125A1C54C73A006226E0 /* PartySession.swift */; }; 3E34125D1C54CF1B006226E0 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E34125C1C54CF1B006226E0 /* MediaPlayer.framework */; }; + 3E37709E1CAB5EC000A66097 /* ForgotPassViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E37709D1CAB5EC000A66097 /* ForgotPassViewController.swift */; }; 3E379EF61C3E646000F7BCCD /* ParseNetDebug.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E379EF51C3E646000F7BCCD /* ParseNetDebug.m */; }; 3E379EF71C3F794500F7BCCD /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E76CF2D1C3835C500193B58 /* CFNetwork.framework */; }; 3E379EFE1C3F794500F7BCCD /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E379EF81C3F794500F7BCCD /* CoreGraphics.framework */; }; @@ -120,13 +121,10 @@ 3E6D438D1C78969A00CA805F /* CancelInvited@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3E6D438C1C78969A00CA805F /* CancelInvited@2x.png */; }; 3E76CF2C1C38349D00193B58 /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E76CF2B1C38349D00193B58 /* libsqlite3.dylib */; }; 3E7BB8E21C5B4A350005B834 /* Change Song@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3E7BB8E11C5B4A350005B834 /* Change Song@2x.png */; }; - 3E7D37D51C75D7EF002E682F /* Raise@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3E7D37D41C75D7EF002E682F /* Raise@2x.png */; }; - 3E7D37D71C75D80F002E682F /* Lower@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3E7D37D61C75D80F002E682F /* Lower@2x.png */; }; - 3E7D37D91C75D882002E682F /* B2P Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3E7D37D81C75D882002E682F /* B2P Icon@2x.png */; }; - 3E7D37DB1C75D899002E682F /* B2P Button@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3E7D37DA1C75D899002E682F /* B2P Button@2x.png */; }; 3EB6B39B1C87B8AE006B674D /* JoiningPartyViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EB6B39A1C87B8AE006B674D /* JoiningPartyViewController.swift */; }; 3EB8845D1C6C647700CCDCCE /* Add More@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3EB8845B1C6C647700CCDCCE /* Add More@2x.png */; }; 3EB8845E1C6C647700CCDCCE /* Leave Party@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3EB8845C1C6C647700CCDCCE /* Leave Party@2x.png */; }; + 3EBE825A1CB06793004A2730 /* HomeTabController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EBE82591CB06793004A2730 /* HomeTabController.swift */; }; 3EBE97661C53CEDA0079B54A /* Send Invites Button.png in Resources */ = {isa = PBXBuildFile; fileRef = 3EBE97651C53CEDA0079B54A /* Send Invites Button.png */; }; 3EBE976A1C53E4290079B54A /* Blue Check.png in Resources */ = {isa = PBXBuildFile; fileRef = 3EBE97671C53E4290079B54A /* Blue Check.png */; }; 3EBE976B1C53E4290079B54A /* cross.png in Resources */ = {isa = PBXBuildFile; fileRef = 3EBE97681C53E4290079B54A /* cross.png */; }; @@ -184,6 +182,7 @@ 3E3412581C54C6B7006226E0 /* SongCellWrapper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SongCellWrapper.swift; sourceTree = ""; }; 3E34125A1C54C73A006226E0 /* PartySession.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PartySession.swift; sourceTree = ""; }; 3E34125C1C54CF1B006226E0 /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = System/Library/Frameworks/MediaPlayer.framework; sourceTree = SDKROOT; }; + 3E37709D1CAB5EC000A66097 /* ForgotPassViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ForgotPassViewController.swift; sourceTree = ""; }; 3E379EF51C3E646000F7BCCD /* ParseNetDebug.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ParseNetDebug.m; sourceTree = ""; }; 3E379EF81C3F794500F7BCCD /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 3E379EF91C3F794500F7BCCD /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; @@ -286,13 +285,10 @@ 3E76CF2D1C3835C500193B58 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; }; 3E76CF2F1C3835E300193B58 /* NetworkExtension.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NetworkExtension.framework; path = System/Library/Frameworks/NetworkExtension.framework; sourceTree = SDKROOT; }; 3E7BB8E11C5B4A350005B834 /* Change Song@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Change Song@2x.png"; path = "../../../Dropbox/Gethip/Screens/Song Selected/5 Song Selected/Assets/Change Song@2x.png"; sourceTree = ""; }; - 3E7D37D41C75D7EF002E682F /* Raise@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Raise@2x.png"; path = "../../../Dropbox/Gethip/For final/Volume/i5 Volume/Raise@2x.png"; sourceTree = ""; }; - 3E7D37D61C75D80F002E682F /* Lower@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Lower@2x.png"; path = "../../../Dropbox/Gethip/For final/Volume/i5 Volume/Lower@2x.png"; sourceTree = ""; }; - 3E7D37D81C75D882002E682F /* B2P Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "B2P Icon@2x.png"; path = "../../../Dropbox/Gethip/For final/Back To Party/i5/B2P Icon@2x.png"; sourceTree = ""; }; - 3E7D37DA1C75D899002E682F /* B2P Button@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "B2P Button@2x.png"; path = "../../../Dropbox/Gethip/For final/Back To Party/i5/B2P Button@2x.png"; sourceTree = ""; }; 3EB6B39A1C87B8AE006B674D /* JoiningPartyViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JoiningPartyViewController.swift; sourceTree = ""; }; 3EB8845B1C6C647700CCDCCE /* Add More@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Add More@2x.png"; path = "../../../Dropbox/Gethip/Screens/iPhone 5 Party Screens/Party Screen/Assets/Add More@2x.png"; sourceTree = ""; }; 3EB8845C1C6C647700CCDCCE /* Leave Party@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Leave Party@2x.png"; path = "../../../Dropbox/Gethip/Screens/iPhone 5 Party Screens/Party Screen/Assets/Leave Party@2x.png"; sourceTree = ""; }; + 3EBE82591CB06793004A2730 /* HomeTabController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HomeTabController.swift; sourceTree = ""; }; 3EBE97651C53CEDA0079B54A /* Send Invites Button.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Send Invites Button.png"; path = "../../../Dropbox/Gethip/Screens/Friends + Invite Screens/i6/Invite Friends/Send Invites Button.png"; sourceTree = ""; }; 3EBE97671C53E4290079B54A /* Blue Check.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Blue Check.png"; path = "../../../Dropbox/Gethip/Screens/Friends + Invite Screens/i6/Invite Friends/Blue Check.png"; sourceTree = ""; }; 3EBE97681C53E4290079B54A /* cross.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = cross.png; path = "../../../Dropbox/Gethip/Screens/Friends + Invite Screens/i6/Invite Friends/cross.png"; sourceTree = ""; }; @@ -363,6 +359,7 @@ 3E18D4921C51F6230012F7DF /* UserParseData.swift */, 3E326BCB1C51C20000F785CF /* SettingsTableViewController.swift */, 3E1B5E441C5274E700D1AB62 /* SettingsDetailViewWrapper.swift */, + 3EBE82591CB06793004A2730 /* HomeTabController.swift */, ); name = UserSettingsSoruce; sourceTree = ""; @@ -510,10 +507,6 @@ 3E6D438A1C78968C00CA805F /* Joining@2x.png */, 3E6D43851C782E3200CA805F /* Decline@2x.png */, 3E4AA5201C853E1A00746839 /* Rectangle 10 + Change Photo + voice_presentation copy + voice_presentation copy 2 + voice_presentation + Music 2 + Music 2@2x.png */, - 3E7D37DA1C75D899002E682F /* B2P Button@2x.png */, - 3E7D37D81C75D882002E682F /* B2P Icon@2x.png */, - 3E7D37D61C75D80F002E682F /* Lower@2x.png */, - 3E7D37D41C75D7EF002E682F /* Raise@2x.png */, 3E0B78B71C6E3756001DF21E /* Pause-52.png */, 3E0B78B81C6E3756001DF21E /* Play-52.png */, 3EB8845B1C6C647700CCDCCE /* Add More@2x.png */, @@ -619,6 +612,7 @@ 3E1BDA561C37111D00EE3B84 /* ViewController.swift */, 3E6738F41C6E9C7700B47C3E /* LoginController.swift */, 3EF36C751C71694C00CD0DC0 /* SignInController.swift */, + 3E37709D1CAB5EC000A66097 /* ForgotPassViewController.swift */, ); name = "User Authentication"; sourceTree = ""; @@ -830,7 +824,6 @@ files = ( 3E5BD3171C6C45CE00266B16 /* StarPlayer@2x.png in Resources */, 3E5BD3161C6C45CE00266B16 /* Party@2x.png in Resources */, - 3E7D37D71C75D80F002E682F /* Lower@2x.png in Resources */, 3E4169491C385F1000B193AF /* 1x.png in Resources */, 3E4AA5211C853E1A00746839 /* Rectangle 10 + Change Photo + voice_presentation copy + voice_presentation copy 2 + voice_presentation + Music 2 + Music 2@2x.png in Resources */, 3E5952641C39DBC900C88C71 /* Friends@2x.png in Resources */, @@ -852,7 +845,6 @@ 3E5952811C39DDA800C88C71 /* Settings.png in Resources */, 3E59527E1C39DDA800C88C71 /* Group.png in Resources */, 3E6D438D1C78969A00CA805F /* CancelInvited@2x.png in Resources */, - 3E7D37DB1C75D899002E682F /* B2P Button@2x.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 */, 3E6D438B1C78968C00CA805F /* Joining@2x.png in Resources */, 3E33EFDC1C5B56340011B9B5 /* No Friend Requests i5@2x.png in Resources */, @@ -866,7 +858,6 @@ 3E59527B1C39DDA800C88C71 /* Create.png in Resources */, 3E5952701C39DC1E00C88C71 /* Rectangle 10 + Change Photo + voice_presentation copy + voice_presentation copy 2 + voice_presentation + Music 2 + Music 2@2x.png in Resources */, 3EBE976C1C53E4290079B54A /* Tap Circle.png in Resources */, - 3E7D37D91C75D882002E682F /* B2P Icon@2x.png in Resources */, 3E5952671C39DBC900C88C71 /* Settings@2x.png in Resources */, 3EBE976A1C53E4290079B54A /* Blue Check.png in Resources */, 3E438AE71C5738EF0055C97A /* Friends@2x.png in Resources */, @@ -880,7 +871,6 @@ 3E5952691C39DBC900C88C71 /* Star.png in Resources */, 3E41D74E1C8D17F300FFD846 /* Icon-60.png in Resources */, 3E59527C1C39DDA800C88C71 /* Create@2x.png in Resources */, - 3E7D37D51C75D7EF002E682F /* Raise@2x.png in Resources */, 3E59526A1C39DBC900C88C71 /* Star@2x.png in Resources */, 3E5952821C39DDA800C88C71 /* Settings@2x.png in Resources */, 3EB8845D1C6C647700CCDCCE /* Add More@2x.png in Resources */, @@ -913,10 +903,12 @@ 3E627FE61C55AE35005C0372 /* NSInputStream+URLInitialization.m in Sources */, 3E5485B51C69CE2F00E7D5AB /* InvitedCollectionViewCell.swift in Sources */, 3E6D43891C7831B100CA805F /* InvitedToPartyViewController.swift in Sources */, + 3E37709E1CAB5EC000A66097 /* ForgotPassViewController.swift in Sources */, 3E3412571C54C31F006226E0 /* SongSelectionViewController.swift in Sources */, 3E627FE81C55AE35005C0372 /* TDAudioMetaInfo.m in Sources */, 3E6738F51C6E9C7700B47C3E /* LoginController.swift in Sources */, 3E34125B1C54C73A006226E0 /* PartySession.swift in Sources */, + 3EBE825A1CB06793004A2730 /* HomeTabController.swift in Sources */, 3E50E0401C74B97300EB9EA9 /* BackToHomeScreenViewController.swift in Sources */, 3E627FF01C55AE35005C0372 /* TDAudioStream.m in Sources */, 3E627FE91C55AE35005C0372 /* TDAudioPlayer.m in Sources */, diff --git a/GetHip/AppDelegate.swift b/GetHip/AppDelegate.swift index 8e67637..412f2c4 100644 --- a/GetHip/AppDelegate.swift +++ b/GetHip/AppDelegate.swift @@ -44,14 +44,16 @@ class AppDelegate: UIResponder, UIApplicationDelegate , CLLocationManagerDelegat startSignificantChangeUpdates() //check if user logged in on app startup - if(PFUser.currentUser() != nil){ + var storyboard = UIStoryboard(name: "Main", bundle: nil) + + if(PFUser.currentUser() == nil){ - var storyboard = UIStoryboard(name: "Main", bundle: nil) - - var initialViewController = storyboard.instantiateViewControllerWithIdentifier("HomeVC") as! HomeScreenViewController + //var initialViewController = storyboard.instantiateViewControllerWithIdentifier("HomeVC") as! HomeScreenViewController + var initialViewController = storyboard.instantiateViewControllerWithIdentifier("LoginVC") as! UITabBarController self.window?.rootViewController = initialViewController self.window?.makeKeyAndVisible() + }else{ } return true diff --git a/GetHip/ForgotPassViewController.swift b/GetHip/ForgotPassViewController.swift new file mode 100644 index 0000000..bb80ab7 --- /dev/null +++ b/GetHip/ForgotPassViewController.swift @@ -0,0 +1,35 @@ +// +// ForgotPassViewController.swift +// GetHip +// +// Created by Okechi on 3/29/16. +// Copyright (c) 2016 Kroleo. All rights reserved. +// + +import UIKit + +class ForgotPassViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + + /* + // 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/FriendsListViewController.swift b/GetHip/FriendsListViewController.swift index 615a635..06d316c 100644 --- a/GetHip/FriendsListViewController.swift +++ b/GetHip/FriendsListViewController.swift @@ -38,6 +38,13 @@ class FriendsListViewController: UIViewController, UITableViewDelegate, UITableV override func viewDidLoad() { super.viewDidLoad() + + //for sharing data with tab bar navigations + self.user = (self.tabBarController as? HomeTabController)!.userData + self.party = (self.tabBarController as? HomeTabController)!.partyData + self.friends = (self.tabBarController as? HomeTabController)!.friendData + self.request = (self.tabBarController as? HomeTabController)!.requestData + self.table.delegate = self self.table.dataSource = self self.party.delegate = self diff --git a/GetHip/HomeScreenViewController.swift b/GetHip/HomeScreenViewController.swift index a771bd9..60cc836 100644 --- a/GetHip/HomeScreenViewController.swift +++ b/GetHip/HomeScreenViewController.swift @@ -22,6 +22,7 @@ class HomeScreenViewController: UIViewController, PartyServiceManagerDelegate { //async data update methods + /* func refreshFriendData(notification:NSNotification){ let friendInfo = self.frndDataManager.getFriends() @@ -43,7 +44,8 @@ class HomeScreenViewController: UIViewController, PartyServiceManagerDelegate { } - +*/ + /* func refreshUserData(notification:NSNotification){ self.userData = self.usrDataManager.getUser() @@ -66,11 +68,13 @@ class HomeScreenViewController: UIViewController, PartyServiceManagerDelegate { self.frndDataManager = FriendDataSource() } + */ + /* func loadID(notification: NSNotification){ self.performSegueWithIdentifier("InviteFriendsSegue", sender: nil) } - + */ override func viewDidLoad() { @@ -80,19 +84,21 @@ class HomeScreenViewController: UIViewController, PartyServiceManagerDelegate { self.view.backgroundColor = UIColor.whiteColor() CreateAPartyBtn.layer.cornerRadius = 5 CreateAPartyBtn.layer.borderWidth = 1 - self.navigationController?.navigationBarHidden = true + //self.tabBarController?.delegate = self + //self.navigationController?.navigationBarHidden = true - NSNotificationCenter.defaultCenter().addObserver(self, selector: "loadID:", name: "gotDisplayID", object: nil) + //NSNotificationCenter.defaultCenter().addObserver(self, selector: "loadID:", name: "gotDisplayID", object: nil) - NSNotificationCenter.defaultCenter().addObserver(self, selector: "refreshFriendData:", name: "refreshTableView", object: nil) + //NSNotificationCenter.defaultCenter().addObserver(self, selector: "refreshFriendData:", name: "refreshTableView", object: nil) - NSNotificationCenter.defaultCenter().addObserver(self, selector: "refreshUserData:", name: "refreshSettingsView", object: nil) + //NSNotificationCenter.defaultCenter().addObserver(self, selector: "refreshUserData:", name: "refreshSettingsView", object: nil) } override func viewWillAppear(animated: Bool) { + /* self.userData = [] self.friendData = [] dispatch_async(dispatch_get_main_queue(), { @@ -100,6 +106,7 @@ class HomeScreenViewController: UIViewController, PartyServiceManagerDelegate { //self.frndDataManager = FriendDataSource() }) +*/ } @@ -133,7 +140,7 @@ class HomeScreenViewController: UIViewController, PartyServiceManagerDelegate { if segue.identifier == "FriendListSegue" { let nav: UINavigationController = (segue.destinationViewController as? UINavigationController)! - let vc: FriendsListViewController = (nav.viewControllers[0] as? FriendsListViewController)! + let vc: FriendsListViewController = /*segue.destinationViewController as! FriendsListViewController */(nav.viewControllers[0] as? FriendsListViewController)! vc.setData(self.friendData, requst: self.requestData, party: self.partyData, user: self.userData) } } @@ -149,7 +156,23 @@ class HomeScreenViewController: UIViewController, PartyServiceManagerDelegate { */ } - +/* +extension HomeScreenViewController: UITabBarControllerDelegate { + func tabBarController(tabBarController: UITabBarController, didSelectViewController viewController: UIViewController) { + if viewController .isKindOfClass(SettingsTableViewController) { + + let vc: SettingsTableViewController = (viewController as? SettingsTableViewController)! + vc.setData(self.userData, prty: self.partyData, frends: self.friendData, request: self.requestData) + + }else if(viewController .isKindOfClass(FriendsListViewController)){ + + let vc: FriendsListViewController = (viewController as? FriendsListViewController)! + vc.setData(self.friendData, requst: self.requestData, party: self.partyData, user: self.userData) + + } + } +} +*/ extension HomeScreenViewController: PartyServiceManagerDelegate { func foundPeer() { if(self.firstTimeBrowsing == true){ diff --git a/GetHip/HomeTabController.swift b/GetHip/HomeTabController.swift new file mode 100644 index 0000000..761f006 --- /dev/null +++ b/GetHip/HomeTabController.swift @@ -0,0 +1,120 @@ +// +// HomeTabController.swift +// GetHip +// +// Created by Okechi on 4/2/16. +// Copyright (c) 2016 Kroleo. All rights reserved. +// + +import UIKit + +class HomeTabController: UITabBarController { + + var usrDataManager: UserParseDataSource! + var frndDataManager: FriendDataSource! + var friendData: [FriendData] = [] + var requestData: [FriendData] = [] + var userData: [UserParseData] = [] + let partyData = PartyServiceManager() + var firstTime: Bool = true + private var firstTimeBrowsing: Bool = true + //@IBOutlet weak var CreateAPartyBtn: UIButton! + + + //async data update methods + func refreshFriendData(notification:NSNotification){ + + let friendInfo = self.frndDataManager.getFriends() + + for pendingFriend in friendInfo { + if pendingFriend.status == "pending"{ + self.requestData.append(pendingFriend) + }else{ + self.friendData.append(pendingFriend) + } + } + + //start browsing for peers + self.partyData.setBrowser() + self.partyData.startBrowser() + + //self.partyData.delegate = self + self.firstTime = false + + + } + + func refreshUserData(notification:NSNotification){ + + self.userData = self.usrDataManager.getUser() + + if(self.firstTime == true){ + self.partyData.setPeerID((self.userData[0].displayName)) + self.partyData.initializeSession() + + //start peer-to-peer advertising + self.partyData.setAdvertiser() + self.partyData.startListening() + + //start browsing for peers + //self.partyData.setBrowser() + //self.partyData.startBrowser() + //self.firstTime = false + } + + self.frndDataManager = FriendDataSource() + } + + func loadID(notification: NSNotification){ + self.performSegueWithIdentifier("InviteFriendsSegue", sender: nil) + } + + + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + self.view.backgroundColor = UIColor.whiteColor() + //CreateAPartyBtn.layer.cornerRadius = 5 + //CreateAPartyBtn.layer.borderWidth = 1 + //self.tabBarController?.delegate = self + //self.navigationController?.navigationBarHidden = true + + NSNotificationCenter.defaultCenter().addObserver(self, selector: "loadID:", name: "gotDisplayID", object: nil) + + NSNotificationCenter.defaultCenter().addObserver(self, selector: "refreshFriendData:", name: "refreshTableView", object: nil) + + NSNotificationCenter.defaultCenter().addObserver(self, selector: "refreshUserData:", name: "refreshSettingsView", object: nil) + + self.userData = [] + self.friendData = [] + dispatch_async(dispatch_get_main_queue(), { + self.usrDataManager = UserParseDataSource() + //self.frndDataManager = FriendDataSource() + + }) + } + + override func viewWillAppear(animated: Bool) { + + + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + /* + // 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/Images-3.xcassets/Tab Icons/FriendsTab.imageset/Contents.json b/GetHip/Images-3.xcassets/Tab Icons/FriendsTab.imageset/Contents.json new file mode 100644 index 0000000..0d4643c --- /dev/null +++ b/GetHip/Images-3.xcassets/Tab Icons/FriendsTab.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "Friends@2x.png" + }, + { + "idiom" : "universal", + "scale" : "3x", + "filename" : "Friends@3x.png" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/GetHip/Images-3.xcassets/Tab Icons/FriendsTab.imageset/Friends@2x.png b/GetHip/Images-3.xcassets/Tab Icons/FriendsTab.imageset/Friends@2x.png new file mode 100644 index 0000000..4879246 Binary files /dev/null and b/GetHip/Images-3.xcassets/Tab Icons/FriendsTab.imageset/Friends@2x.png differ diff --git a/GetHip/Images-3.xcassets/Tab Icons/FriendsTab.imageset/Friends@3x.png b/GetHip/Images-3.xcassets/Tab Icons/FriendsTab.imageset/Friends@3x.png new file mode 100644 index 0000000..c9de051 Binary files /dev/null and b/GetHip/Images-3.xcassets/Tab Icons/FriendsTab.imageset/Friends@3x.png differ diff --git a/GetHip/Images-3.xcassets/Tab Icons/PartyTab.imageset/Contents.json b/GetHip/Images-3.xcassets/Tab Icons/PartyTab.imageset/Contents.json new file mode 100644 index 0000000..116ebdb --- /dev/null +++ b/GetHip/Images-3.xcassets/Tab Icons/PartyTab.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "Headphones@2x.png" + }, + { + "idiom" : "universal", + "scale" : "3x", + "filename" : "Headphones@3x.png" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/GetHip/Images-3.xcassets/Tab Icons/PartyTab.imageset/Headphones@2x.png b/GetHip/Images-3.xcassets/Tab Icons/PartyTab.imageset/Headphones@2x.png new file mode 100644 index 0000000..5ac67d6 Binary files /dev/null and b/GetHip/Images-3.xcassets/Tab Icons/PartyTab.imageset/Headphones@2x.png differ diff --git a/GetHip/Images-3.xcassets/Tab Icons/PartyTab.imageset/Headphones@3x.png b/GetHip/Images-3.xcassets/Tab Icons/PartyTab.imageset/Headphones@3x.png new file mode 100644 index 0000000..93b3d31 Binary files /dev/null and b/GetHip/Images-3.xcassets/Tab Icons/PartyTab.imageset/Headphones@3x.png differ diff --git a/GetHip/Images-3.xcassets/Tab Icons/SettingsTab.imageset/Contents.json b/GetHip/Images-3.xcassets/Tab Icons/SettingsTab.imageset/Contents.json new file mode 100644 index 0000000..159af7b --- /dev/null +++ b/GetHip/Images-3.xcassets/Tab Icons/SettingsTab.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "Settings@2x.png" + }, + { + "idiom" : "universal", + "scale" : "3x", + "filename" : "Settings@3x.png" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/GetHip/Images-3.xcassets/Tab Icons/SettingsTab.imageset/Settings@2x.png b/GetHip/Images-3.xcassets/Tab Icons/SettingsTab.imageset/Settings@2x.png new file mode 100644 index 0000000..f8ef590 Binary files /dev/null and b/GetHip/Images-3.xcassets/Tab Icons/SettingsTab.imageset/Settings@2x.png differ diff --git a/GetHip/Images-3.xcassets/Tab Icons/SettingsTab.imageset/Settings@3x.png b/GetHip/Images-3.xcassets/Tab Icons/SettingsTab.imageset/Settings@3x.png new file mode 100644 index 0000000..29afed1 Binary files /dev/null and b/GetHip/Images-3.xcassets/Tab Icons/SettingsTab.imageset/Settings@3x.png differ diff --git a/GetHip/Info.plist b/GetHip/Info.plist index 39b7897..70b8d19 100644 --- a/GetHip/Info.plist +++ b/GetHip/Info.plist @@ -35,7 +35,7 @@ CFBundleVersion - 2 + 3 FacebookAppID 1166375230058840 FacebookDisplayName diff --git a/GetHip/LoginController.swift b/GetHip/LoginController.swift index d7e9027..87fe011 100644 --- a/GetHip/LoginController.swift +++ b/GetHip/LoginController.swift @@ -19,7 +19,7 @@ class LoginController: UIViewController, PFLogInViewControllerDelegate, UITextFi @IBAction func loginBtnPressed(sender: UIButton){ //check if user logging in with email - if(contains(self.userEmailField.text!, "@")){ + if(contains(self.userEmailField.text!, "@") ){ let predicate: NSPredicate = NSPredicate(format: "(email = %@)", argumentArray: [self.userEmailField.text!]) var userQuery: PFQuery = PFQuery(className: "_User", predicate: predicate) @@ -32,10 +32,14 @@ class LoginController: UIViewController, PFLogInViewControllerDelegate, UITextFi PFUser.logInWithUsernameInBackground(object!.objectForKey("username") as! String, password: self.password.text!, block: { (user, error) -> Void in - if(user != nil){ - self.performSegueWithIdentifier("LoginToHomeSegue", sender: self) + if(user != nil || error == nil){ + //self.performSegueWithIdentifier("LoginToHomeSegue", sender: self) + let storyboard = UIStoryboard(name: "Main", bundle: nil) + let tabBarController = storyboard.instantiateViewControllerWithIdentifier("TabControllerVC") as! UITabBarController + let appDelegate = UIApplication.sharedApplication().delegate as! AppDelegate + appDelegate.window?.rootViewController = tabBarController }else{ - var alert = UIAlertController(title: "Invalid Login", message: "Your username/email or password is incorrect!", preferredStyle: .Alert) + var alert = UIAlertController(title: "Invalid Login", message: "Invalid email or password", 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) @@ -44,6 +48,10 @@ class LoginController: UIViewController, PFLogInViewControllerDelegate, UITextFi }) }) }else{ + let alert = UIAlertController(title: "Invalid Login", message: "Invalid email or password", 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) + /* PFUser.logInWithUsernameInBackground(userEmailField.text!, password: password.text!, block: { (user, error) -> Void in @@ -58,13 +66,13 @@ class LoginController: UIViewController, PFLogInViewControllerDelegate, UITextFi self.presentViewController(alert, animated: true, completion: nil) } }else{ - let alert = UIAlertController(title: "Network Error", message: error?.description, preferredStyle: .Alert) + let alert = UIAlertController(title: "Invalid Login", message: "Your username/email or password is incorrect!", 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) } - }) + })*/ } } @@ -73,7 +81,9 @@ class LoginController: UIViewController, PFLogInViewControllerDelegate, UITextFi self.performSegueWithIdentifier("signUpSegue", sender: self) } - + @IBAction func forgotPassBtn(sender: UIButton){ + self.performSegueWithIdentifier("ForgotPassSegue", sender: self) + } override func viewDidLoad() { super.viewDidLoad() @@ -85,6 +95,10 @@ class LoginController: UIViewController, PFLogInViewControllerDelegate, UITextFi presentLoggedInAlert() }*/ + let tapGesture = UITapGestureRecognizer(target: self, action: Selector("hideKeyboard")) + tapGesture.cancelsTouchesInView = true + self.view.addGestureRecognizer(tapGesture) + self.userEmailField.delegate = self self.password.delegate = self @@ -95,6 +109,10 @@ class LoginController: UIViewController, PFLogInViewControllerDelegate, UITextFi + } + + func hideKeyboard() { + self.view.endEditing(true) } override func didReceiveMemoryWarning() { diff --git a/GetHip/Main.storyboard b/GetHip/Main.storyboard index e4ea74b..18a2afd 100644 --- a/GetHip/Main.storyboard +++ b/GetHip/Main.storyboard @@ -1,5 +1,5 @@ - + @@ -11,7 +11,7 @@ - + @@ -72,6 +72,9 @@ + + + @@ -90,6 +93,7 @@ + @@ -110,6 +114,9 @@ + + + @@ -120,11 +127,12 @@ - + + @@ -140,48 +148,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + @@ -237,7 +262,8 @@ - + + @@ -245,11 +271,13 @@ + + @@ -293,7 +321,7 @@ - + @@ -501,17 +529,17 @@ - + - + - @@ -933,6 +982,7 @@ + @@ -943,6 +993,28 @@ + + + + + + + + + + + + + + + + + + + + + + @@ -960,7 +1032,7 @@ - + @@ -969,11 +1041,11 @@ - + - + @@ -1111,6 +1183,7 @@ + @@ -1132,10 +1205,11 @@ - + + @@ -1158,17 +1232,29 @@ - + - - + + + - + @@ -1176,7 +1262,7 @@ - + @@ -1191,14 +1277,14 @@ - + - - @@ -1738,18 +1812,6 @@ - - - - - - - + + + + + + + @@ -1832,11 +1906,11 @@ - + - + @@ -1978,7 +2052,7 @@ - +