diff --git a/Yep.xcodeproj/project.pbxproj b/Yep.xcodeproj/project.pbxproj index 936b8f8a..c0168585 100644 --- a/Yep.xcodeproj/project.pbxproj +++ b/Yep.xcodeproj/project.pbxproj @@ -43,6 +43,7 @@ 5008A1931B8DB8B500E94274 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 5008A1951B8DB8B500E94274 /* Localizable.strings */; }; 500A0B1C1B450C2100D49358 /* EditNicknameAndBadgeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 500A0B1B1B450C2100D49358 /* EditNicknameAndBadgeViewController.swift */; }; 500A0B1F1B451A6F00D49358 /* BadgeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 500A0B1E1B451A6F00D49358 /* BadgeView.swift */; }; + 500D35DF1C3A00D2006D17E3 /* SegueViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 500D35DE1C3A00D2006D17E3 /* SegueViewController.swift */; }; 500EED961BF06AC900C6BABC /* NSURL+Yep.swift in Sources */ = {isa = PBXBuildFile; fileRef = 500EED951BF06AC900C6BABC /* NSURL+Yep.swift */; }; 500EED981BF07A3000C6BABC /* ConversationViewController+Feed.swift in Sources */ = {isa = PBXBuildFile; fileRef = 500EED971BF07A3000C6BABC /* ConversationViewController+Feed.swift */; }; 500EED9A1BF1B81000C6BABC /* MediaPreviewViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 500EED991BF1B81000C6BABC /* MediaPreviewViewController.swift */; }; @@ -409,6 +410,7 @@ 5008A1961B8DB8E100E94274 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = ""; }; 500A0B1B1B450C2100D49358 /* EditNicknameAndBadgeViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = EditNicknameAndBadgeViewController.swift; path = ViewControllers/EditNicknameAndBadge/EditNicknameAndBadgeViewController.swift; sourceTree = ""; }; 500A0B1E1B451A6F00D49358 /* BadgeView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = BadgeView.swift; path = Views/Badge/BadgeView.swift; sourceTree = ""; }; + 500D35DE1C3A00D2006D17E3 /* SegueViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SegueViewController.swift; path = ViewControllers/Base/SegueViewController.swift; sourceTree = ""; }; 500EED951BF06AC900C6BABC /* NSURL+Yep.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "NSURL+Yep.swift"; path = "Extensions/NSURL+Yep.swift"; sourceTree = ""; }; 500EED971BF07A3000C6BABC /* ConversationViewController+Feed.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "ConversationViewController+Feed.swift"; path = "ViewControllers/Conversation/ConversationViewController+Feed.swift"; sourceTree = ""; }; 500EED991BF1B81000C6BABC /* MediaPreviewViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MediaPreviewViewController.swift; path = ViewControllers/MediaPreview/MediaPreviewViewController.swift; sourceTree = ""; }; @@ -897,6 +899,7 @@ 0A943A7C1B0F8EB10022DD67 /* Base */ = { isa = PBXGroup; children = ( + 500D35DE1C3A00D2006D17E3 /* SegueViewController.swift */, 0A943A7A1B0F8EAE0022DD67 /* BaseViewController.swift */, ); name = Base; @@ -2780,6 +2783,7 @@ 50B38FB71B69CD960064C132 /* Array+Yep.swift in Sources */, 5011382C1BCB5E150055A014 /* FeedConversationDockCell.swift in Sources */, 845E1A661B788EF3001E0789 /* EditSkillsViewController.swift in Sources */, + 500D35DF1C3A00D2006D17E3 /* SegueViewController.swift in Sources */, 50CC4FA41C1AC58700B6A263 /* UICollectionView+Yep.swift in Sources */, 504F85AC1B4D21DD00F909BE /* DiscoverFilterView.swift in Sources */, 0A271FD71ACA055400822DFC /* YepAudioService.swift in Sources */, diff --git a/Yep/ViewControllers/About/AboutViewController.swift b/Yep/ViewControllers/About/AboutViewController.swift index fca5564b..b9ec09e9 100644 --- a/Yep/ViewControllers/About/AboutViewController.swift +++ b/Yep/ViewControllers/About/AboutViewController.swift @@ -9,7 +9,7 @@ import UIKit import Ruler -class AboutViewController: UIViewController { +class AboutViewController: SegueViewController { @IBOutlet private weak var appLogoImageView: UIImageView! @IBOutlet private weak var appLogoImageViewTopConstraint: NSLayoutConstraint! @@ -53,17 +53,6 @@ class AboutViewController: UIViewController { aboutTableViewHeightConstraint.constant = rowHeight * CGFloat(aboutAnnotations.count) + 1 } - - // MARK: Navigation - - override func shouldPerformSegueWithIdentifier(identifier: String, sender: AnyObject?) -> Bool { - - guard navigationController?.topViewController == self else { - return false - } - - return true - } } // MARK: - UITableViewDataSource, UITableViewDelegate diff --git a/Yep/ViewControllers/AddFriends/AddFriendsViewController.swift b/Yep/ViewControllers/AddFriends/AddFriendsViewController.swift index 8b7f8b16..83548483 100644 --- a/Yep/ViewControllers/AddFriends/AddFriendsViewController.swift +++ b/Yep/ViewControllers/AddFriends/AddFriendsViewController.swift @@ -10,7 +10,7 @@ import UIKit import AddressBook import Proposer -class AddFriendsViewController: UIViewController { +class AddFriendsViewController: SegueViewController { @IBOutlet private weak var addFriendsTableView: UITableView! @@ -31,15 +31,6 @@ class AddFriendsViewController: UIViewController { // MARK: Navigation - override func shouldPerformSegueWithIdentifier(identifier: String, sender: AnyObject?) -> Bool { - - guard navigationController?.topViewController == self else { - return false - } - - return true - } - override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "showSearchedUsers" { if let searchText = sender as? String { diff --git a/Yep/ViewControllers/Base/BaseViewController.swift b/Yep/ViewControllers/Base/BaseViewController.swift index e47ccb58..9fd13f80 100644 --- a/Yep/ViewControllers/Base/BaseViewController.swift +++ b/Yep/ViewControllers/Base/BaseViewController.swift @@ -8,46 +8,40 @@ import UIKit -class BaseViewController: UIViewController { +class BaseViewController: SegueViewController { var animatedOnNavigationBar = true override func viewDidLoad() { super.viewDidLoad() - self.view.backgroundColor = UIColor.whiteColor() - - // Do any additional setup after loading the view. + view.backgroundColor = UIColor.whiteColor() } override func viewWillAppear(animated: Bool) { super.viewWillAppear(animated) - if let navigationController = navigationController { - - navigationController.navigationBar.backgroundColor = nil - navigationController.navigationBar.translucent = true - navigationController.navigationBar.shadowImage = nil - navigationController.navigationBar.barStyle = UIBarStyle.Default - navigationController.navigationBar.setBackgroundImage(nil, forBarMetrics: UIBarMetrics.Default) - - let textAttributes = [ - NSForegroundColorAttributeName: UIColor.yepNavgationBarTitleColor(), - NSFontAttributeName: UIFont.navigationBarTitleFont() - ] - - navigationController.navigationBar.titleTextAttributes = textAttributes - navigationController.navigationBar.tintColor = nil - } - - if let hidden = self.navigationController?.navigationBarHidden { - - if hidden { - self.navigationController?.setNavigationBarHidden(false, animated: animatedOnNavigationBar) - } - + guard let navigationController = navigationController else { + return } + navigationController.navigationBar.backgroundColor = nil + navigationController.navigationBar.translucent = true + navigationController.navigationBar.shadowImage = nil + navigationController.navigationBar.barStyle = UIBarStyle.Default + navigationController.navigationBar.setBackgroundImage(nil, forBarMetrics: UIBarMetrics.Default) + + let textAttributes = [ + NSForegroundColorAttributeName: UIColor.yepNavgationBarTitleColor(), + NSFontAttributeName: UIFont.navigationBarTitleFont() + ] + + navigationController.navigationBar.titleTextAttributes = textAttributes + navigationController.navigationBar.tintColor = nil + + if navigationController.navigationBarHidden { + navigationController.setNavigationBarHidden(false, animated: animatedOnNavigationBar) + } } } diff --git a/Yep/ViewControllers/Base/SegueViewController.swift b/Yep/ViewControllers/Base/SegueViewController.swift new file mode 100644 index 00000000..b67a302b --- /dev/null +++ b/Yep/ViewControllers/Base/SegueViewController.swift @@ -0,0 +1,23 @@ +// +// SegueViewController.swift +// Yep +// +// Created by nixzhu on 16/1/4. +// Copyright © 2016年 Catch Inc. All rights reserved. +// + +import UIKit + +class SegueViewController: UIViewController { + + override func performSegueWithIdentifier(identifier: String, sender: AnyObject?) { + + if let navigationController = navigationController { + guard navigationController.topViewController == self else { + return + } + } + + super.performSegueWithIdentifier(identifier, sender: sender) + } +} diff --git a/Yep/ViewControllers/Contacts/ContactsViewController.swift b/Yep/ViewControllers/Contacts/ContactsViewController.swift index 0f8884b9..e49e7acd 100644 --- a/Yep/ViewControllers/Contacts/ContactsViewController.swift +++ b/Yep/ViewControllers/Contacts/ContactsViewController.swift @@ -147,15 +147,6 @@ class ContactsViewController: BaseViewController { // MARK: Navigation - override func shouldPerformSegueWithIdentifier(identifier: String, sender: AnyObject?) -> Bool { - - guard navigationController?.topViewController == self else { - return false - } - - return true - } - override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "showProfile" { diff --git a/Yep/ViewControllers/Conversation/ConversationViewController.swift b/Yep/ViewControllers/Conversation/ConversationViewController.swift index 887243e5..c4d5630b 100644 --- a/Yep/ViewControllers/Conversation/ConversationViewController.swift +++ b/Yep/ViewControllers/Conversation/ConversationViewController.swift @@ -2820,15 +2820,6 @@ class ConversationViewController: BaseViewController { // MARK: Navigation - override func shouldPerformSegueWithIdentifier(identifier: String, sender: AnyObject?) -> Bool { - - guard navigationController?.topViewController == self else { - return false - } - - return true - } - override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { guard let identifier = segue.identifier else { diff --git a/Yep/ViewControllers/Conversations/ConversationsViewController.swift b/Yep/ViewControllers/Conversations/ConversationsViewController.swift index dbf15c22..7bb192fb 100644 --- a/Yep/ViewControllers/Conversations/ConversationsViewController.swift +++ b/Yep/ViewControllers/Conversations/ConversationsViewController.swift @@ -15,7 +15,7 @@ import Proposer let YepNotificationCommentAction = "YepNotificationCommentAction" let YepNotificationOKAction = "YepNotificationOKAction" -class ConversationsViewController: UIViewController { +class ConversationsViewController: SegueViewController { private lazy var activityIndicatorTitleView = ActivityIndicatorTitleView(frame: CGRect(x: 0, y: 0, width: 120, height: 30)) @@ -291,15 +291,6 @@ class ConversationsViewController: UIViewController { // MARK: Navigation - override func shouldPerformSegueWithIdentifier(identifier: String, sender: AnyObject?) -> Bool { - - guard navigationController?.topViewController == self else { - return false - } - - return true - } - override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "showConversation" { let vc = segue.destinationViewController as! ConversationViewController @@ -409,10 +400,6 @@ extension ConversationsViewController: UITableViewDataSource, UITableViewDelegat tableView.deselectRowAtIndexPath(indexPath, animated: true) } - guard navigationController?.topViewController == self else { - return - } - switch indexPath.section { case Section.FeedConversation.rawValue: diff --git a/Yep/ViewControllers/Discover/DiscoverViewController.swift b/Yep/ViewControllers/Discover/DiscoverViewController.swift index 5750c2a7..18520f81 100644 --- a/Yep/ViewControllers/Discover/DiscoverViewController.swift +++ b/Yep/ViewControllers/Discover/DiscoverViewController.swift @@ -230,18 +230,8 @@ class DiscoverViewController: BaseViewController { }) } - // MARK: - Navigation - override func shouldPerformSegueWithIdentifier(identifier: String, sender: AnyObject?) -> Bool { - - guard navigationController?.topViewController == self else { - return false - } - - return true - } - override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "showProfile" { diff --git a/Yep/ViewControllers/EditProfile/EditProfileViewController.swift b/Yep/ViewControllers/EditProfile/EditProfileViewController.swift index eabec4ce..d7807ca4 100644 --- a/Yep/ViewControllers/EditProfile/EditProfileViewController.swift +++ b/Yep/ViewControllers/EditProfile/EditProfileViewController.swift @@ -12,7 +12,7 @@ import TPKeyboardAvoiding import Proposer import Navi -class EditProfileViewController: UIViewController { +class EditProfileViewController: SegueViewController { struct Notification { static let Logout = "LogoutNotification" @@ -82,17 +82,6 @@ class EditProfileViewController: UIViewController { editProfileTableView.registerNib(UINib(nibName: editProfileColoredTitleCellIdentifier, bundle: nil), forCellReuseIdentifier: editProfileColoredTitleCellIdentifier) } - // MARK: Navigation - - override func shouldPerformSegueWithIdentifier(identifier: String, sender: AnyObject?) -> Bool { - - guard navigationController?.topViewController == self else { - return false - } - - return true - } - // MARK: Actions private func updateAvatar(completion:() -> Void) { diff --git a/Yep/ViewControllers/FeedConversations/FeedConversationsViewController.swift b/Yep/ViewControllers/FeedConversations/FeedConversationsViewController.swift index 2b3b53b4..4ed07b27 100644 --- a/Yep/ViewControllers/FeedConversations/FeedConversationsViewController.swift +++ b/Yep/ViewControllers/FeedConversations/FeedConversationsViewController.swift @@ -9,7 +9,7 @@ import UIKit import RealmSwift -class FeedConversationsViewController: UIViewController { +class FeedConversationsViewController: SegueViewController { @IBOutlet weak var feedConversationsTableView: UITableView! @@ -91,15 +91,6 @@ class FeedConversationsViewController: UIViewController { // MARK: Navigation - override func shouldPerformSegueWithIdentifier(identifier: String, sender: AnyObject?) -> Bool { - - guard navigationController?.topViewController == self else { - return false - } - - return true - } - override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "showConversation" { let vc = segue.destinationViewController as! ConversationViewController diff --git a/Yep/ViewControllers/Feeds/FeedsViewController.swift b/Yep/ViewControllers/Feeds/FeedsViewController.swift index 6f19c8a9..f68e1e84 100644 --- a/Yep/ViewControllers/Feeds/FeedsViewController.swift +++ b/Yep/ViewControllers/Feeds/FeedsViewController.swift @@ -624,15 +624,6 @@ class FeedsViewController: BaseViewController { // MARK: - Navigation - override func shouldPerformSegueWithIdentifier(identifier: String, sender: AnyObject?) -> Bool { - - guard navigationController?.topViewController == self else { - return false - } - - return true - } - override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { guard let identifier = segue.identifier else { diff --git a/Yep/ViewControllers/FriendsInContacts/FriendsInContactsViewController.swift b/Yep/ViewControllers/FriendsInContacts/FriendsInContactsViewController.swift index 225c738a..083e931c 100644 --- a/Yep/ViewControllers/FriendsInContacts/FriendsInContactsViewController.swift +++ b/Yep/ViewControllers/FriendsInContacts/FriendsInContactsViewController.swift @@ -104,15 +104,6 @@ class FriendsInContactsViewController: BaseViewController { // MARK: - Navigation - override func shouldPerformSegueWithIdentifier(identifier: String, sender: AnyObject?) -> Bool { - - guard navigationController?.topViewController == self else { - return false - } - - return true - } - override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "showProfile" { diff --git a/Yep/ViewControllers/Login/LoginByMobileViewController.swift b/Yep/ViewControllers/Login/LoginByMobileViewController.swift index 7a3536b3..0150eaf8 100644 --- a/Yep/ViewControllers/Login/LoginByMobileViewController.swift +++ b/Yep/ViewControllers/Login/LoginByMobileViewController.swift @@ -151,15 +151,6 @@ class LoginByMobileViewController: BaseViewController { // MARK: Navigation - override func shouldPerformSegueWithIdentifier(identifier: String, sender: AnyObject?) -> Bool { - - guard navigationController?.topViewController == self else { - return false - } - - return true - } - override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "showLoginVerifyMobile" { diff --git a/Yep/ViewControllers/NewFeed/NewFeedViewController.swift b/Yep/ViewControllers/NewFeed/NewFeedViewController.swift index 62841cc4..5cb0e38b 100644 --- a/Yep/ViewControllers/NewFeed/NewFeedViewController.swift +++ b/Yep/ViewControllers/NewFeed/NewFeedViewController.swift @@ -25,7 +25,7 @@ struct FeedVoice { let limitedSampleValues: [CGFloat] } -class NewFeedViewController: UIViewController { +class NewFeedViewController: SegueViewController { enum Attachment { case Default @@ -414,15 +414,6 @@ class NewFeedViewController: UIViewController { // MARK: Navigation - override func shouldPerformSegueWithIdentifier(identifier: String, sender: AnyObject?) -> Bool { - - guard navigationController?.topViewController == self else { - return false - } - - return true - } - override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "showPickPhotos" { diff --git a/Yep/ViewControllers/NewFeedVoiceRecord/NewFeedVoiceRecordViewController.swift b/Yep/ViewControllers/NewFeedVoiceRecord/NewFeedVoiceRecordViewController.swift index ca32efd4..8391ff1b 100644 --- a/Yep/ViewControllers/NewFeedVoiceRecord/NewFeedVoiceRecordViewController.swift +++ b/Yep/ViewControllers/NewFeedVoiceRecord/NewFeedVoiceRecordViewController.swift @@ -9,7 +9,7 @@ import UIKit import AVFoundation -class NewFeedVoiceRecordViewController: UIViewController { +class NewFeedVoiceRecordViewController: SegueViewController { var preparedSkill: Skill? @@ -411,15 +411,6 @@ class NewFeedVoiceRecordViewController: UIViewController { // MARK: - Navigation - override func shouldPerformSegueWithIdentifier(identifier: String, sender: AnyObject?) -> Bool { - - guard navigationController?.topViewController == self else { - return false - } - - return true - } - override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { guard let identifier = segue.identifier else { diff --git a/Yep/ViewControllers/Notifications/NotificationsViewController.swift b/Yep/ViewControllers/Notifications/NotificationsViewController.swift index e25869c3..440989fc 100644 --- a/Yep/ViewControllers/Notifications/NotificationsViewController.swift +++ b/Yep/ViewControllers/Notifications/NotificationsViewController.swift @@ -62,7 +62,7 @@ struct DoNotDisturbPeriod { } } -class NotificationsViewController: UIViewController { +class NotificationsViewController: SegueViewController { @IBOutlet private weak var tableView: UITableView! @@ -112,15 +112,6 @@ class NotificationsViewController: UIViewController { // MARK: Navigation - override func shouldPerformSegueWithIdentifier(identifier: String, sender: AnyObject?) -> Bool { - - guard navigationController?.topViewController == self else { - return false - } - - return true - } - override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "showDoNotDisturbPeriod" { diff --git a/Yep/ViewControllers/PickLocation/PickLocationViewController.swift b/Yep/ViewControllers/PickLocation/PickLocationViewController.swift index 6d9c752a..94f53be4 100644 --- a/Yep/ViewControllers/PickLocation/PickLocationViewController.swift +++ b/Yep/ViewControllers/PickLocation/PickLocationViewController.swift @@ -10,7 +10,7 @@ import UIKit import MapKit import Proposer -class PickLocationViewController: UIViewController { +class PickLocationViewController: SegueViewController { enum Purpose { case Message @@ -189,15 +189,6 @@ class PickLocationViewController: UIViewController { // MARK: Navigation - override func shouldPerformSegueWithIdentifier(identifier: String, sender: AnyObject?) -> Bool { - - guard navigationController?.topViewController == self else { - return false - } - - return true - } - override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { guard let identifier = segue.identifier else { diff --git a/Yep/ViewControllers/Profile/ProfileViewController.swift b/Yep/ViewControllers/Profile/ProfileViewController.swift index de5689a5..2e8f7c05 100644 --- a/Yep/ViewControllers/Profile/ProfileViewController.swift +++ b/Yep/ViewControllers/Profile/ProfileViewController.swift @@ -305,7 +305,7 @@ enum ProfileUser { } } -class ProfileViewController: UIViewController { +class ProfileViewController: SegueViewController { private var socialAccount: SocialAccount? @@ -1184,15 +1184,6 @@ class ProfileViewController: UIViewController { // MARK: Navigation - override func shouldPerformSegueWithIdentifier(identifier: String, sender: AnyObject?) -> Bool { - - guard navigationController?.topViewController == self else { - return false - } - - return true - } - override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { guard let identifier = segue.identifier else { diff --git a/Yep/ViewControllers/Register/RegisterPickAvatarViewController.swift b/Yep/ViewControllers/Register/RegisterPickAvatarViewController.swift index 087c4899..9b20c63b 100644 --- a/Yep/ViewControllers/Register/RegisterPickAvatarViewController.swift +++ b/Yep/ViewControllers/Register/RegisterPickAvatarViewController.swift @@ -11,7 +11,7 @@ import AVFoundation import Proposer import Navi -class RegisterPickAvatarViewController: UIViewController { +class RegisterPickAvatarViewController: SegueViewController { @IBOutlet private weak var avatarImageView: UIImageView! @IBOutlet private weak var cameraPreviewView: CameraPreviewView! @@ -141,22 +141,6 @@ class RegisterPickAvatarViewController: UIViewController { nextButton.enabled = false } - override func viewWillAppear(animated: Bool) { - super.viewWillAppear(animated) - - } - - // MARK: Navigation - - override func shouldPerformSegueWithIdentifier(identifier: String, sender: AnyObject?) -> Bool { - - guard navigationController?.topViewController == self else { - return false - } - - return true - } - // MARK: Helpers private func deviceWithMediaType(mediaType: String, preferringPosition position: AVCaptureDevicePosition) -> AVCaptureDevice? { diff --git a/Yep/ViewControllers/Register/RegisterPickMobileViewController.swift b/Yep/ViewControllers/Register/RegisterPickMobileViewController.swift index b004c40a..eac7cd9e 100644 --- a/Yep/ViewControllers/Register/RegisterPickMobileViewController.swift +++ b/Yep/ViewControllers/Register/RegisterPickMobileViewController.swift @@ -9,7 +9,7 @@ import UIKit import Ruler -class RegisterPickMobileViewController: UIViewController { +class RegisterPickMobileViewController: SegueViewController { @IBOutlet private weak var pickMobileNumberPromptLabel: UILabel! @IBOutlet private weak var pickMobileNumberPromptLabelTopConstraint: NSLayoutConstraint! @@ -170,15 +170,6 @@ class RegisterPickMobileViewController: UIViewController { // MARK: Navigation - override func shouldPerformSegueWithIdentifier(identifier: String, sender: AnyObject?) -> Bool { - - guard navigationController?.topViewController == self else { - return false - } - - return true - } - override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "showRegisterVerifyMobile" { diff --git a/Yep/ViewControllers/Register/RegisterPickNameViewController.swift b/Yep/ViewControllers/Register/RegisterPickNameViewController.swift index afea45fd..45d9d7f8 100644 --- a/Yep/ViewControllers/Register/RegisterPickNameViewController.swift +++ b/Yep/ViewControllers/Register/RegisterPickNameViewController.swift @@ -88,17 +88,6 @@ class RegisterPickNameViewController: BaseViewController { nameTextField.becomeFirstResponder() } - // MARK: Navigation - - override func shouldPerformSegueWithIdentifier(identifier: String, sender: AnyObject?) -> Bool { - - guard navigationController?.topViewController == self else { - return false - } - - return true - } - // MARK: Actions @objc private func tapTerms(sender: UITapGestureRecognizer) { diff --git a/Yep/ViewControllers/Register/RegisterPickSkillsViewController.swift b/Yep/ViewControllers/Register/RegisterPickSkillsViewController.swift index 3efb4111..a968a146 100644 --- a/Yep/ViewControllers/Register/RegisterPickSkillsViewController.swift +++ b/Yep/ViewControllers/Register/RegisterPickSkillsViewController.swift @@ -166,15 +166,6 @@ class RegisterPickSkillsViewController: BaseViewController { // MARK: Navigaition - override func shouldPerformSegueWithIdentifier(identifier: String, sender: AnyObject?) -> Bool { - - guard navigationController?.topViewController == self else { - return false - } - - return true - } - override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "presentSelectSkills" { diff --git a/Yep/ViewControllers/Register/RegisterVerifyMobileViewController.swift b/Yep/ViewControllers/Register/RegisterVerifyMobileViewController.swift index c3958830..7badecae 100644 --- a/Yep/ViewControllers/Register/RegisterVerifyMobileViewController.swift +++ b/Yep/ViewControllers/Register/RegisterVerifyMobileViewController.swift @@ -9,7 +9,7 @@ import UIKit import Ruler -class RegisterVerifyMobileViewController: UIViewController { +class RegisterVerifyMobileViewController: SegueViewController { var mobile: String! var areaCode: String! @@ -95,17 +95,6 @@ class RegisterVerifyMobileViewController: UIViewController { callMeTimer.fire() } - // MARK: Navigation - - override func shouldPerformSegueWithIdentifier(identifier: String, sender: AnyObject?) -> Bool { - - guard navigationController?.topViewController == self else { - return false - } - - return true - } - // MARK: Actions @objc private func activeAgain(notification: NSNotification) { diff --git a/Yep/ViewControllers/SearchedUsers/SearchedUsersViewController.swift b/Yep/ViewControllers/SearchedUsers/SearchedUsersViewController.swift index bfebcf3b..3ef803a4 100644 --- a/Yep/ViewControllers/SearchedUsers/SearchedUsersViewController.swift +++ b/Yep/ViewControllers/SearchedUsers/SearchedUsersViewController.swift @@ -66,15 +66,6 @@ class SearchedUsersViewController: BaseViewController { // MARK: Navigation - override func shouldPerformSegueWithIdentifier(identifier: String, sender: AnyObject?) -> Bool { - - guard navigationController?.topViewController == self else { - return false - } - - return true - } - override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "showProfile" { if let indexPath = sender as? NSIndexPath { diff --git a/Yep/ViewControllers/Settings/SettingsViewController.swift b/Yep/ViewControllers/Settings/SettingsViewController.swift index 8d214183..6af174a6 100644 --- a/Yep/ViewControllers/Settings/SettingsViewController.swift +++ b/Yep/ViewControllers/Settings/SettingsViewController.swift @@ -76,17 +76,6 @@ class SettingsViewController: BaseViewController { } } } - - // MARK: Navigation - - override func shouldPerformSegueWithIdentifier(identifier: String, sender: AnyObject?) -> Bool { - - guard navigationController?.topViewController == self else { - return false - } - - return true - } } extension SettingsViewController: UITableViewDataSource, UITableViewDelegate { diff --git a/Yep/ViewControllers/SkillHome/SkillHomeViewController.swift b/Yep/ViewControllers/SkillHome/SkillHomeViewController.swift index 07edfa77..777ca331 100644 --- a/Yep/ViewControllers/SkillHome/SkillHomeViewController.swift +++ b/Yep/ViewControllers/SkillHome/SkillHomeViewController.swift @@ -421,15 +421,6 @@ class SkillHomeViewController: BaseViewController { // MARK: - Navigation - override func shouldPerformSegueWithIdentifier(identifier: String, sender: AnyObject?) -> Bool { - - guard navigationController?.topViewController == self else { - return false - } - - return true - } - override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "showProfile" {