Skip to content

Commit

Permalink
pre-demo version completed!
Browse files Browse the repository at this point in the history
  • Loading branch information
csujedihy committed Apr 26, 2016
1 parent 6abe647 commit bf145f7
Show file tree
Hide file tree
Showing 10 changed files with 97 additions and 105 deletions.
4 changes: 0 additions & 4 deletions Dine.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
3B26AAC61CB5E463007A7F43 /* profileEditingController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B26AAC51CB5E463007A7F43 /* profileEditingController.swift */; };
3B26AACA1CB5F8F0007A7F43 /* DescriptionEditViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B26AAC91CB5F8F0007A7F43 /* DescriptionEditViewController.swift */; };
3B3901A91CC181F4004616E1 /* UserProfile.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3B3901A81CC181F4004616E1 /* UserProfile.storyboard */; };
3B3BDECC1CCC7C3B00D71936 /* LaunchScreenViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B3BDECB1CCC7C3B00D71936 /* LaunchScreenViewController.swift */; };
3B87EC291CA77D8D0045AF18 /* SearchFriendCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B87EC281CA77D8D0045AF18 /* SearchFriendCell.swift */; };
3BA5970B1CAC7E2500D0E6C7 /* ChatView.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3BA597091CAC7E2500D0E6C7 /* ChatView.storyboard */; };
3BA5970E1CAC7F1F00D0E6C7 /* MemberMessageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3BA5970C1CAC7F1F00D0E6C7 /* MemberMessageCell.swift */; };
Expand Down Expand Up @@ -103,7 +102,6 @@
3B26AAC51CB5E463007A7F43 /* profileEditingController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = profileEditingController.swift; sourceTree = "<group>"; };
3B26AAC91CB5F8F0007A7F43 /* DescriptionEditViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DescriptionEditViewController.swift; sourceTree = "<group>"; };
3B3901A81CC181F4004616E1 /* UserProfile.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = UserProfile.storyboard; sourceTree = "<group>"; };
3B3BDECB1CCC7C3B00D71936 /* LaunchScreenViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LaunchScreenViewController.swift; sourceTree = "<group>"; };
3B5BB70C1CA3881F003D2EB3 /* Dine-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Dine-Bridging-Header.h"; sourceTree = "<group>"; };
3B87EC281CA77D8D0045AF18 /* SearchFriendCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchFriendCell.swift; sourceTree = "<group>"; };
3BA5970A1CAC7E2500D0E6C7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/ChatView.storyboard; sourceTree = "<group>"; };
Expand Down Expand Up @@ -388,7 +386,6 @@
3BF4D2711CA73A1000126A91 /* AddFriendViewController.swift */,
3BAB2BA81CC0939400E201A2 /* UserProfileViewController.swift */,
3BFC5E331CC9CA8B0021F6CE /* DetailProfileViewController.swift */,
3B3BDECB1CCC7C3B00D71936 /* LaunchScreenViewController.swift */,
);
name = "View Controllers";
sourceTree = "<group>";
Expand Down Expand Up @@ -598,7 +595,6 @@
C12EB7DB1CA878AC004B80DF /* YYZAcceptButton.swift in Sources */,
C6EE094E1C97754A00345357 /* RestaurantDetailViewController.swift in Sources */,
C1F9785A1C97BDBF007CE2A3 /* ViewExt.swift in Sources */,
3B3BDECC1CCC7C3B00D71936 /* LaunchScreenViewController.swift in Sources */,
3BAB2BA91CC0939400E201A2 /* UserProfileViewController.swift in Sources */,
C127F5701CA3885700D40088 /* Message.swift in Sources */,
3B26AACA1CB5F8F0007A7F43 /* DescriptionEditViewController.swift in Sources */,
Expand Down
29 changes: 18 additions & 11 deletions Dine/ActivityProfileViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -149,16 +149,23 @@ class ActivityProfileViewController: UITableViewController{
if indexPath.section == 0 {
let cell = tableView.dequeueReusableCellWithIdentifier("profileCell") as! ActivityProfileCell

cell.activity = guardedActivity
print(Activity.current_activity)
cell.activity = guardedActivity
cell.checkButton.layer.cornerRadius = 5
cell.checkButton.layer.borderWidth = 1
cell.checkButton.layer.borderColor = UIColor.flatGrayColor().CGColor

cell.chatButton.layer.cornerRadius = 5
cell.chatButton.layer.borderWidth = 1
cell.chatButton.layer.borderColor = UIColor.flatGrayColor().CGColor

if Activity.current_activity == nil {
Log.info("Activity.current_activity == nil")
cell.checkButton.setImage(UIImage(named: "Checked"), forState: .Normal)
cell.checkButton.setImage(UIImage(named: "Checked"), forState: .Highlighted)
cell.checkButton.setTitle("Going", forState: .Normal)
cell.checkButton.setTitle("Going", forState: .Highlighted)
cell.checkButton.addTarget(self, action: #selector(ActivityProfileViewController.checkButtonClicked(_:)), forControlEvents: UIControlEvents.TouchDown)
} else if Activity.current_activity!.activityId == guardedActivityId {
cell.checkButton.setImage(UIImage(named: "Cancel"), forState: .Normal)
cell.checkButton.setImage(UIImage(named: "Cancel"), forState: .Highlighted)
cell.checkButton.setTitle("Cancel", forState: .Normal)
cell.checkButton.setTitle("Cancel", forState: .Highlighted)
cell.checkButton.addTarget(self, action: #selector(ActivityProfileViewController.checkButtonClicked(_:)), forControlEvents: UIControlEvents.TouchDown)
} else{
Log.error("should not reach here")
Expand Down Expand Up @@ -205,8 +212,8 @@ class ActivityProfileViewController: UITableViewController{

func checkButtonClicked (sender : UIButton!) {
if Activity.current_activity == nil {
sender.setImage(UIImage(named: "cancel"), forState: .Normal)
sender.setImage(UIImage(named: "cancel"), forState: .Highlighted)
sender.setTitle("Cancel", forState: .Normal)
sender.setTitle("Cancel", forState: .Highlighted)
Activity.current_activity = self.activity
self.activity?.joinActivity({
NSNotificationCenter.defaultCenter().postNotificationName("userJoinedNotification", object: nil)
Expand All @@ -223,16 +230,16 @@ class ActivityProfileViewController: UITableViewController{
})

} else {
sender.setImage(UIImage(named: "checked"), forState: .Normal)
sender.setImage(UIImage(named: "checked"), forState: .Highlighted)
sender.setTitle("Going", forState: .Normal)
sender.setTitle("Going", forState: .Highlighted)
NSNotificationCenter.defaultCenter().postNotificationName("userExitedNotification", object: nil)
}

}

override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
if indexPath.section == 0 {
return 95
return 130
}
return 45
}
Expand Down
21 changes: 21 additions & 0 deletions Dine/Assets.xcassets/lauchscreenbg.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "lauchscreenbg.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit bf145f7

Please sign in to comment.