Merge branch 'feature/push_check' into develop

This commit is contained in:
nixzhu
2015-12-14 15:52:01 +08:00
31 changed files with 303 additions and 31 deletions
@@ -53,6 +53,17 @@ 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
@@ -92,7 +103,10 @@ extension AboutViewController: UITableViewDataSource, UITableViewDelegate {
}
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
defer {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
}
switch indexPath.row {
case Row.Pods.rawValue:
@@ -31,6 +31,15 @@ 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 {
@@ -119,7 +128,10 @@ extension AddFriendsViewController: UITableViewDataSource, UITableViewDelegate {
}
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
defer {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
}
if indexPath.section == Section.More.rawValue {
@@ -49,15 +49,5 @@ class BaseViewController: UIViewController {
}
}
/*
// 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.
}
*/
}
@@ -136,7 +136,17 @@ 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" {
let vc = segue.destinationViewController as! ProfileViewController
@@ -201,7 +211,9 @@ extension ContactsViewController: UITableViewDataSource, UITableViewDelegate {
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
defer {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
}
if let friend = friendAtIndexPath(indexPath) {
@@ -2771,6 +2771,15 @@ 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 {
@@ -276,6 +276,17 @@ 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
@@ -380,7 +391,14 @@ extension ConversationsViewController: UITableViewDataSource, UITableViewDelegat
}
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
defer {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
}
guard navigationController?.topViewController == self else {
return
}
switch indexPath.section {
@@ -214,6 +214,15 @@ 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" {
@@ -82,6 +82,17 @@ 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) {
@@ -355,7 +366,9 @@ extension EditProfileViewController: UITableViewDataSource, UITableViewDelegate
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
defer {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
}
switch indexPath.section {
@@ -89,6 +89,15 @@ 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
@@ -161,7 +170,10 @@ extension FeedConversationsViewController: UITableViewDataSource, UITableViewDel
}
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
defer {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
}
if let cell = tableView.cellForRowAtIndexPath(indexPath) as? FeedConversationCell {
performSegueWithIdentifier("showConversation", sender: cell.conversation)
@@ -555,6 +555,15 @@ 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 {
@@ -1062,7 +1071,9 @@ extension FeedsViewController: UITableViewDataSource, UITableViewDelegate {
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
defer {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
}
switch indexPath.section {
@@ -104,6 +104,15 @@ 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" {
@@ -143,7 +152,10 @@ extension FriendsInContactsViewController: UITableViewDataSource, UITableViewDel
}
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
defer {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
}
performSegueWithIdentifier("showProfile", sender: indexPath)
}
@@ -151,6 +151,15 @@ 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" {
@@ -413,6 +413,15 @@ 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?) {
@@ -411,6 +411,15 @@ 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 {
@@ -112,6 +112,15 @@ 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" {
@@ -357,7 +366,10 @@ extension NotificationsViewController: UITableViewDataSource, UITableViewDelegat
}
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
defer {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
}
switch indexPath.section {
case 0:
@@ -189,6 +189,15 @@ 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 {
@@ -549,7 +558,9 @@ extension PickLocationViewController: UITableViewDataSource, UITableViewDelegate
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
defer {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
}
if let selectedLocationIndexPath = selectedLocationIndexPath {
if let cell = tableView.cellForRowAtIndexPath(selectedLocationIndexPath) as? PickLocationCell {
@@ -111,7 +111,10 @@ class PodsHelpYepViewController: UITableViewController {
}
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
defer {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
}
let pod = pods[indexPath.row]
@@ -1173,6 +1173,15 @@ 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 {
@@ -145,6 +145,17 @@ class RegisterPickAvatarViewController: UIViewController {
nextButton.enabled = false
}
// 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? {
@@ -165,11 +165,19 @@ 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" {
@@ -87,6 +87,17 @@ 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) {
@@ -166,6 +166,15 @@ 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" {
@@ -93,6 +93,17 @@ 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) {
@@ -66,6 +66,15 @@ 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 {
@@ -104,7 +113,10 @@ extension SearchedUsersViewController: UITableViewDataSource, UITableViewDelegat
}
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
defer {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
}
performSegueWithIdentifier("showProfile", sender: indexPath)
}
@@ -76,6 +76,17 @@ 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 {
@@ -141,7 +152,10 @@ extension SettingsViewController: UITableViewDataSource, UITableViewDelegate {
}
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
defer {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
}
switch indexPath.section {
@@ -420,6 +420,15 @@ 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?) {
@@ -638,7 +647,10 @@ extension SkillHomeViewController: UITableViewDelegate, UITableViewDataSource {
}
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
defer {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
}
switch indexPath.section {
@@ -225,7 +225,9 @@ extension SocialWorkGithubViewController: UITableViewDataSource, UITableViewDele
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
defer {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
}
let repo = githubRepos[indexPath.row]
@@ -529,7 +529,9 @@ extension ConversationMoreView: UITableViewDataSource, UITableViewDelegate {
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
defer {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
}
switch type {
case .OneToOne:
@@ -324,7 +324,9 @@ extension DiscoverFilterView: UITableViewDataSource, UITableViewDelegate {
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
defer {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
}
if let row = Row(rawValue: indexPath.row) {
@@ -267,7 +267,9 @@ extension MoreMessageTypesView: UITableViewDataSource, UITableViewDelegate {
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
defer {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
}
if let row = Row(rawValue: indexPath.row) {
switch row {
@@ -295,7 +295,9 @@ extension NewFeedTypesView: UITableViewDataSource, UITableViewDelegate {
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
defer {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
}
if let row = Row(rawValue: indexPath.row) {