mirror of
https://github.com/kiwix/kiwix-apple.git
synced 2025-09-26 05:18:31 -04:00
Pull Down refresh ago string
This commit is contained in:
parent
8714e2cf7d
commit
7b10fdfea9
@ -262,7 +262,7 @@ class CloudBooksController: UITableViewController, NSFetchedResultsControllerDel
|
||||
class RefreshLibControl: UIRefreshControl {
|
||||
|
||||
static let pullDownToRefresh = NSLocalizedString("Pull Down To Refresh", comment: "Refresh Library Control")
|
||||
static let lastRefresh = NSLocalizedString("Last Refresh", comment: "Refresh Library Control")
|
||||
static let lastRefresh = NSLocalizedString("Last Refresh: %@ ago", comment: "Refresh Library Control")
|
||||
|
||||
override var hidden: Bool {
|
||||
didSet {
|
||||
@ -274,9 +274,12 @@ class RefreshLibControl: UIRefreshControl {
|
||||
private func updateTitle() {
|
||||
let string: String = {
|
||||
guard let lastRefreshTime = Preference.libraryLastRefreshTime else {return RefreshLibControl.pullDownToRefresh}
|
||||
let formatter = NSDateFormatter()
|
||||
formatter.dateFormat = "MMM d, h:mm a"
|
||||
return "Last Refresh" + ": " + formatter.stringFromDate(lastRefreshTime)
|
||||
let interval = lastRefreshTime.timeIntervalSinceNow * -1
|
||||
let formatter = NSDateComponentsFormatter()
|
||||
formatter.unitsStyle = .Abbreviated
|
||||
formatter.allowedUnits = [.Day, .Hour, .Minute]
|
||||
let string = formatter.stringFromTimeInterval(interval) ?? ""
|
||||
return String(format: RefreshLibControl.lastRefresh, string)
|
||||
}()
|
||||
let attributes = [NSForegroundColorAttributeName: UIColor.blackColor()]
|
||||
attributedTitle = NSAttributedString(string: string, attributes: attributes)
|
||||
|
@ -49,7 +49,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.7.1486</string>
|
||||
<string>1.7.1499</string>
|
||||
<key>ITSAppUsesNonExemptEncryption</key>
|
||||
<false/>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
|
@ -21,7 +21,7 @@
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.7.1839</string>
|
||||
<string>1.7.1856</string>
|
||||
<key>NSExtension</key>
|
||||
<dict>
|
||||
<key>NSExtensionMainStoryboard</key>
|
||||
|
Loading…
x
Reference in New Issue
Block a user