diff --git a/Yep/ViewControllers/SocialWorks/SocialWorkDribbbleViewController.swift b/Yep/ViewControllers/SocialWorks/SocialWorkDribbbleViewController.swift index 25dea74b..ad30fbaf 100644 --- a/Yep/ViewControllers/SocialWorks/SocialWorkDribbbleViewController.swift +++ b/Yep/ViewControllers/SocialWorks/SocialWorkDribbbleViewController.swift @@ -86,9 +86,11 @@ class SocialWorkDribbbleViewController: BaseViewController { if let userID = userID { - dribbbleWorkOfUserWithUserID(userID, failureHandler: { (reason, errorMessage) -> Void in + dribbbleWorkOfUserWithUserID(userID, failureHandler: { [weak self] (reason, errorMessage) -> Void in defaultFailureHandler(reason, errorMessage) + YepAlert.alertSorry(message: NSLocalizedString("Network is not good!", comment: ""), inViewController: self) + }, completion: { dribbbleWork in println("dribbbleWork: \(dribbbleWork.shots.count)") diff --git a/Yep/ViewControllers/SocialWorks/SocialWorkGithubViewController.swift b/Yep/ViewControllers/SocialWorks/SocialWorkGithubViewController.swift index 73f4da4d..7cba05a2 100644 --- a/Yep/ViewControllers/SocialWorks/SocialWorkGithubViewController.swift +++ b/Yep/ViewControllers/SocialWorks/SocialWorkGithubViewController.swift @@ -74,7 +74,7 @@ class SocialWorkGithubViewController: BaseViewController { navigationItem.titleView = accountImageView } else { - title = "Github" + title = "GitHub" } shareButton.enabled = false @@ -115,9 +115,11 @@ class SocialWorkGithubViewController: BaseViewController { if let userID = userID { - githubWorkOfUserWithUserID(userID, failureHandler: { (reason, errorMessage) -> Void in + githubWorkOfUserWithUserID(userID, failureHandler: { [weak self] (reason, errorMessage) -> Void in defaultFailureHandler(reason, errorMessage) + YepAlert.alertSorry(message: NSLocalizedString("Yep can't reach GitHub.\nWe blame GFW!", comment: ""), inViewController: self) + }, completion: { githubWork in println("githubWork: \(githubWork)") diff --git a/Yep/ViewControllers/SocialWorks/SocialWorkInstagramViewController.swift b/Yep/ViewControllers/SocialWorks/SocialWorkInstagramViewController.swift index 21706f13..1e8bb886 100644 --- a/Yep/ViewControllers/SocialWorks/SocialWorkInstagramViewController.swift +++ b/Yep/ViewControllers/SocialWorks/SocialWorkInstagramViewController.swift @@ -88,9 +88,11 @@ class SocialWorkInstagramViewController: BaseViewController { if let userID = userID { - instagramWorkOfUserWithUserID(userID, failureHandler: { (reason, errorMessage) -> Void in + instagramWorkOfUserWithUserID(userID, failureHandler: { [weak self] (reason, errorMessage) -> Void in defaultFailureHandler(reason, errorMessage) + YepAlert.alertSorry(message: NSLocalizedString("Network is not good!", comment: ""), inViewController: self) + }, completion: { instagramWork in println("instagramWork: \(instagramWork.medias.count)") diff --git a/Yep/en.lproj/Localizable.strings b/Yep/en.lproj/Localizable.strings index 7061da88..cb18ca42 100644 --- a/Yep/en.lproj/Localizable.strings +++ b/Yep/en.lproj/Localizable.strings @@ -542,3 +542,9 @@ /* No comment provided by engineer. */ "Version" = "Version"; + +/* No comment provided by engineer. */ +"Network is not good!" = "Network is not good!"; + +/* No comment provided by engineer. */ +"Yep can't reach GitHub.\nWe blame GFW!" = "Yep can't reach GitHub.\nWe blame GFW!"; diff --git a/Yep/zh-Hans.lproj/Localizable.strings b/Yep/zh-Hans.lproj/Localizable.strings index 0c8e497a..3d091154 100644 --- a/Yep/zh-Hans.lproj/Localizable.strings +++ b/Yep/zh-Hans.lproj/Localizable.strings @@ -544,3 +544,9 @@ /* No comment provided by engineer. */ "Version" = "版本"; + +/* No comment provided by engineer. */ +"Network is not good!" = "网络不太好!"; + +/* No comment provided by engineer. */ +"Yep can't reach GitHub.\nWe blame GFW!" = "Yep无法访问GitHub。\n一定是GFW从中做梗!";