diff --git a/Yep.xcodeproj/project.pbxproj b/Yep.xcodeproj/project.pbxproj index 8b24c3fc..dab817cc 100644 --- a/Yep.xcodeproj/project.pbxproj +++ b/Yep.xcodeproj/project.pbxproj @@ -320,6 +320,7 @@ 50F5AF991BBBD02A0033C9BC /* FeedMediaCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50F5AF971BBBD02A0033C9BC /* FeedMediaCell.swift */; }; 50F5AF9A1BBBD02A0033C9BC /* FeedMediaCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 50F5AF981BBBD02A0033C9BC /* FeedMediaCell.xib */; }; 50FA9A441B661698009BF2A0 /* UIViewController+Yep.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50FA9A431B661698009BF2A0 /* UIViewController+Yep.swift */; }; + 50FD753D1C1FB4AC0050A382 /* FPSLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50FD753C1C1FB4AC0050A382 /* FPSLabel.swift */; }; 6A56328E1BC90A4500397B53 /* DiscoverCardUserCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A56328C1BC90A4500397B53 /* DiscoverCardUserCell.swift */; }; 6A56328F1BC90A4500397B53 /* DiscoverCardUserCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6A56328D1BC90A4500397B53 /* DiscoverCardUserCell.xib */; }; 6A5632931BC911CB00397B53 /* DiscoverNormalUserCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A5632911BC911CB00397B53 /* DiscoverNormalUserCell.swift */; }; @@ -678,6 +679,7 @@ 50F5AF971BBBD02A0033C9BC /* FeedMediaCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = FeedMediaCell.swift; path = Views/Cells/FeedMedia/FeedMediaCell.swift; sourceTree = ""; }; 50F5AF981BBBD02A0033C9BC /* FeedMediaCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = FeedMediaCell.xib; path = Views/Cells/FeedMedia/FeedMediaCell.xib; sourceTree = ""; }; 50FA9A431B661698009BF2A0 /* UIViewController+Yep.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "UIViewController+Yep.swift"; path = "Extensions/UIViewController+Yep.swift"; sourceTree = ""; }; + 50FD753C1C1FB4AC0050A382 /* FPSLabel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = FPSLabel.swift; path = Views/Labels/FPSLabel.swift; sourceTree = ""; }; 6A56328C1BC90A4500397B53 /* DiscoverCardUserCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = DiscoverCardUserCell.swift; path = Views/Cells/DiscoverCardUser/DiscoverCardUserCell.swift; sourceTree = ""; }; 6A56328D1BC90A4500397B53 /* DiscoverCardUserCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = DiscoverCardUserCell.xib; path = Views/Cells/DiscoverCardUser/DiscoverCardUserCell.xib; sourceTree = ""; }; 6A5632911BC911CB00397B53 /* DiscoverNormalUserCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = DiscoverNormalUserCell.swift; path = Views/Cells/DiscoverNormalUser/DiscoverNormalUserCell.swift; sourceTree = ""; }; @@ -2154,6 +2156,7 @@ isa = PBXGroup; children = ( 50F2B97A1B2EEAF800F840CC /* NavigationTitleLabel.swift */, + 50FD753C1C1FB4AC0050A382 /* FPSLabel.swift */, ); name = Labels; sourceTree = ""; @@ -2798,6 +2801,7 @@ 50F2B97B1B2EEAF800F840CC /* NavigationTitleLabel.swift in Sources */, 501690231BFEA6C30096C4F9 /* FeedBasicCell.swift in Sources */, 50A820241B969B0F007CD30E /* NSTimeZone+Yep.swift in Sources */, + 50FD753D1C1FB4AC0050A382 /* FPSLabel.swift in Sources */, 504F415A1AD5028200FBB19A /* SkillCell.swift in Sources */, 84385C481B85AC890071130D /* ShowStepMatchViewController.swift in Sources */, 0A0027D61B19CEC000AD4BE0 /* ConversationOperationQueue.swift in Sources */, diff --git a/Yep/Extensions/UIImageView+Yep.swift b/Yep/Extensions/UIImageView+Yep.swift index 8fba9f63..4d0db7ea 100644 --- a/Yep/Extensions/UIImageView+Yep.swift +++ b/Yep/Extensions/UIImageView+Yep.swift @@ -110,7 +110,7 @@ extension UIImageView { activityIndicator?.stopAnimating() - println("imageOfAttachment cacheType: \(cacheType)") + //println("imageOfAttachment cacheType: \(cacheType)") }) } } @@ -131,6 +131,15 @@ extension UIImageView { func yep_setImageOfLocation(location: CLLocation, withSize size: CGSize) { + let showActivityIndicatorWhenLoading = yep_showActivityIndicatorWhenLoading + var activityIndicator: UIActivityIndicatorView? = nil + + if showActivityIndicatorWhenLoading { + activityIndicator = yep_activityIndicator + activityIndicator?.hidden = false + activityIndicator?.startAnimating() + } + yep_setLocation(location) ImageCache.sharedInstance.mapImageOfLocationCoordinate(location.coordinate, withSize: size, completion: { [weak self] image in @@ -142,6 +151,8 @@ extension UIImageView { UIView.transitionWithView(strongSelf, duration: imageFadeTransitionDuration, options: .TransitionCrossDissolve, animations: { () -> Void in strongSelf.image = image }, completion: nil) + + activityIndicator?.stopAnimating() }) } } diff --git a/Yep/ViewControllers/Contacts/ContactsViewController.swift b/Yep/ViewControllers/Contacts/ContactsViewController.swift index 7144f3cd..13e3e3bf 100644 --- a/Yep/ViewControllers/Contacts/ContactsViewController.swift +++ b/Yep/ViewControllers/Contacts/ContactsViewController.swift @@ -15,7 +15,14 @@ class ContactsViewController: BaseViewController { @IBOutlet weak var contactsTableView: UITableView! @IBOutlet private weak var coverUnderStatusBarView: UIView! - + + #if DEBUG + private lazy var contactsFPSLabel: FPSLabel = { + let label = FPSLabel() + return label + }() + #endif + private var searchController: UISearchController? private var searchControllerIsActive: Bool { return searchController?.active ?? false @@ -112,6 +119,10 @@ class ContactsViewController: BaseViewController { self?.updateContactsTableView() } } + + #if DEBUG + view.addSubview(contactsFPSLabel) + #endif } // MARK: Actions diff --git a/Yep/ViewControllers/Conversation/ConversationViewController.swift b/Yep/ViewControllers/Conversation/ConversationViewController.swift index 7ce384c6..d5ff8e4b 100644 --- a/Yep/ViewControllers/Conversation/ConversationViewController.swift +++ b/Yep/ViewControllers/Conversation/ConversationViewController.swift @@ -540,6 +540,13 @@ class ConversationViewController: BaseViewController { return imagePicker }() + #if DEBUG + private lazy var conversationFPSLabel: FPSLabel = { + let label = FPSLabel() + return label + }() + #endif + private let chatSectionDateCellIdentifier = "ChatSectionDateCell" private let chatStateCellIdentifier = "ChatStateCell" private let chatLeftTextCellIdentifier = "ChatLeftTextCell" @@ -850,6 +857,10 @@ class ConversationViewController: BaseViewController { } }) } + + #if DEBUG + view.addSubview(conversationFPSLabel) + #endif } override func viewWillAppear(animated: Bool) { diff --git a/Yep/ViewControllers/Conversations/ConversationsViewController.swift b/Yep/ViewControllers/Conversations/ConversationsViewController.swift index 71642f11..cde3d9e7 100644 --- a/Yep/ViewControllers/Conversations/ConversationsViewController.swift +++ b/Yep/ViewControllers/Conversations/ConversationsViewController.swift @@ -53,6 +53,13 @@ class ConversationsViewController: UIViewController { } } + #if DEBUG + private lazy var conversationsFPSLabel: FPSLabel = { + let label = FPSLabel() + return label + }() + #endif + private lazy var conversations: Results = { let predicate = NSPredicate(format: "type = %d", ConversationType.OneToOne.rawValue) return self.realm.objects(Conversation).filter(predicate).sorted("updatedUnixTime", ascending: false) @@ -138,6 +145,10 @@ class ConversationsViewController: UIViewController { if PrivateResource.Location(.WhenInUse).isAuthorized { YepLocationService.turnOn() } + + #if DEBUG + view.addSubview(conversationsFPSLabel) + #endif } private func cacheInAdvance() { diff --git a/Yep/ViewControllers/Discover/DiscoverViewController.swift b/Yep/ViewControllers/Discover/DiscoverViewController.swift index 7cc5dc21..bcbf443d 100644 --- a/Yep/ViewControllers/Discover/DiscoverViewController.swift +++ b/Yep/ViewControllers/Discover/DiscoverViewController.swift @@ -69,6 +69,13 @@ class DiscoverViewController: BaseViewController { private lazy var filterView: DiscoverFilterView = DiscoverFilterView() + #if DEBUG + private lazy var discoverFPSLabel: FPSLabel = { + let label = FPSLabel() + return label + }() + #endif + override func viewDidLoad() { super.viewDidLoad() @@ -105,6 +112,10 @@ class DiscoverViewController: BaseViewController { activityIndicator.stopAnimating() } } + + #if DEBUG + view.addSubview(discoverFPSLabel) + #endif } // MARK: Actions diff --git a/Yep/ViewControllers/Feeds/FeedsViewController.swift b/Yep/ViewControllers/Feeds/FeedsViewController.swift index 4e6db7c8..7beab372 100644 --- a/Yep/ViewControllers/Feeds/FeedsViewController.swift +++ b/Yep/ViewControllers/Feeds/FeedsViewController.swift @@ -99,6 +99,13 @@ class FeedsViewController: BaseViewController { return pullToRefreshView }() + #if DEBUG + private lazy var feedsFPSLabel: FPSLabel = { + let label = FPSLabel() + return label + }() + #endif + private let feedSkillUsersCellID = "FeedSkillUsersCell" private let feedCellID = "FeedCell" private let feedSocialWorkCellID = "FeedSocialWorkCell" @@ -306,6 +313,10 @@ class FeedsViewController: BaseViewController { } } } + + #if DEBUG + view.addSubview(feedsFPSLabel) + #endif } // MARK: Actions diff --git a/Yep/ViewControllers/Profile/ProfileViewController.swift b/Yep/ViewControllers/Profile/ProfileViewController.swift index 19eb9268..3933e8af 100644 --- a/Yep/ViewControllers/Profile/ProfileViewController.swift +++ b/Yep/ViewControllers/Profile/ProfileViewController.swift @@ -358,6 +358,13 @@ class ProfileViewController: UIViewController { return share }() + #if DEBUG + private lazy var profileFPSLabel: FPSLabel = { + let label = FPSLabel() + return label + }() + #endif + private var statusBarShouldLight = false private var noNeedToChangeStatusBar = false @@ -784,6 +791,10 @@ class ProfileViewController: UIViewController { } } } + + #if DEBUG + view.addSubview(profileFPSLabel) + #endif } override func viewWillAppear(animated: Bool) { diff --git a/Yep/Views/Cells/Contacts/ContactsCell.xib b/Yep/Views/Cells/Contacts/ContactsCell.xib index f3f6d5bb..2ff4ce7c 100644 --- a/Yep/Views/Cells/Contacts/ContactsCell.xib +++ b/Yep/Views/Cells/Contacts/ContactsCell.xib @@ -1,8 +1,8 @@ - + - + @@ -12,49 +12,46 @@ - + - - - @@ -72,7 +69,6 @@ - diff --git a/Yep/Views/Cells/Conversation/ConversationCell.xib b/Yep/Views/Cells/Conversation/ConversationCell.xib index a9058849..45968c09 100644 --- a/Yep/Views/Cells/Conversation/ConversationCell.xib +++ b/Yep/Views/Cells/Conversation/ConversationCell.xib @@ -1,8 +1,8 @@ - + - + @@ -12,46 +12,44 @@ - + - - - @@ -79,7 +76,6 @@ - diff --git a/Yep/Views/Cells/DiscoverCardUser/DiscoverCardUserCell.swift b/Yep/Views/Cells/DiscoverCardUser/DiscoverCardUserCell.swift index c835b398..f9f8920a 100644 --- a/Yep/Views/Cells/DiscoverCardUser/DiscoverCardUserCell.swift +++ b/Yep/Views/Cells/DiscoverCardUser/DiscoverCardUserCell.swift @@ -33,7 +33,7 @@ class DiscoverCardUserCell: UICollectionViewCell { override func awakeFromNib() { super.awakeFromNib() - // Initialization code + contentView.backgroundColor = UIColor.whiteColor() contentView.layer.cornerRadius = 6 contentView.layer.masksToBounds = true @@ -44,7 +44,6 @@ class DiscoverCardUserCell: UICollectionViewCell { avatarImageView.contentMode = UIViewContentMode.ScaleAspectFill avatarImageView.clipsToBounds = true skillImageView.contentMode = UIViewContentMode.ScaleAspectFit - } override func prepareForReuse() { diff --git a/Yep/Views/Cells/DiscoverCardUser/DiscoverCardUserCell.xib b/Yep/Views/Cells/DiscoverCardUser/DiscoverCardUserCell.xib index ed20e009..c0d38671 100644 --- a/Yep/Views/Cells/DiscoverCardUser/DiscoverCardUserCell.xib +++ b/Yep/Views/Cells/DiscoverCardUser/DiscoverCardUserCell.xib @@ -1,8 +1,8 @@ - + - + @@ -13,17 +13,15 @@ - - - diff --git a/Yep/Views/Cells/DiscoverNormalUser/DiscoverNormalUserCell.xib b/Yep/Views/Cells/DiscoverNormalUser/DiscoverNormalUserCell.xib index c59dea9c..a1e12a9d 100644 --- a/Yep/Views/Cells/DiscoverNormalUser/DiscoverNormalUserCell.xib +++ b/Yep/Views/Cells/DiscoverNormalUser/DiscoverNormalUserCell.xib @@ -1,14 +1,14 @@ - + - + - + @@ -16,7 +16,6 @@ - @@ -24,38 +23,35 @@ - - - - diff --git a/Yep/Views/Cells/Feed/FeedCell.xib b/Yep/Views/Cells/Feed/FeedCell.xib index cf0a0fd1..be618af9 100644 --- a/Yep/Views/Cells/Feed/FeedCell.xib +++ b/Yep/Views/Cells/Feed/FeedCell.xib @@ -1,8 +1,8 @@ - + - + @@ -11,20 +11,19 @@ - + - - @@ -123,7 +122,6 @@ - diff --git a/Yep/Views/Cells/FeedConversationDock/FeedConversationDockCell.xib b/Yep/Views/Cells/FeedConversationDock/FeedConversationDockCell.xib index 20c4d7c7..32004d5c 100644 --- a/Yep/Views/Cells/FeedConversationDock/FeedConversationDockCell.xib +++ b/Yep/Views/Cells/FeedConversationDock/FeedConversationDockCell.xib @@ -1,8 +1,8 @@ - + - + @@ -22,14 +22,16 @@ - -