diff --git a/CHANGELOG.md b/CHANGELOG.md index bc1279c14..b946864b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.15 + +- Half sheet table of contents (iOS 15 & horizontally compact interfaces) +- Using quicklook to preview zim files in the files app +- Bookmark UI is made consistent with other article list UI (e.g. search results) + ## 1.14.5 - Fixed crashes that could happen during search result snippet parsing diff --git a/Kiwix.xcodeproj/project.pbxproj b/Kiwix.xcodeproj/project.pbxproj index 7c765113b..59f712b08 100644 --- a/Kiwix.xcodeproj/project.pbxproj +++ b/Kiwix.xcodeproj/project.pbxproj @@ -115,7 +115,6 @@ 97C575F4202CB0E800E37502 /* NotificationCenter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 97C575F3202CB0E800E37502 /* NotificationCenter.framework */; }; 97C575F7202CB0E800E37502 /* TodayViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97C575F6202CB0E800E37502 /* TodayViewController.swift */; }; 97C575FA202CB0E800E37502 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C575F8202CB0E800E37502 /* MainInterface.storyboard */; }; - 97C575FE202CB0E900E37502 /* Bookmarks.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 97C575F2202CB0E800E37502 /* Bookmarks.appex */; platformFilter = ios; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 97C5763D202CD9C000E37502 /* NotificationCenter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 97C575F3202CB0E800E37502 /* NotificationCenter.framework */; platformFilter = ios; }; 97CE4242249322E300B334E9 /* SearchResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 97B3998C2467561900BC6F5B /* SearchResult.m */; }; 97CE42432493234D00B334E9 /* SearchOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97B3998F2467626A00BC6F5B /* SearchOperation.swift */; }; @@ -194,7 +193,6 @@ dstPath = ""; dstSubfolderSpec = 13; files = ( - 97C575FE202CB0E900E37502 /* Bookmarks.appex in Embed App Extensions */, 97F425CE27151A0D00D0F738 /* QuickLookPreview.appex in Embed App Extensions */, ); name = "Embed App Extensions"; @@ -1500,7 +1498,7 @@ CODE_SIGN_ENTITLEMENTS = iOS/Support/Kiwix.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 79; + CURRENT_PROJECT_VERSION = 81; DEVELOPMENT_TEAM = L7HWM3SP3L; ENABLE_BITCODE = YES; GCC_C_LANGUAGE_STANDARD = c11; @@ -1541,7 +1539,7 @@ CODE_SIGN_ENTITLEMENTS = iOS/Support/Kiwix.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 79; + CURRENT_PROJECT_VERSION = 81; DEVELOPMENT_TEAM = L7HWM3SP3L; ENABLE_BITCODE = YES; GCC_C_LANGUAGE_STANDARD = c11; diff --git a/Model/Realm/Bookmark.swift b/Model/Realm/Bookmark.swift index d44e26313..b60a30753 100644 --- a/Model/Realm/Bookmark.swift +++ b/Model/Realm/Bookmark.swift @@ -9,11 +9,11 @@ import RealmSwift class Bookmark: Object, ObjectKeyIdentifiable { - @objc dynamic var path = "" - @objc dynamic var zimFile: ZimFile? + @Persisted var path = "" + @Persisted var zimFile: ZimFile? - @objc dynamic var title = "" - @objc dynamic var snippet: String? - @objc dynamic var thumbImagePath: String? - @objc dynamic var date: Date? + @Persisted var title = "" + @Persisted var snippet: String? + @Persisted var thumbImagePath: String? + @Persisted var date: Date? } diff --git a/iOS/AppDelegate.swift b/iOS/AppDelegate.swift index 222692013..828e9fa9e 100644 --- a/iOS/AppDelegate.swift +++ b/iOS/AppDelegate.swift @@ -44,11 +44,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, DirectoryMonitorDelegate return true } - func applicationWillEnterForeground(_ application: UIApplication) { - let scan = LibraryScanOperation(directoryURL: URL.documentDirectory) - LibraryOperationQueue.shared.addOperation(scan) - } - func applicationWillTerminate(_ application: UIApplication) { fileMonitor.stop() } @@ -99,21 +94,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, DirectoryMonitorDelegate } LibraryOperationQueue.shared.addOperation(operation) } - - // MARK: - Home Screen Quick Actions - - func application(_ application: UIApplication, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -> Void) { - guard let shortcut = Shortcut(rawValue: shortcutItem.type), - let navigationController = window?.rootViewController as? UINavigationController, - let rootViewController = navigationController.topViewController as? RootViewController else { completionHandler(false); return } - switch shortcut { - case .bookmark: - rootViewController.bookmarkButtonTapped() - case .search: - rootViewController.searchController.isActive = true - } - completionHandler(true) - } } // MARK: - Type Definition diff --git a/iOS/Controller/BookmarksViewController.swift b/iOS/Controller/BookmarksViewController.swift index 94998c5d0..9295177b5 100644 --- a/iOS/Controller/BookmarksViewController.swift +++ b/iOS/Controller/BookmarksViewController.swift @@ -67,9 +67,9 @@ struct BookmarksView: View { if let zimFile = bookmark.zimFile, let path = bookmark.thumbImagePath, let content = ZimFileService.shared.getURLContent(zimFileID: zimFile.fileID, contentPath: path) { - Favicon(data: content.data) + Favicon(data: content.data, contentMode: .fill, width: 18) } else { - Favicon(data: bookmark.zimFile?.faviconData) + Favicon(data: bookmark.zimFile?.faviconData, width: 18) } VStack(alignment: .leading) { Text(bookmark.title).fontWeight(.medium).lineLimit(1) diff --git a/iOS/SwiftUI/BuildingBlocks.swift b/iOS/SwiftUI/BuildingBlocks.swift index ccaf88935..ac245a369 100644 --- a/iOS/SwiftUI/BuildingBlocks.swift +++ b/iOS/SwiftUI/BuildingBlocks.swift @@ -90,26 +90,32 @@ struct DisclosureIndicator: View { struct Favicon: View { private let image: Image + private let contentMode: ContentMode + private let width: CGFloat private let outline = RoundedRectangle(cornerRadius: 4, style: .continuous) - init(data: Data?) { + init(data: Data?, contentMode: ContentMode = .fit, width: CGFloat = 24) { if let data = data, let image = UIImage(data: data) { self.image = Image(uiImage: image) } else { self.image = Image("GenericZimFile") } + self.contentMode = contentMode + self.width = width } - init(uiImage: UIImage) { + init(uiImage: UIImage, contentMode: ContentMode = .fit, width: CGFloat = 24) { self.image = Image(uiImage: uiImage) + self.contentMode = contentMode + self.width = width } var body: some View { image .renderingMode(.original) .resizable() - .aspectRatio(contentMode: .fit) - .frame(width: 24, height: 24) + .aspectRatio(contentMode: contentMode) + .frame(width: width, height: width) .background(Color(.white)) .clipShape(outline) .overlay(outline.stroke(Color(.white).opacity(0.9), lineWidth: 1))