mirror of
https://github.com/kiwix/kiwix-apple.git
synced 2025-09-26 13:29:31 -04:00
commit
This commit is contained in:
parent
0d4f09ec1d
commit
554cfdd293
@ -52,10 +52,9 @@ class DownloadTasksController: LibraryBaseController, UITableViewDelegate, UITab
|
||||
guard let navController = segue.destination as? UINavigationController,
|
||||
let bookDetailController = navController.topViewController as? BookDetailController,
|
||||
let cell = sender as? UITableViewCell,
|
||||
let indexPath = tableView.indexPath(for: cell),
|
||||
let downloadTask = fetchedResultController.object(at: indexPath) as? DownloadTask,
|
||||
let book = downloadTask.book else {return}
|
||||
bookDetailController.book = book
|
||||
let indexPath = tableView.indexPath(for: cell) else {return}
|
||||
let downloadTask = fetchedResultController.object(at: indexPath)
|
||||
bookDetailController.book = downloadTask.book
|
||||
default:
|
||||
break
|
||||
}
|
||||
|
@ -43,6 +43,8 @@ class Buttons: LPTBarButtonItemDelegate {
|
||||
delegate?.didLongPressBackButton()
|
||||
case forward:
|
||||
delegate?.didLongPressForwardButton()
|
||||
case bookmark:
|
||||
delegate?.didLongPressBookmarkButton()
|
||||
default:
|
||||
return
|
||||
}
|
||||
|
@ -54,8 +54,8 @@ class SearchBooksController: SearchBaseTableController, UITableViewDelegate, UIT
|
||||
// MARK: - Table Cell Delegate
|
||||
|
||||
func didTapOnAccessoryViewForCell(_ cell: UITableViewCell) {
|
||||
guard let indexPath = tableView.indexPath(for: cell),
|
||||
let book = fetchedResultController.object(at: indexPath) as? Book else {return}
|
||||
guard let indexPath = tableView.indexPath(for: cell) else {return}
|
||||
let book = fetchedResultController.object(at: indexPath)
|
||||
book.includeInSearch = !book.includeInSearch
|
||||
}
|
||||
|
||||
@ -77,8 +77,8 @@ class SearchBooksController: SearchBaseTableController, UITableViewDelegate, UIT
|
||||
}
|
||||
|
||||
func configureCell(_ cell: UITableViewCell, atIndexPath indexPath: IndexPath) {
|
||||
guard let book = fetchedResultController.object(at: indexPath) as? Book else {return}
|
||||
guard let cell = cell as? CheckMarkBookCell else {return}
|
||||
let book = fetchedResultController.object(at: indexPath)
|
||||
|
||||
cell.delegate = self
|
||||
cell.titleLabel.text = book.title
|
||||
@ -111,9 +111,9 @@ class SearchBooksController: SearchBaseTableController, UITableViewDelegate, UIT
|
||||
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
||||
tableView.deselectRow(at: indexPath, animated: true)
|
||||
|
||||
guard let book = fetchedResultController.object(at: indexPath) as? Book else {return}
|
||||
// let operation = ArticleLoadOperation(bookID: book.id)
|
||||
// GlobalQueue.shared.add(load: operation)
|
||||
let book = fetchedResultController.object(at: indexPath)
|
||||
let operation = ArticleLoadOperation(bookID: book.id)
|
||||
GlobalQueue.shared.add(articleLoadOperation: operation)
|
||||
}
|
||||
|
||||
// MARK: - Fetched Result Controller Delegate
|
||||
|
@ -49,7 +49,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.8.3265</string>
|
||||
<string>1.8.3277</string>
|
||||
<key>ITSAppUsesNonExemptEncryption</key>
|
||||
<false/>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
|
@ -21,7 +21,7 @@
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.8.3265</string>
|
||||
<string>1.8.3277</string>
|
||||
<key>NSExtension</key>
|
||||
<dict>
|
||||
<key>NSExtensionMainStoryboard</key>
|
||||
|
@ -123,3 +123,9 @@ extension UIDevice {
|
||||
}
|
||||
}
|
||||
|
||||
extension Collection {
|
||||
public subscript(safe index: Index) -> _Element? {
|
||||
return index >= startIndex && index < endIndex ? self[index] : nil
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user