mirror of
https://github.com/kiwix/kiwix-apple.git
synced 2025-09-28 14:35:03 -04:00
fix warnings
This commit is contained in:
parent
61218ada6d
commit
0758d73cb3
@ -73,9 +73,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func application(_ application: UIApplication, didRegister notificationSettings: UIUserNotificationSettings) {
|
// func application(_ application: UIApplication, didRegister notificationSettings: UIUserNotificationSettings) {
|
||||||
// Here we get what notification permission user currently allows
|
// // Here we get what notification permission user currently allows
|
||||||
}
|
// }
|
||||||
|
|
||||||
func applicationWillTerminate(_ application: UIApplication) {
|
func applicationWillTerminate(_ application: UIApplication) {
|
||||||
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
|
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
|
||||||
|
@ -80,7 +80,7 @@ class CloudBooksController: LibraryBaseController, UITableViewDelegate, UITableV
|
|||||||
|
|
||||||
func showLanguageFilterController() {
|
func showLanguageFilterController() {
|
||||||
guard let splitViewController = splitViewController as? LibrarySplitViewController, !splitViewController.isShowingLangFilter else {return}
|
guard let splitViewController = splitViewController as? LibrarySplitViewController, !splitViewController.isShowingLangFilter else {return}
|
||||||
guard let controller = UIStoryboard.library.initViewController(LanguageFilterController.self) else {return}
|
let controller = UIStoryboard(name: "library", bundle: nil).instantiateViewController(withIdentifier: "LanguageFilterController") as! LanguageFilterController
|
||||||
controller.delegate = self
|
controller.delegate = self
|
||||||
let navController = UINavigationController(rootViewController: controller)
|
let navController = UINavigationController(rootViewController: controller)
|
||||||
showDetailViewController(navController, sender: self)
|
showDetailViewController(navController, sender: self)
|
||||||
@ -116,7 +116,7 @@ class CloudBooksController: LibraryBaseController, UITableViewDelegate, UITableV
|
|||||||
self.tableView.reloadEmptyDataSet()
|
self.tableView.reloadEmptyDataSet()
|
||||||
}
|
}
|
||||||
|
|
||||||
if let error = errors.first {
|
if let _ = errors.first {
|
||||||
// handle error [network, xmlparse]
|
// handle error [network, xmlparse]
|
||||||
} else {
|
} else {
|
||||||
if operation.firstTime {
|
if operation.firstTime {
|
||||||
@ -307,15 +307,16 @@ class CloudBooksController: LibraryBaseController, UITableViewDelegate, UITableV
|
|||||||
fetchRequest.sortDescriptors = [langDescriptor, titleDescriptor]
|
fetchRequest.sortDescriptors = [langDescriptor, titleDescriptor]
|
||||||
fetchRequest.predicate = self.onlineCompoundPredicate
|
fetchRequest.predicate = self.onlineCompoundPredicate
|
||||||
|
|
||||||
let fetchedResultsController = NSFetchedResultsController(fetchRequest: fetchRequest, managedObjectContext: self.managedObjectContext, sectionNameKeyPath: "language.name", cacheName: "OnlineFRC" + Bundle.buildVersion)
|
let controller = NSFetchedResultsController(fetchRequest: fetchRequest, managedObjectContext: self.managedObjectContext, sectionNameKeyPath: "language.name", cacheName: "OnlineFRC" + Bundle.buildVersion)
|
||||||
fetchedResultsController.delegate = self
|
controller.delegate = self
|
||||||
fetchedResultsController.performFetch(deleteCache: false)
|
try? controller.performFetch()
|
||||||
return fetchedResultsController as! NSFetchedResultsController<Book>
|
return controller as! NSFetchedResultsController<Book>
|
||||||
}()
|
}()
|
||||||
|
|
||||||
func refreshFetchedResultController() {
|
func refreshFetchedResultController() {
|
||||||
fetchedResultController.fetchRequest.predicate = onlineCompoundPredicate
|
fetchedResultController.fetchRequest.predicate = onlineCompoundPredicate
|
||||||
fetchedResultController.performFetch(deleteCache: true)
|
NSFetchedResultsController<Book>.deleteCache(withName: fetchedResultController.cacheName)
|
||||||
|
try? fetchedResultController.performFetch()
|
||||||
tableView.reloadData()
|
tableView.reloadData()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,8 +101,8 @@ class DownloadTasksController: LibraryBaseController, UITableViewDelegate, UITab
|
|||||||
}
|
}
|
||||||
|
|
||||||
override func configureCell(_ cell: UITableViewCell, atIndexPath indexPath: IndexPath) {
|
override func configureCell(_ cell: UITableViewCell, atIndexPath indexPath: IndexPath) {
|
||||||
guard let downloadTask = fetchedResultController.object(at: indexPath) as? DownloadTask,
|
let downloadTask = fetchedResultController.object(at: indexPath)
|
||||||
let book = downloadTask.book,
|
guard let book = downloadTask.book,
|
||||||
let cell = cell as? DownloadBookCell else {return}
|
let cell = cell as? DownloadBookCell else {return}
|
||||||
|
|
||||||
cell.titleLabel.text = book.title
|
cell.titleLabel.text = book.title
|
||||||
@ -248,10 +248,10 @@ class DownloadTasksController: LibraryBaseController, UITableViewDelegate, UITab
|
|||||||
let creationTimeDescriptor = NSSortDescriptor(key: "creationTime", ascending: true)
|
let creationTimeDescriptor = NSSortDescriptor(key: "creationTime", ascending: true)
|
||||||
fetchRequest.sortDescriptors = [creationTimeDescriptor]
|
fetchRequest.sortDescriptors = [creationTimeDescriptor]
|
||||||
|
|
||||||
let fetchedResultsController = NSFetchedResultsController(fetchRequest: fetchRequest, managedObjectContext: self.managedObjectContext, sectionNameKeyPath: nil, cacheName: "DownloadFRC" + Bundle.buildVersion)
|
let controller = NSFetchedResultsController(fetchRequest: fetchRequest, managedObjectContext: self.managedObjectContext, sectionNameKeyPath: nil, cacheName: "DownloadFRC" + Bundle.buildVersion)
|
||||||
fetchedResultsController.delegate = self
|
controller.delegate = self
|
||||||
fetchedResultsController.performFetch(deleteCache: false)
|
try? controller.performFetch()
|
||||||
return fetchedResultsController as! NSFetchedResultsController<DownloadTask>
|
return controller as! NSFetchedResultsController<DownloadTask>
|
||||||
}()
|
}()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,7 @@ class LocalBooksController: LibraryBaseController, UITableViewDelegate, UITableV
|
|||||||
fetchRequest.predicate = NSPredicate(format: "stateRaw >= 2")
|
fetchRequest.predicate = NSPredicate(format: "stateRaw >= 2")
|
||||||
let fetchedResultsController = NSFetchedResultsController(fetchRequest: fetchRequest, managedObjectContext: self.managedObjectContext, sectionNameKeyPath: "stateRaw", cacheName: "LocalFRC" + Bundle.buildVersion)
|
let fetchedResultsController = NSFetchedResultsController(fetchRequest: fetchRequest, managedObjectContext: self.managedObjectContext, sectionNameKeyPath: "stateRaw", cacheName: "LocalFRC" + Bundle.buildVersion)
|
||||||
fetchedResultsController.delegate = self
|
fetchedResultsController.delegate = self
|
||||||
fetchedResultsController.performFetch(deleteCache: false)
|
try? fetchedResultsController.performFetch()
|
||||||
return fetchedResultsController as! NSFetchedResultsController<Book>
|
return fetchedResultsController as! NSFetchedResultsController<Book>
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
@ -71,5 +71,4 @@ class MainController: UIViewController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -10,26 +10,7 @@ import UIKit
|
|||||||
|
|
||||||
class WelcomeController: UIViewController {
|
class WelcomeController: UIViewController {
|
||||||
|
|
||||||
override func viewDidLoad() {
|
// place holder for adding stuff like resume last read, suggestions in welcome screen
|
||||||
super.viewDidLoad()
|
// maybe this class one day will become tabs controller
|
||||||
|
|
||||||
// Do any additional setup after loading the view.
|
|
||||||
}
|
|
||||||
|
|
||||||
override func didReceiveMemoryWarning() {
|
|
||||||
super.didReceiveMemoryWarning()
|
|
||||||
// Dispose of any resources that can be recreated.
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
// MARK: - Navigation
|
|
||||||
|
|
||||||
// In a storyboard-based application, you will often want to do a little preparation before navigation
|
|
||||||
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
|
|
||||||
// Get the new view controller using segue.destinationViewController.
|
|
||||||
// Pass the selected object to the new view controller.
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -36,21 +36,6 @@ class SearchBooksController: SearchBaseTableController, UITableViewDelegate, UIT
|
|||||||
recentSearchContainer.setNeedsDisplay()
|
recentSearchContainer.setNeedsDisplay()
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Fetched Results Controller
|
|
||||||
|
|
||||||
let managedObjectContext = AppDelegate.persistentContainer.viewContext
|
|
||||||
lazy var fetchedResultController: NSFetchedResultsController<Book> = {
|
|
||||||
let fetchRequest = Book.fetchRequest()
|
|
||||||
let langDescriptor = NSSortDescriptor(key: "language.name", ascending: true)
|
|
||||||
let titleDescriptor = NSSortDescriptor(key: "title", ascending: true)
|
|
||||||
fetchRequest.sortDescriptors = [langDescriptor, titleDescriptor]
|
|
||||||
fetchRequest.predicate = NSPredicate(format: "stateRaw == 2")
|
|
||||||
let fetchedResultsController = NSFetchedResultsController(fetchRequest: fetchRequest, managedObjectContext: self.managedObjectContext, sectionNameKeyPath: nil, cacheName: "ScopeFRC" + Bundle.buildVersion)
|
|
||||||
fetchedResultsController.delegate = self
|
|
||||||
fetchedResultsController.performFetch(deleteCache: false)
|
|
||||||
return fetchedResultsController as! NSFetchedResultsController<Book>
|
|
||||||
}()
|
|
||||||
|
|
||||||
// MARK: - Table Cell Delegate
|
// MARK: - Table Cell Delegate
|
||||||
|
|
||||||
func didTapOnAccessoryViewForCell(_ cell: UITableViewCell) {
|
func didTapOnAccessoryViewForCell(_ cell: UITableViewCell) {
|
||||||
@ -175,4 +160,19 @@ class SearchBooksController: SearchBaseTableController, UITableViewDelegate, UIT
|
|||||||
func verticalOffsetForEmptyDataSet(_ scrollView: UIScrollView!) -> CGFloat {
|
func verticalOffsetForEmptyDataSet(_ scrollView: UIScrollView!) -> CGFloat {
|
||||||
return -(tableView.contentInset.bottom + recentSearchBarHeight.constant) / 2.5
|
return -(tableView.contentInset.bottom + recentSearchBarHeight.constant) / 2.5
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MARK: - Fetched Results Controller
|
||||||
|
|
||||||
|
let managedObjectContext = AppDelegate.persistentContainer.viewContext
|
||||||
|
lazy var fetchedResultController: NSFetchedResultsController<Book> = {
|
||||||
|
let fetchRequest = Book.fetchRequest()
|
||||||
|
let langDescriptor = NSSortDescriptor(key: "language.name", ascending: true)
|
||||||
|
let titleDescriptor = NSSortDescriptor(key: "title", ascending: true)
|
||||||
|
fetchRequest.sortDescriptors = [langDescriptor, titleDescriptor]
|
||||||
|
fetchRequest.predicate = NSPredicate(format: "stateRaw == 2")
|
||||||
|
let fetchedResultsController = NSFetchedResultsController(fetchRequest: fetchRequest, managedObjectContext: self.managedObjectContext, sectionNameKeyPath: nil, cacheName: "ScopeFRC" + Bundle.buildVersion)
|
||||||
|
fetchedResultsController.delegate = self
|
||||||
|
try? fetchedResultsController.performFetch()
|
||||||
|
return fetchedResultsController as! NSFetchedResultsController<Book>
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
|
@ -104,10 +104,11 @@ class SettingTBVC: UITableViewController {
|
|||||||
case LocalizedStrings.rateKiwix:
|
case LocalizedStrings.rateKiwix:
|
||||||
showRateKiwixAlert(showRemindLater: false)
|
showRateKiwixAlert(showRemindLater: false)
|
||||||
case LocalizedStrings.about:
|
case LocalizedStrings.about:
|
||||||
let controller = UIStoryboard(name: "Setting", bundle: nil)
|
break
|
||||||
.instantiateViewController(withIdentifier: "WebViewControllerOld") as! WebViewControllerOld
|
// let controller = UIStoryboard(name: "Setting", bundle: nil)
|
||||||
controller.page = .About
|
// .instantiateViewController(withIdentifier: "WebViewControllerOld") as! WebViewControllerOld
|
||||||
navigationController?.pushViewController(controller, animated: true)
|
// controller.page = .About
|
||||||
|
// navigationController?.pushViewController(controller, animated: true)
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -152,8 +153,8 @@ class SettingTBVC: UITableViewController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func goRateInAppStore() {
|
func goRateInAppStore() {
|
||||||
let url = URL(string: "http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=997079563&pageNumber=0&sortOrdering=2&type=Purple+Software&mt=8")!
|
// let url = URL(string: "http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=997079563&pageNumber=0&sortOrdering=2&type=Purple+Software&mt=8")!
|
||||||
UIApplication.shared.openURL(url)
|
// UIApplication.shared.openURL(url)
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Actions
|
// MARK: - Actions
|
||||||
|
@ -52,6 +52,7 @@ class WebViewControllerOld: UIViewController, UIWebViewDelegate {
|
|||||||
|
|
||||||
func webView(_ webView: UIWebView, shouldStartLoadWith request: URLRequest, navigationType: UIWebViewNavigationType) -> Bool {
|
func webView(_ webView: UIWebView, shouldStartLoadWith request: URLRequest, navigationType: UIWebViewNavigationType) -> Bool {
|
||||||
if navigationType == .linkClicked {
|
if navigationType == .linkClicked {
|
||||||
|
UIApplication.shared.open(<#T##url: URL##URL#>, options: <#T##[String : Any]#>, completionHandler: <#T##((Bool) -> Void)?##((Bool) -> Void)?##(Bool) -> Void#>)
|
||||||
UIApplication.shared.openURL(request.url!)
|
UIApplication.shared.openURL(request.url!)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>1.8.3308</string>
|
<string>1.8.3342</string>
|
||||||
<key>ITSAppUsesNonExemptEncryption</key>
|
<key>ITSAppUsesNonExemptEncryption</key>
|
||||||
<false/>
|
<false/>
|
||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
|
@ -7,9 +7,3 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
class DownloadFinishedNotifications: UILocalNotification {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//@available(iOS 10, *)
|
|
||||||
|
@ -209,61 +209,6 @@
|
|||||||
</objects>
|
</objects>
|
||||||
<point key="canvasLocation" x="2607" y="432"/>
|
<point key="canvasLocation" x="2607" y="432"/>
|
||||||
</scene>
|
</scene>
|
||||||
<!--Navigation Controller-->
|
|
||||||
<scene sceneID="sKQ-wF-qqU">
|
|
||||||
<objects>
|
|
||||||
<navigationController id="3qT-fi-cxa" sceneMemberID="viewController">
|
|
||||||
<navigationBar key="navigationBar" contentMode="scaleToFill" id="nNd-2P-KwU">
|
|
||||||
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
|
|
||||||
<autoresizingMask key="autoresizingMask"/>
|
|
||||||
</navigationBar>
|
|
||||||
<connections>
|
|
||||||
<segue destination="OSe-sS-HTX" kind="relationship" relationship="rootViewController" id="WBP-1c-ZMf"/>
|
|
||||||
</connections>
|
|
||||||
</navigationController>
|
|
||||||
<placeholder placeholderIdentifier="IBFirstResponder" id="1xD-QM-7xK" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
|
||||||
</objects>
|
|
||||||
<point key="canvasLocation" x="756" y="-348"/>
|
|
||||||
</scene>
|
|
||||||
<!--Main Controller-->
|
|
||||||
<scene sceneID="WLR-6p-ElI">
|
|
||||||
<objects>
|
|
||||||
<viewController id="OSe-sS-HTX" customClass="MainController" customModule="Kiwix" customModuleProvider="target" sceneMemberID="viewController">
|
|
||||||
<layoutGuides>
|
|
||||||
<viewControllerLayoutGuide type="top" id="KVH-WC-JGt"/>
|
|
||||||
<viewControllerLayoutGuide type="bottom" id="UIX-e1-SUg"/>
|
|
||||||
</layoutGuides>
|
|
||||||
<view key="view" contentMode="scaleToFill" id="hRW-ET-fRA">
|
|
||||||
<rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
|
|
||||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
|
||||||
<subviews>
|
|
||||||
<webView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="MjM-In-ehJ">
|
|
||||||
<rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
|
|
||||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
|
||||||
</webView>
|
|
||||||
</subviews>
|
|
||||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
|
||||||
<constraints>
|
|
||||||
<constraint firstItem="MjM-In-ehJ" firstAttribute="top" secondItem="KVH-WC-JGt" secondAttribute="bottom" constant="-64" id="1Om-9P-m57">
|
|
||||||
<variation key="heightClass=compact-widthClass=regular" constant="-44"/>
|
|
||||||
</constraint>
|
|
||||||
<constraint firstItem="MjM-In-ehJ" firstAttribute="leading" secondItem="hRW-ET-fRA" secondAttribute="leading" id="Kf8-Rn-ROp"/>
|
|
||||||
<constraint firstItem="UIX-e1-SUg" firstAttribute="top" secondItem="MjM-In-ehJ" secondAttribute="bottom" constant="-44" id="MRq-VY-WQT">
|
|
||||||
<variation key="widthClass=regular" constant="0.0"/>
|
|
||||||
</constraint>
|
|
||||||
<constraint firstAttribute="trailing" secondItem="MjM-In-ehJ" secondAttribute="trailing" id="tIZ-J4-u59"/>
|
|
||||||
</constraints>
|
|
||||||
</view>
|
|
||||||
<navigationItem key="navigationItem" id="fuj-b7-iB1"/>
|
|
||||||
<simulatedToolbarMetrics key="simulatedBottomBarMetrics"/>
|
|
||||||
<connections>
|
|
||||||
<outlet property="webView" destination="MjM-In-ehJ" id="bOM-dN-Gc6"/>
|
|
||||||
</connections>
|
|
||||||
</viewController>
|
|
||||||
<placeholder placeholderIdentifier="IBFirstResponder" id="Yrv-8u-IwG" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
|
||||||
</objects>
|
|
||||||
<point key="canvasLocation" x="1651" y="-351"/>
|
|
||||||
</scene>
|
|
||||||
<!--Main Controller-->
|
<!--Main Controller-->
|
||||||
<scene sceneID="nEL-IB-dp3">
|
<scene sceneID="nEL-IB-dp3">
|
||||||
<objects>
|
<objects>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11760" systemVersion="16B2555" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="aWb-Y7-c2Y">
|
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11760" systemVersion="16B2555" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="aWb-Y7-c2Y">
|
||||||
<device id="ipad9_7" orientation="portrait">
|
<device id="retina5_5" orientation="portrait">
|
||||||
<adaptation id="fullscreen"/>
|
<adaptation id="fullscreen"/>
|
||||||
</device>
|
</device>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
@ -20,18 +20,18 @@
|
|||||||
<viewControllerLayoutGuide type="bottom" id="fIX-c6-nY4"/>
|
<viewControllerLayoutGuide type="bottom" id="fIX-c6-nY4"/>
|
||||||
</layoutGuides>
|
</layoutGuides>
|
||||||
<view key="view" contentMode="scaleToFill" id="HEy-pW-bRk">
|
<view key="view" contentMode="scaleToFill" id="HEy-pW-bRk">
|
||||||
<rect key="frame" x="0.0" y="64" width="538" height="653"/>
|
<rect key="frame" x="0.0" y="64" width="414" height="608"/>
|
||||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
<subviews>
|
<subviews>
|
||||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="nDJ-c8-oj6">
|
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="nDJ-c8-oj6">
|
||||||
<rect key="frame" x="0.0" y="44" width="538" height="609"/>
|
<rect key="frame" x="0.0" y="44" width="414" height="564"/>
|
||||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
<prototypes>
|
<prototypes>
|
||||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="CheckMarkBookCell" id="BZj-UA-kZf" customClass="CheckMarkBookCell" customModule="Kiwix">
|
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="CheckMarkBookCell" id="BZj-UA-kZf" customClass="CheckMarkBookCell" customModule="Kiwix">
|
||||||
<rect key="frame" x="0.0" y="28" width="538" height="44"/>
|
<rect key="frame" x="0.0" y="28" width="414" height="44"/>
|
||||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="BZj-UA-kZf" id="QkJ-pZ-dqx">
|
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="BZj-UA-kZf" id="QkJ-pZ-dqx">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="538" height="43"/>
|
<rect key="frame" x="0.0" y="0.0" width="414" height="43.5"/>
|
||||||
<autoresizingMask key="autoresizingMask"/>
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
<subviews>
|
<subviews>
|
||||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" lineBreakMode="tailTruncation" minimumFontSize="8" adjustsLetterSpacingToFitWidth="YES" translatesAutoresizingMaskIntoConstraints="NO" id="GW1-dh-vyc">
|
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" lineBreakMode="tailTruncation" minimumFontSize="8" adjustsLetterSpacingToFitWidth="YES" translatesAutoresizingMaskIntoConstraints="NO" id="GW1-dh-vyc">
|
||||||
@ -119,7 +119,7 @@
|
|||||||
</prototypes>
|
</prototypes>
|
||||||
</tableView>
|
</tableView>
|
||||||
<containerView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="H44-bK-YA5" customClass="DropShadowView" customModule="Kiwix" customModuleProvider="target">
|
<containerView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="H44-bK-YA5" customClass="DropShadowView" customModule="Kiwix" customModuleProvider="target">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="538" height="44"/>
|
<rect key="frame" x="0.0" y="0.0" width="414" height="44"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<constraint firstAttribute="height" constant="44" id="4d0-gR-IwP"/>
|
<constraint firstAttribute="height" constant="44" id="4d0-gR-IwP"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
@ -160,18 +160,18 @@
|
|||||||
<viewControllerLayoutGuide type="bottom" id="U6y-Va-LE0"/>
|
<viewControllerLayoutGuide type="bottom" id="U6y-Va-LE0"/>
|
||||||
</layoutGuides>
|
</layoutGuides>
|
||||||
<view key="view" contentMode="scaleToFill" id="oES-Vw-jgP">
|
<view key="view" contentMode="scaleToFill" id="oES-Vw-jgP">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="538" height="717"/>
|
<rect key="frame" x="0.0" y="0.0" width="414" height="672"/>
|
||||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
<subviews>
|
<subviews>
|
||||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="526-mx-VrZ">
|
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="526-mx-VrZ">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="538" height="717"/>
|
<rect key="frame" x="0.0" y="0.0" width="414" height="672"/>
|
||||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
<prototypes>
|
<prototypes>
|
||||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="ArticleCell" id="z8v-Ld-3tX" customClass="ArticleCell" customModule="Kiwix" customModuleProvider="target">
|
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="ArticleCell" id="z8v-Ld-3tX" customClass="ArticleCell" customModule="Kiwix" customModuleProvider="target">
|
||||||
<rect key="frame" x="0.0" y="28" width="538" height="44"/>
|
<rect key="frame" x="0.0" y="28" width="414" height="44"/>
|
||||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="z8v-Ld-3tX" id="PYl-F0-kUl">
|
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="z8v-Ld-3tX" id="PYl-F0-kUl">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="538" height="43"/>
|
<rect key="frame" x="0.0" y="0.0" width="414" height="43.5"/>
|
||||||
<autoresizingMask key="autoresizingMask"/>
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
<subviews>
|
<subviews>
|
||||||
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="UgG-QR-OX4">
|
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="UgG-QR-OX4">
|
||||||
@ -189,7 +189,7 @@
|
|||||||
</constraints>
|
</constraints>
|
||||||
</view>
|
</view>
|
||||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="T" lineBreakMode="tailTruncation" adjustsLetterSpacingToFitWidth="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="79o-Kq-Tr5">
|
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="T" lineBreakMode="tailTruncation" adjustsLetterSpacingToFitWidth="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="79o-Kq-Tr5">
|
||||||
<rect key="frame" x="48" y="6" width="712" height="32"/>
|
<rect key="frame" x="48" y="6" width="358" height="32"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="32" id="KoF-qx-tar"/>
|
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="32" id="KoF-qx-tar"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
@ -225,10 +225,10 @@
|
|||||||
</connections>
|
</connections>
|
||||||
</tableViewCell>
|
</tableViewCell>
|
||||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="ArticleSnippetCell" rowHeight="87" id="wBv-ub-ny7" customClass="ArticleSnippetCell" customModule="Kiwix" customModuleProvider="target">
|
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="ArticleSnippetCell" rowHeight="87" id="wBv-ub-ny7" customClass="ArticleSnippetCell" customModule="Kiwix" customModuleProvider="target">
|
||||||
<rect key="frame" x="0.0" y="72" width="538" height="87"/>
|
<rect key="frame" x="0.0" y="72" width="414" height="87"/>
|
||||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="wBv-ub-ny7" id="fk4-EM-rH7">
|
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="wBv-ub-ny7" id="fk4-EM-rH7">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="538" height="86"/>
|
<rect key="frame" x="0.0" y="0.0" width="414" height="86.5"/>
|
||||||
<autoresizingMask key="autoresizingMask"/>
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
<subviews>
|
<subviews>
|
||||||
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="ien-Dp-MNO">
|
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="ien-Dp-MNO">
|
||||||
@ -246,7 +246,7 @@
|
|||||||
</constraints>
|
</constraints>
|
||||||
</view>
|
</view>
|
||||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="T" lineBreakMode="tailTruncation" adjustsLetterSpacingToFitWidth="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qUd-SU-d1A">
|
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="T" lineBreakMode="tailTruncation" adjustsLetterSpacingToFitWidth="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qUd-SU-d1A">
|
||||||
<rect key="frame" x="48" y="10" width="712" height="24"/>
|
<rect key="frame" x="48" y="10" width="358" height="24"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<constraint firstAttribute="height" constant="24" id="Xnz-4D-mht"/>
|
<constraint firstAttribute="height" constant="24" id="Xnz-4D-mht"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
@ -255,7 +255,7 @@
|
|||||||
<nil key="highlightedColor"/>
|
<nil key="highlightedColor"/>
|
||||||
</label>
|
</label>
|
||||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="3" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="R3d-Xp-YAT">
|
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="3" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="R3d-Xp-YAT">
|
||||||
<rect key="frame" x="48" y="34" width="712" height="45"/>
|
<rect key="frame" x="48" y="34" width="358" height="45"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="2" id="vpN-us-saa"/>
|
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="2" id="vpN-us-saa"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
@ -334,11 +334,11 @@
|
|||||||
<viewControllerLayoutGuide type="bottom" id="Xnw-As-VGc"/>
|
<viewControllerLayoutGuide type="bottom" id="Xnw-As-VGc"/>
|
||||||
</layoutGuides>
|
</layoutGuides>
|
||||||
<view key="view" contentMode="scaleToFill" id="kCv-em-FrJ">
|
<view key="view" contentMode="scaleToFill" id="kCv-em-FrJ">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="538" height="44"/>
|
<rect key="frame" x="0.0" y="0.0" width="414" height="44"/>
|
||||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
<subviews>
|
<subviews>
|
||||||
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="gmD-FQ-6K1">
|
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="gmD-FQ-6K1">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="538" height="44"/>
|
<rect key="frame" x="0.0" y="0.0" width="414" height="44"/>
|
||||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
|
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
<collectionViewFlowLayout key="collectionViewLayout" scrollDirection="horizontal" minimumLineSpacing="10" minimumInteritemSpacing="10" id="UGg-ww-zQ6">
|
<collectionViewFlowLayout key="collectionViewLayout" scrollDirection="horizontal" minimumLineSpacing="10" minimumInteritemSpacing="10" id="UGg-ww-zQ6">
|
||||||
<size key="itemSize" width="102" height="42"/>
|
<size key="itemSize" width="102" height="42"/>
|
||||||
@ -355,7 +355,7 @@
|
|||||||
<autoresizingMask key="autoresizingMask"/>
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
<subviews>
|
<subviews>
|
||||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0QZ-Yd-dSd">
|
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0QZ-Yd-dSd">
|
||||||
<rect key="frame" x="8" y="11" width="86" height="20.5"/>
|
<rect key="frame" x="8" y="11.000000000000002" width="86" height="20.666666666666671"/>
|
||||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||||
<color key="textColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.95686274510000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
<color key="textColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.95686274510000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
<nil key="highlightedColor"/>
|
<nil key="highlightedColor"/>
|
||||||
@ -400,7 +400,7 @@
|
|||||||
<viewControllerLayoutGuide type="bottom" id="io0-SJ-WNQ"/>
|
<viewControllerLayoutGuide type="bottom" id="io0-SJ-WNQ"/>
|
||||||
</layoutGuides>
|
</layoutGuides>
|
||||||
<view key="view" contentMode="scaleToFill" id="4ma-1x-rrV">
|
<view key="view" contentMode="scaleToFill" id="4ma-1x-rrV">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
|
<rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
|
||||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
<subviews>
|
<subviews>
|
||||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="aYO-40-lc1">
|
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="aYO-40-lc1">
|
||||||
@ -412,13 +412,13 @@
|
|||||||
</connections>
|
</connections>
|
||||||
</view>
|
</view>
|
||||||
<containerView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="TwU-1D-XoU" customClass="SearchRoundedCornerView" customModule="Kiwix" customModuleProvider="target">
|
<containerView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="TwU-1D-XoU" customClass="SearchRoundedCornerView" customModule="Kiwix" customModuleProvider="target">
|
||||||
<rect key="frame" x="115" y="64" width="538" height="717"/>
|
<rect key="frame" x="0.0" y="64" width="414" height="672"/>
|
||||||
<connections>
|
<connections>
|
||||||
<segue destination="vSQ-RM-B8e" kind="embed" identifier="EmbeddedScopeAndHistoryController" id="5c8-AT-w6g"/>
|
<segue destination="vSQ-RM-B8e" kind="embed" identifier="EmbeddedScopeAndHistoryController" id="5c8-AT-w6g"/>
|
||||||
</connections>
|
</connections>
|
||||||
</containerView>
|
</containerView>
|
||||||
<containerView hidden="YES" opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="mQq-ba-VqM" customClass="SearchRoundedCornerView" customModule="Kiwix" customModuleProvider="target">
|
<containerView hidden="YES" opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="mQq-ba-VqM" customClass="SearchRoundedCornerView" customModule="Kiwix" customModuleProvider="target">
|
||||||
<rect key="frame" x="115" y="64" width="538" height="717"/>
|
<rect key="frame" x="0.0" y="64" width="414" height="672"/>
|
||||||
<connections>
|
<connections>
|
||||||
<segue destination="fgz-Yy-Pok" kind="embed" identifier="EmbeddedResultController" id="8xc-8P-ZTh"/>
|
<segue destination="fgz-Yy-Pok" kind="embed" identifier="EmbeddedResultController" id="8xc-8P-ZTh"/>
|
||||||
</connections>
|
</connections>
|
||||||
@ -453,6 +453,10 @@
|
|||||||
<exclude reference="Ic8-db-q3b"/>
|
<exclude reference="Ic8-db-q3b"/>
|
||||||
<exclude reference="Ipm-Zl-2Mg"/>
|
<exclude reference="Ipm-Zl-2Mg"/>
|
||||||
<exclude reference="xF2-nV-4Vp"/>
|
<exclude reference="xF2-nV-4Vp"/>
|
||||||
|
<exclude reference="kHq-Kc-KeD"/>
|
||||||
|
<exclude reference="BVS-ar-WL4"/>
|
||||||
|
<exclude reference="I4h-o0-seW"/>
|
||||||
|
<exclude reference="tGo-AF-P3V"/>
|
||||||
</mask>
|
</mask>
|
||||||
</variation>
|
</variation>
|
||||||
<variation key="widthClass=compact">
|
<variation key="widthClass=compact">
|
||||||
@ -470,6 +474,10 @@
|
|||||||
<include reference="8Ra-9F-JD4"/>
|
<include reference="8Ra-9F-JD4"/>
|
||||||
<include reference="FMO-4e-tUF"/>
|
<include reference="FMO-4e-tUF"/>
|
||||||
<include reference="Ic8-db-q3b"/>
|
<include reference="Ic8-db-q3b"/>
|
||||||
|
<include reference="kHq-Kc-KeD"/>
|
||||||
|
<include reference="BVS-ar-WL4"/>
|
||||||
|
<include reference="I4h-o0-seW"/>
|
||||||
|
<include reference="tGo-AF-P3V"/>
|
||||||
</mask>
|
</mask>
|
||||||
</variation>
|
</variation>
|
||||||
</view>
|
</view>
|
||||||
|
@ -6,27 +6,8 @@
|
|||||||
// Copyright © 2016 Chris Li. All rights reserved.
|
// Copyright © 2016 Chris Li. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
|
||||||
import CoreData
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
// MARK: - CoreData
|
|
||||||
|
|
||||||
extension NSFetchedResultsController {
|
|
||||||
func performFetch(deleteCache: Bool) {
|
|
||||||
do {
|
|
||||||
if deleteCache {
|
|
||||||
guard let cacheName = cacheName else {return}
|
|
||||||
NSFetchedResultsController.deleteCache(withName: cacheName)
|
|
||||||
}
|
|
||||||
|
|
||||||
try performFetch()
|
|
||||||
} catch let error as NSError {
|
|
||||||
print("FetchedResultController performFetch failed: \(error.localizedDescription)")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// MARK: - UI
|
// MARK: - UI
|
||||||
|
|
||||||
enum BuildStatus {
|
enum BuildStatus {
|
||||||
@ -41,30 +22,6 @@ extension UIApplication {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension UIStoryboard {
|
|
||||||
class var library: UIStoryboard {get {return UIStoryboard(name: "Library", bundle: nil)}}
|
|
||||||
class var main: UIStoryboard {get {return UIStoryboard(name: "Main", bundle: nil)}}
|
|
||||||
class var search: UIStoryboard {get {return UIStoryboard(name: "Search", bundle: nil)}}
|
|
||||||
class var setting: UIStoryboard {get {return UIStoryboard(name: "Setting", bundle: nil)}}
|
|
||||||
class var welcome: UIStoryboard {get {return UIStoryboard(name: "Welcome", bundle: nil)}}
|
|
||||||
|
|
||||||
func initViewController<T:UIViewController>(_ type: T.Type) -> T? {
|
|
||||||
guard let className = NSStringFromClass(T).components(separatedBy: ".").last else {
|
|
||||||
print("NSManagedObjectExtension: Unable to get class name")
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
return instantiateViewController(withIdentifier: className) as? T
|
|
||||||
}
|
|
||||||
|
|
||||||
func initViewController<T:UIViewController>(_ identifier: String, type: T.Type) -> T? {
|
|
||||||
return instantiateViewController(withIdentifier: identifier) as? T
|
|
||||||
}
|
|
||||||
|
|
||||||
func controller<T:UIViewController>(_ type: T.Type) -> T? {
|
|
||||||
return instantiateViewController(withIdentifier: String(describing: T.self)) as? T
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
extension UIColor {
|
extension UIColor {
|
||||||
class var defaultTint: UIColor {return UIColor(red: 0, green: 122/255, blue: 1, alpha: 1)}
|
class var defaultTint: UIColor {return UIColor(red: 0, green: 122/255, blue: 1, alpha: 1)}
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>1.8.3308</string>
|
<string>1.8.3342</string>
|
||||||
<key>NSExtension</key>
|
<key>NSExtension</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>NSExtensionMainStoryboard</key>
|
<key>NSExtensionMainStoryboard</key>
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
970A2A221DD562CB0078BB7C /* BookOperations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 970A2A211DD562CB0078BB7C /* BookOperations.swift */; };
|
970A2A221DD562CB0078BB7C /* BookOperations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 970A2A211DD562CB0078BB7C /* BookOperations.swift */; };
|
||||||
970E7F741D9DB0FC00741290 /* 1.8.xcmappingmodel in Sources */ = {isa = PBXBuildFile; fileRef = 970E7F731D9DB0FC00741290 /* 1.8.xcmappingmodel */; };
|
970E7F741D9DB0FC00741290 /* 1.8.xcmappingmodel in Sources */ = {isa = PBXBuildFile; fileRef = 970E7F731D9DB0FC00741290 /* 1.8.xcmappingmodel */; };
|
||||||
970E7F771D9DBEA900741290 /* SettingController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 970E7F761D9DBEA900741290 /* SettingController.swift */; };
|
970E7F771D9DBEA900741290 /* SettingController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 970E7F761D9DBEA900741290 /* SettingController.swift */; };
|
||||||
970E7F791DA003FA00741290 /* WebViewControllerOld.swift in Sources */ = {isa = PBXBuildFile; fileRef = 970E7F781DA003FA00741290 /* WebViewControllerOld.swift */; };
|
|
||||||
970E7F7B1DA0069600741290 /* FontSizeController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 970E7F7A1DA0069600741290 /* FontSizeController.swift */; };
|
970E7F7B1DA0069600741290 /* FontSizeController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 970E7F7A1DA0069600741290 /* FontSizeController.swift */; };
|
||||||
970E7F821DA0305000741290 /* TableOfContentsController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 970E7F7E1DA0305000741290 /* TableOfContentsController.swift */; };
|
970E7F821DA0305000741290 /* TableOfContentsController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 970E7F7E1DA0305000741290 /* TableOfContentsController.swift */; };
|
||||||
970E7F831DA0305000741290 /* WelcomeController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 970E7F7F1DA0305000741290 /* WelcomeController.swift */; };
|
970E7F831DA0305000741290 /* WelcomeController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 970E7F7F1DA0305000741290 /* WelcomeController.swift */; };
|
||||||
@ -1145,7 +1144,6 @@
|
|||||||
97D6813A1D6F711A00E5FA99 /* Language.swift in Sources */,
|
97D6813A1D6F711A00E5FA99 /* Language.swift in Sources */,
|
||||||
97BC0FBF1DD90A65004BBAD1 /* JSInjection.swift in Sources */,
|
97BC0FBF1DD90A65004BBAD1 /* JSInjection.swift in Sources */,
|
||||||
97BC0FC01DD90A65004BBAD1 /* MainController.swift in Sources */,
|
97BC0FC01DD90A65004BBAD1 /* MainController.swift in Sources */,
|
||||||
970E7F791DA003FA00741290 /* WebViewControllerOld.swift in Sources */,
|
|
||||||
97A1FD421D6F728200A80EE2 /* Extensions.swift in Sources */,
|
97A1FD421D6F728200A80EE2 /* Extensions.swift in Sources */,
|
||||||
97A1FD3A1D6F724E00A80EE2 /* reader.cpp in Sources */,
|
97A1FD3A1D6F724E00A80EE2 /* reader.cpp in Sources */,
|
||||||
973207A31DD1983D00EDD3DC /* LanguageFilterController.swift in Sources */,
|
973207A31DD1983D00EDD3DC /* LanguageFilterController.swift in Sources */,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user