diff --git a/Yep/ViewControllers/Profile/ProfileViewController.swift b/Yep/ViewControllers/Profile/ProfileViewController.swift index 8697ed8d..5923b016 100644 --- a/Yep/ViewControllers/Profile/ProfileViewController.swift +++ b/Yep/ViewControllers/Profile/ProfileViewController.swift @@ -200,16 +200,6 @@ class ProfileViewController: UIViewController { } } } -// else { -// introduction = YepUserDefaults.introduction.value -// -// YepUserDefaults.introduction.bindListener("Profile.introductionText") { introduction in -// if let introduction = introduction { -// self.introductionText = introduction -// self.updateProfileCollectionView() -// } -// } -// } return introduction ?? NSLocalizedString("No Introduction yet.", comment: "") }() @@ -372,11 +362,6 @@ class ProfileViewController: UIViewController { } } } -// else { -// YepUserDefaults.nickname.bindAndFireListener("ProfileViewController.Title") { nickname in -// self.customNavigationItem.title = nickname -// } -// } if let profileUser = profileUser { @@ -672,9 +657,6 @@ extension ProfileViewController: UICollectionViewDataSource, UICollectionViewDel } return 0 -// else { -// return masterSkills.count -// } case ProfileSection.Learning.rawValue: @@ -688,9 +670,6 @@ extension ProfileViewController: UICollectionViewDataSource, UICollectionViewDel } return 0 -// else { -// return learningSkills.count -// } case ProfileSection.Footer.rawValue: return 1 @@ -721,9 +700,6 @@ extension ProfileViewController: UICollectionViewDataSource, UICollectionViewDel cell.configureWithUser(user) } } -// else { -// cell.configureWithMyInfo() -// } return cell @@ -740,10 +716,6 @@ extension ProfileViewController: UICollectionViewDataSource, UICollectionViewDel cell.skillLabel.text = userSkill.localName } } -// else { -// let skill = masterSkills[indexPath.item] -// cell.skillLabel.text = skill.localName -// } return cell @@ -760,11 +732,6 @@ extension ProfileViewController: UICollectionViewDataSource, UICollectionViewDel cell.skillLabel.text = userSkill.localName } } -// else { -// let skill = learningSkills[indexPath.item] -// cell.skillLabel.text = skill.localName -// } - return cell @@ -817,8 +784,10 @@ extension ProfileViewController: UICollectionViewDataSource, UICollectionViewDel cell.configureWithProfileUser(profileUser, socialAccount: socialAccount, socialWork: socialWork, completion: { socialWork in switch socialWork { + case .Dribbble(let dribbbleWork): self.dribbbleWork = dribbbleWork + case .Instagram(let instagramWork): self.instagramWork = instagramWork } @@ -927,16 +896,15 @@ extension ProfileViewController: UICollectionViewDataSource, UICollectionViewDel if let profileUser = profileUser { switch profileUser { + case .DiscoveredUserType(let discoveredUser): skillLocalName = discoveredUser.masterSkills[indexPath.item].localName + case .UserType(let user): let userSkill = user.masterSkills[indexPath.item] skillLocalName = userSkill.localName } } -// else { -// skillLocalName = masterSkills[indexPath.item].localName -// } let rect = skillLocalName.boundingRectWithSize(CGSize(width: CGFloat(FLT_MAX), height: SkillCell.height), options: .UsesLineFragmentOrigin | .UsesFontLeading, attributes: skillTextAttributes, context: nil) @@ -947,16 +915,15 @@ extension ProfileViewController: UICollectionViewDataSource, UICollectionViewDel if let profileUser = profileUser { switch profileUser { + case .DiscoveredUserType(let discoveredUser): skillLocalName = discoveredUser.learningSkills[indexPath.item].localName + case .UserType(let user): let userSkill = user.learningSkills[indexPath.item] skillLocalName = userSkill.localName } } -// else { -// skillLocalName = learningSkills[indexPath.item].localName -// } let rect = skillLocalName.boundingRectWithSize(CGSize(width: CGFloat(FLT_MAX), height: SkillCell.height), options: .UsesLineFragmentOrigin | .UsesFontLeading, attributes: skillTextAttributes, context: nil) @@ -970,10 +937,12 @@ extension ProfileViewController: UICollectionViewDataSource, UICollectionViewDel if let profileUser = profileUser { switch profileUser { + case .DiscoveredUserType(let discoveredUser): enabled = discoveredUser.socialAccountProviders.filter({ socialAccountProvider in socialAccountProvider.enabled }).count > 0 + case .UserType(let user): if user.friendState != UserFriendState.Me.rawValue { enabled = user.socialAccountProviders.filter("enabled = true").count > 0 @@ -1036,47 +1005,8 @@ extension ProfileViewController: UICollectionViewDataSource, UICollectionViewDel } } } - -// let providerName = socialAccount.description.lowercaseString -// -// if let profileUser = profileUser { -// -// switch profileUser { -// -// case .DiscoveredUserType(let discoveredUser): -// for provider in discoveredUser.socialAccountProviders { -// if (provider.name == providerName) && provider.enabled { -// performSegueWithIdentifier("showSocialWork\(socialAccount)", sender: indexPath.item) -// -// break -// } -// } -// -// case .UserType(let user): -// for provider in user.socialAccountProviders { -// if (provider.name == providerName) && provider.enabled { -// performSegueWithIdentifier("showSocialWork\(socialAccount)", sender: indexPath.item) -// -// break -// } -// } -// -// } -// -// } else { -// if let enabled = socialWorkProviderInfo[providerName] { -// if enabled { -// performSegueWithIdentifier("showSocialWork\(socialAccount)", sender: indexPath.item) -// -// return -// } -// } -// -// performSegueWithIdentifier("presentOAuth", sender: indexPath.item) -// } } } - } } diff --git a/Yep/ViewControllers/SocialWorks/SocialWorkDribbbleViewController.swift b/Yep/ViewControllers/SocialWorks/SocialWorkDribbbleViewController.swift index 90982f07..edac1fad 100644 --- a/Yep/ViewControllers/SocialWorks/SocialWorkDribbbleViewController.swift +++ b/Yep/ViewControllers/SocialWorks/SocialWorkDribbbleViewController.swift @@ -75,9 +75,6 @@ class SocialWorkDribbbleViewController: BaseViewController { userID = user.userID } } -// else { -// userID = YepUserDefaults.userID.value -// } if let userID = userID { diff --git a/Yep/ViewControllers/SocialWorks/SocialWorkGithubViewController.swift b/Yep/ViewControllers/SocialWorks/SocialWorkGithubViewController.swift index 28c7b6c1..c5bd5451 100644 --- a/Yep/ViewControllers/SocialWorks/SocialWorkGithubViewController.swift +++ b/Yep/ViewControllers/SocialWorks/SocialWorkGithubViewController.swift @@ -102,9 +102,6 @@ class SocialWorkGithubViewController: BaseViewController { userID = user.userID } } -// else { -// userID = YepUserDefaults.userID.value -// } if let userID = userID { diff --git a/Yep/ViewControllers/SocialWorks/SocialWorkInstagramViewController.swift b/Yep/ViewControllers/SocialWorks/SocialWorkInstagramViewController.swift index 77285df8..d9b4baab 100644 --- a/Yep/ViewControllers/SocialWorks/SocialWorkInstagramViewController.swift +++ b/Yep/ViewControllers/SocialWorks/SocialWorkInstagramViewController.swift @@ -72,9 +72,6 @@ class SocialWorkInstagramViewController: BaseViewController { userID = user.userID } } -// else { -// userID = YepUserDefaults.userID.value -// } if let userID = userID { diff --git a/Yep/Views/Cells/ProfileSocialAccount/ProfileSocialAccountGithubCell.swift b/Yep/Views/Cells/ProfileSocialAccount/ProfileSocialAccountGithubCell.swift index b1804ac2..3d80f61d 100644 --- a/Yep/Views/Cells/ProfileSocialAccount/ProfileSocialAccountGithubCell.swift +++ b/Yep/Views/Cells/ProfileSocialAccount/ProfileSocialAccountGithubCell.swift @@ -78,47 +78,6 @@ class ProfileSocialAccountGithubCell: UICollectionViewCell { } } -// if let profileUser = profileUser { -// -// switch profileUser { -// -// case .DiscoveredUserType(let discoveredUser): -// for provider in discoveredUser.socialAccountProviders { -// if (provider.name == providerName) && provider.enabled { -// iconImageView.tintColor = socialAccount.tintColor -// nameLabel.textColor = socialAccount.tintColor -// -// accountEnabled = true -// -// break -// } -// } -// -// case .UserType(let user): -// for provider in user.socialAccountProviders { -// if (provider.name == providerName) && provider.enabled { -// iconImageView.tintColor = socialAccount.tintColor -// nameLabel.textColor = socialAccount.tintColor -// -// accountEnabled = true -// -// break -// } -// } -// } -// -// } else { -// if let enabled = socialWorkProviderInfo[providerName] { -// if enabled { -// iconImageView.tintColor = socialAccount.tintColor -// nameLabel.textColor = socialAccount.tintColor -// -// accountEnabled = true -// } -// } -// } - - if !accountEnabled { reposImageView.hidden = true reposCountLabel.text = "" @@ -142,9 +101,6 @@ class ProfileSocialAccountGithubCell: UICollectionViewCell { userID = user.userID } } -// else { -// userID = YepUserDefaults.userID.value -// } if let userID = userID { diff --git a/Yep/Views/Cells/ProfileSocialAccount/ProfileSocialAccountImagesCell.swift b/Yep/Views/Cells/ProfileSocialAccount/ProfileSocialAccountImagesCell.swift index dd4b2adc..b862c6b2 100644 --- a/Yep/Views/Cells/ProfileSocialAccount/ProfileSocialAccountImagesCell.swift +++ b/Yep/Views/Cells/ProfileSocialAccount/ProfileSocialAccountImagesCell.swift @@ -120,46 +120,6 @@ class ProfileSocialAccountImagesCell: UICollectionViewCell { } } -// if let profileUser = profileUser { -// -// switch profileUser { -// -// case .DiscoveredUserType(let discoveredUser): -// for provider in discoveredUser.socialAccountProviders { -// if (provider.name == providerName) && provider.enabled { -// iconImageView.tintColor = socialAccount.tintColor -// nameLabel.textColor = socialAccount.tintColor -// -// accountEnabled = true -// -// break -// } -// } -// -// case .UserType(let user): -// for provider in user.socialAccountProviders { -// if (provider.name == providerName) && provider.enabled { -// iconImageView.tintColor = socialAccount.tintColor -// nameLabel.textColor = socialAccount.tintColor -// -// accountEnabled = true -// -// break -// } -// } -// } -// -// } else { -// if let enabled = socialWorkProviderInfo[providerName] { -// if enabled { -// iconImageView.tintColor = socialAccount.tintColor -// nameLabel.textColor = socialAccount.tintColor -// -// accountEnabled = true -// } -// } -// } - if !accountEnabled { imageView1.image = nil imageView2.image = nil @@ -182,9 +142,6 @@ class ProfileSocialAccountImagesCell: UICollectionViewCell { userID = user.userID } } -// else { -// userID = YepUserDefaults.userID.value -// } if let userID = userID {