diff --git a/Kiwix-iOS/Controller/Library/BookDetailController.swift b/Kiwix-iOS/Controller/Library/BookDetailController.swift
index a300e1a8..d0dd0a19 100644
--- a/Kiwix-iOS/Controller/Library/BookDetailController.swift
+++ b/Kiwix-iOS/Controller/Library/BookDetailController.swift
@@ -30,6 +30,8 @@ class BookDetailController: UITableViewController, CenterButtonCellDelegate, DZN
tableView.emptyDataSetSource = self
tableView.emptyDataSetDelegate = self
tableView.tableFooterView = UIView()
+ tableView.estimatedRowHeight = 44.0
+ tableView.rowHeight = UITableViewAutomaticDimension
hasPicIndicator.layer.cornerRadius = 2.0
hasIndexIndicator.layer.cornerRadius = 2.0
@@ -70,11 +72,14 @@ class BookDetailController: UITableViewController, CenterButtonCellDelegate, DZN
cellTitles.append([Strings.remove])
}
cellTitles.append([Strings.size, Strings.createDate, Strings.arcitleCount, Strings.language, Strings.creator, Strings.publisher])
+
+ if let _ = book.url { cellTitles.append([Strings.copyURL]) }
}
// MARK: - Delegates
func buttonTapped(cell: CenterButtonCell) {
+
guard let title = cell.button.titleLabel?.text,
let book = book else {return}
@@ -96,7 +101,13 @@ class BookDetailController: UITableViewController, CenterButtonCellDelegate, DZN
} else {
startDownload()
}
- default:
+ case Strings.copyURL:
+ guard let url = book.url else {return}
+ UIPasteboard.generalPasteboard().string = url.absoluteString
+ let action = UIAlertAction(title: LocalizedStrings.Common.ok, style: .Cancel, handler: nil)
+ let alert = UIAlertController(title: Strings.CopyURLAlert.succeed, message: "", actions: [action])
+ presentViewController(alert, animated: true, completion: nil)
+ default:
return
}
}
@@ -128,6 +139,11 @@ class BookDetailController: UITableViewController, CenterButtonCellDelegate, DZN
if book?.spaceState == .Caution { cell.button.tintColor = UIColor.orangeColor() }
}
return cell
+ case Strings.copyURL:
+ let cell = tableView.dequeueReusableCellWithIdentifier("CenterButtonCell", forIndexPath: indexPath) as! CenterButtonCell
+ cell.button.setTitle(title, forState: .Normal)
+ cell.delegate = self
+ return cell
default:
let cell = tableView.dequeueReusableCellWithIdentifier("RightDetailCell", forIndexPath: indexPath)
cell.textLabel?.text = title
@@ -148,13 +164,7 @@ class BookDetailController: UITableViewController, CenterButtonCellDelegate, DZN
break
}
return cell
-}
-
-// case (0,2):
-// let cell = tableView.dequeueReusableCellWithIdentifier("TextSwitchCell", forIndexPath: indexPath) as! TextSwitchCell
-// cell.titleLabel.text = NSLocalizedString("Updates Automatically", comment: LocalizedStrings.BookDetail.comment)
-// return cell
-
+ }
}
override func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
@@ -207,6 +217,13 @@ extension LocalizedStrings {
static let creator = NSLocalizedString("Creator", comment: comment)
static let publisher = NSLocalizedString("Publisher", comment: comment)
+ static let copyURL = NSLocalizedString("Copy URL", comment: comment)
+
+ class CopyURLAlert {
+ private static let comment = "Library, Book Detail, Copy URL Alert"
+ static let succeed = NSLocalizedString("URL Copied Successfully", comment: comment)
+ }
+
class SpaceAlert {
private static let comment = "Library, Book Detail, Space Alert"
static let downloadAnyway = NSLocalizedString("Download Anyway", comment: comment)
diff --git a/Kiwix-iOS/Info.plist b/Kiwix-iOS/Info.plist
index 056d09e2..5330bb9c 100644
--- a/Kiwix-iOS/Info.plist
+++ b/Kiwix-iOS/Info.plist
@@ -49,7 +49,7 @@
CFBundleVersion
- 1.7.1576
+ 1.7.1591
ITSAppUsesNonExemptEncryption
LSRequiresIPhoneOS
diff --git a/Kiwix-iOS/Storyboard/Library.storyboard b/Kiwix-iOS/Storyboard/Library.storyboard
index 66ed8390..649b907e 100644
--- a/Kiwix-iOS/Storyboard/Library.storyboard
+++ b/Kiwix-iOS/Storyboard/Library.storyboard
@@ -219,7 +219,7 @@
-
+
@@ -243,13 +243,16 @@
-
+
-
+
-
+
@@ -294,23 +297,6 @@
-
-
-
-
-
-
-
-
-
-
-
@@ -699,6 +685,6 @@
-
+
diff --git a/Kiwix-iOSWidgets/Bookmarks/Info.plist b/Kiwix-iOSWidgets/Bookmarks/Info.plist
index 445f4b63..c51e9cd9 100644
--- a/Kiwix-iOSWidgets/Bookmarks/Info.plist
+++ b/Kiwix-iOSWidgets/Bookmarks/Info.plist
@@ -21,7 +21,7 @@
CFBundleSignature
????
CFBundleVersion
- 1.7.1983
+ 1.7.2010
NSExtension
NSExtensionMainStoryboard
diff --git a/Kiwix/Tools/StringTools.swift b/Kiwix/Tools/StringTools.swift
index e3adebab..b7cee87b 100644
--- a/Kiwix/Tools/StringTools.swift
+++ b/Kiwix/Tools/StringTools.swift
@@ -72,7 +72,8 @@ class LocalizedStrings {
class Common {
private static let comment = "Common"
- static let cancel = "Cancel"
+ static let cancel = NSLocalizedString("Cancel", comment: "Basic")
+ static let ok = NSLocalizedString("OK", comment: "Basic")
}
class LibraryTabTitle {