NetworkRequiredAlert

This commit is contained in:
Chris Li 2016-09-15 15:43:21 -04:00
parent 66905eccd7
commit 265dcb9e66
4 changed files with 14 additions and 10 deletions

View File

@ -12,7 +12,6 @@ import Operations
class SpaceNotEnoughAlert: AlertOperation<UIViewController> {
init(context: UIViewController) {
super.init(presentAlertFrom: context)
title = LocalizedStrings.Library.spaceNotEnough
message = NSLocalizedString("Please free up some space and try again.", comment: "Library, Space Alert")
addActionWithTitle(LocalizedStrings.cancel)
@ -44,7 +43,16 @@ class RemoveBookConfirmationAlert: AlertOperation<UIViewController> {
let operation = RemoveBookOperation(bookID: bookID)
GlobalQueue.shared.addOperation(operation)
}
addActionWithTitle(LocalizedStrings.cancel)
addActionWithTitle(LocalizedStrings.ok)
preferredAction = actions[0]
}
}
class NetworkRequiredAlert: AlertOperation<UIViewController> {
init(context: UIViewController) {
super.init(presentAlertFrom: context)
title = NSLocalizedString("Network Required", comment: "Network Required Alert")
message = NSLocalizedString("Unable to connect to server. Please check your Internet connection.", comment: "Network Required Alert")
addActionWithTitle(LocalizedStrings.cancel)
}
}

View File

@ -133,12 +133,8 @@ class CloudBooksController: UITableViewController, NSFetchedResultsControllerDel
}
func showReachibilityAlert() {
let cancel = UIAlertAction(title: LocalizedStrings.Common.ok, style: .Cancel, handler: nil)
let alertController = UIAlertController(title: NSLocalizedString("Network Required", comment: "Network Required Alert"),
message: NSLocalizedString("Unable to connect to server. Please check your Internet connection.", comment: "Network Required Alert"),
preferredStyle: .Alert)
alertController.addAction(cancel)
self.presentViewController(alertController, animated: true, completion: nil)
let operation = NetworkRequiredAlert(context: self)
GlobalQueue.shared.addOperation(operation)
}
func showLanguageFilterAlert() {

View File

@ -49,7 +49,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.8.649</string>
<string>1.8.652</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSRequiresIPhoneOS</key>

View File

@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.8.652</string>
<string>1.8.655</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionMainStoryboard</key>