diff --git a/.gitignore b/.gitignore index 3541e57ee..de72aeb75 100644 --- a/.gitignore +++ b/.gitignore @@ -4,9 +4,6 @@ Kiwix/libkiwix/C&C++ Kiwix/libkiwix/include Kiwix/libkiwix/shared Kiwix/libkiwix/static -<<<<<<< HEAD *.a -======= Kiwix/libkiwix/iOS Kiwix/libkiwix/macOS ->>>>>>> 1.7 diff --git a/Designs/Icons/icloud.psd b/Designs/Icons/icloud.psd new file mode 100644 index 000000000..cd958ade2 Binary files /dev/null and b/Designs/Icons/icloud.psd differ diff --git a/Kiwix-iOS/AppDelegate.swift b/Kiwix-iOS/AppDelegate.swift index cf684b2c6..e724149a9 100644 --- a/Kiwix-iOS/AppDelegate.swift +++ b/Kiwix-iOS/AppDelegate.swift @@ -7,10 +7,10 @@ import UIKit import CoreData -import PSOperations +import Operations @UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate, OperationQueueDelegate { +class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? var mainController: MainController? { @@ -70,7 +70,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, OperationQueueDelegate { } func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool { - guard url.scheme.caseInsensitiveCompare("kiwix") == .OrderedSame else {return false} + guard url.scheme!.caseInsensitiveCompare("kiwix") == .OrderedSame else {return false} mainController?.load(url) return true } diff --git a/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..b22f5b622 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,106 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-Small@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-Small@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-60@3x.png", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-Small.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-Small@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-40.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-76.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-83.5@2x.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Icon-40.png b/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Icon-40.png new file mode 100644 index 000000000..1a9a229f1 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Icon-40.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Icon-40@2x.png b/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Icon-40@2x.png new file mode 100644 index 000000000..fdf87f438 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Icon-40@2x.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Icon-40@3x.png b/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Icon-40@3x.png new file mode 100644 index 000000000..779166f99 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Icon-40@3x.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Icon-60@2x.png b/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Icon-60@2x.png new file mode 100644 index 000000000..779166f99 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Icon-60@2x.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Icon-60@3x.png b/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Icon-60@3x.png new file mode 100644 index 000000000..cc3e6f53a Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Icon-60@3x.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Icon-76.png b/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Icon-76.png new file mode 100644 index 000000000..744f5d9dc Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Icon-76.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Icon-76@2x.png b/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Icon-76@2x.png new file mode 100644 index 000000000..5932acec0 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Icon-76@2x.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Icon-83.5@2x.png b/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Icon-83.5@2x.png new file mode 100644 index 000000000..3e61d73d1 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Icon-83.5@2x.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Icon-Small.png b/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Icon-Small.png new file mode 100644 index 000000000..c7d63bf84 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Icon-Small.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Icon-Small@2x.png b/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Icon-Small@2x.png new file mode 100644 index 000000000..c35e4d958 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Icon-Small@2x.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Icon-Small@3x.png b/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Icon-Small@3x.png new file mode 100644 index 000000000..f7008fe76 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/AppIcon.appiconset/Icon-Small@3x.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/Bookmarks/BookmarkAdded.imageset/BookmarkAdded.png b/Kiwix-iOS/Assets-old.xcassets/Bookmarks/BookmarkAdded.imageset/BookmarkAdded.png new file mode 100644 index 000000000..d2d0e6594 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/Bookmarks/BookmarkAdded.imageset/BookmarkAdded.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/Bookmarks/BookmarkAdded.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/Bookmarks/BookmarkAdded.imageset/Contents.json new file mode 100644 index 000000000..27ae825e0 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/Bookmarks/BookmarkAdded.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "BookmarkAdded.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/Bookmarks/BookmarkColor.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/Bookmarks/BookmarkColor.imageset/Contents.json new file mode 100644 index 000000000..f9c5f85d2 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/Bookmarks/BookmarkColor.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "favorite.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/Bookmarks/BookmarkColor.imageset/favorite.png b/Kiwix-iOS/Assets-old.xcassets/Bookmarks/BookmarkColor.imageset/favorite.png new file mode 100644 index 000000000..5db1988cc Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/Bookmarks/BookmarkColor.imageset/favorite.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/Bookmarks/BookmarkRemoved.imageset/BookmarkRemoved.png b/Kiwix-iOS/Assets-old.xcassets/Bookmarks/BookmarkRemoved.imageset/BookmarkRemoved.png new file mode 100644 index 000000000..96fa66b5d Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/Bookmarks/BookmarkRemoved.imageset/BookmarkRemoved.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/Bookmarks/BookmarkRemoved.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/Bookmarks/BookmarkRemoved.imageset/Contents.json new file mode 100644 index 000000000..8879ffd26 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/Bookmarks/BookmarkRemoved.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "BookmarkRemoved.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/Bookmarks/Contents.json b/Kiwix-iOS/Assets-old.xcassets/Bookmarks/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/Bookmarks/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/Bookmarks/Star.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/Bookmarks/Star.imageset/Contents.json new file mode 100644 index 000000000..1c2ef3428 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/Bookmarks/Star.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "stars64 copy 2.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/Bookmarks/Star.imageset/stars64 copy 2.png b/Kiwix-iOS/Assets-old.xcassets/Bookmarks/Star.imageset/stars64 copy 2.png new file mode 100644 index 000000000..93fa03bf5 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/Bookmarks/Star.imageset/stars64 copy 2.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/Bookmarks/StarHighlighted.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/Bookmarks/StarHighlighted.imageset/Contents.json new file mode 100644 index 000000000..309cb347d --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/Bookmarks/StarHighlighted.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "stars64 copy 3.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/Bookmarks/StarHighlighted.imageset/stars64 copy 3.png b/Kiwix-iOS/Assets-old.xcassets/Bookmarks/StarHighlighted.imageset/stars64 copy 3.png new file mode 100644 index 000000000..b156f3885 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/Bookmarks/StarHighlighted.imageset/stars64 copy 3.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/Bookmarks/StarRemoved.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/Bookmarks/StarRemoved.imageset/Contents.json new file mode 100644 index 000000000..02f45af2f --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/Bookmarks/StarRemoved.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "star.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/Bookmarks/StarRemoved.imageset/star.png b/Kiwix-iOS/Assets-old.xcassets/Bookmarks/StarRemoved.imageset/star.png new file mode 100644 index 000000000..358c8e369 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/Bookmarks/StarRemoved.imageset/star.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/Bookmarks/StarShortcut.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/Bookmarks/StarShortcut.imageset/Contents.json new file mode 100644 index 000000000..28bd97d05 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/Bookmarks/StarShortcut.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "star-1.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/Bookmarks/StarShortcut.imageset/star-1.png b/Kiwix-iOS/Assets-old.xcassets/Bookmarks/StarShortcut.imageset/star-1.png new file mode 100644 index 000000000..659839f95 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/Bookmarks/StarShortcut.imageset/star-1.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/CloudCellAccessory.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/CloudCellAccessory.imageset/Contents.json new file mode 100644 index 000000000..9717577f8 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/CloudCellAccessory.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "downarrows11.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/CloudCellAccessory.imageset/downarrows11.png b/Kiwix-iOS/Assets-old.xcassets/CloudCellAccessory.imageset/downarrows11.png new file mode 100644 index 000000000..47a954d04 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/CloudCellAccessory.imageset/downarrows11.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/CloudRound.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/CloudRound.imageset/Contents.json new file mode 100644 index 000000000..ba4722840 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/CloudRound.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "cloud.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/CloudRound.imageset/cloud.png b/Kiwix-iOS/Assets-old.xcassets/CloudRound.imageset/cloud.png new file mode 100644 index 000000000..7f3a85aba Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/CloudRound.imageset/cloud.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/Compass.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/Compass.imageset/Contents.json new file mode 100644 index 000000000..0a79bf165 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/Compass.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "compass.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/Compass.imageset/compass.png b/Kiwix-iOS/Assets-old.xcassets/Compass.imageset/compass.png new file mode 100644 index 000000000..eab299297 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/Compass.imageset/compass.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/Contents.json b/Kiwix-iOS/Assets-old.xcassets/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/Cross.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/Cross.imageset/Contents.json new file mode 100644 index 000000000..dbb51abf4 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/Cross.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "close copy.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/Cross.imageset/close copy.png b/Kiwix-iOS/Assets-old.xcassets/Cross.imageset/close copy.png new file mode 100644 index 000000000..2791e3b22 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/Cross.imageset/close copy.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/DownArrow.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/DownArrow.imageset/Contents.json new file mode 100644 index 000000000..72eb496da --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/DownArrow.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "DownArrow.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/DownArrow.imageset/DownArrow.png b/Kiwix-iOS/Assets-old.xcassets/DownArrow.imageset/DownArrow.png new file mode 100644 index 000000000..847bc0176 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/DownArrow.imageset/DownArrow.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/Download.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/Download.imageset/Contents.json new file mode 100644 index 000000000..d28eb8aa4 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/Download.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "download.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/Download.imageset/download.png b/Kiwix-iOS/Assets-old.xcassets/Download.imageset/download.png new file mode 100644 index 000000000..c498ef254 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/Download.imageset/download.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/DownloadCellAccessoryPause.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/DownloadCellAccessoryPause.imageset/Contents.json new file mode 100644 index 000000000..2c94375f5 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/DownloadCellAccessoryPause.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Pause.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/DownloadCellAccessoryPause.imageset/Pause.png b/Kiwix-iOS/Assets-old.xcassets/DownloadCellAccessoryPause.imageset/Pause.png new file mode 100644 index 000000000..54be4bef4 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/DownloadCellAccessoryPause.imageset/Pause.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/DownloadCellAccessoryResume.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/DownloadCellAccessoryResume.imageset/Contents.json new file mode 100644 index 000000000..6af56e75a --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/DownloadCellAccessoryResume.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Resume.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/DownloadCellAccessoryResume.imageset/Resume.png b/Kiwix-iOS/Assets-old.xcassets/DownloadCellAccessoryResume.imageset/Resume.png new file mode 100644 index 000000000..119c3c3de Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/DownloadCellAccessoryResume.imageset/Resume.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/DownloadColor.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/DownloadColor.imageset/Contents.json new file mode 100644 index 000000000..950086ee7 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/DownloadColor.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "arrows.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/DownloadColor.imageset/arrows.png b/Kiwix-iOS/Assets-old.xcassets/DownloadColor.imageset/arrows.png new file mode 100644 index 000000000..808208dbb Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/DownloadColor.imageset/arrows.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/Folder.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/Folder.imageset/Contents.json new file mode 100644 index 000000000..d63de74e1 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/Folder.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "folder.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/Folder.imageset/folder.png b/Kiwix-iOS/Assets-old.xcassets/Folder.imageset/folder.png new file mode 100644 index 000000000..3983760d7 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/Folder.imageset/folder.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/FolderColor.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/FolderColor.imageset/Contents.json new file mode 100644 index 000000000..d63de74e1 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/FolderColor.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "folder.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/FolderColor.imageset/folder.png b/Kiwix-iOS/Assets-old.xcassets/FolderColor.imageset/folder.png new file mode 100644 index 000000000..5e5879f8b Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/FolderColor.imageset/folder.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/GeoPinRound.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/GeoPinRound.imageset/Contents.json new file mode 100644 index 000000000..9fc8426a2 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/GeoPinRound.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "placeholder.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/GeoPinRound.imageset/placeholder.png b/Kiwix-iOS/Assets-old.xcassets/GeoPinRound.imageset/placeholder.png new file mode 100644 index 000000000..6b3e09818 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/GeoPinRound.imageset/placeholder.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/History.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/History.imageset/Contents.json new file mode 100644 index 000000000..4d8c35860 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/History.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "clock.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/History.imageset/clock.png b/Kiwix-iOS/Assets-old.xcassets/History.imageset/clock.png new file mode 100644 index 000000000..3f148da32 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/History.imageset/clock.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/History_filled.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/History_filled.imageset/Contents.json new file mode 100644 index 000000000..df2fa0c05 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/History_filled.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "History_filled.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/History_filled.imageset/History_filled.png b/Kiwix-iOS/Assets-old.xcassets/History_filled.imageset/History_filled.png new file mode 100644 index 000000000..45c095412 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/History_filled.imageset/History_filled.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/LeftArrow.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/LeftArrow.imageset/Contents.json new file mode 100644 index 000000000..a64ecdc1a --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/LeftArrow.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LeftArrow.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/LeftArrow.imageset/LeftArrow.png b/Kiwix-iOS/Assets-old.xcassets/LeftArrow.imageset/LeftArrow.png new file mode 100644 index 000000000..9c897d7a4 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/LeftArrow.imageset/LeftArrow.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/Library/Cloud/Cloud.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/Library/Cloud/Cloud.imageset/Contents.json new file mode 100644 index 000000000..2f941dea7 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/Library/Cloud/Cloud.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "icloud.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/Library/Cloud/Cloud.imageset/icloud.png b/Kiwix-iOS/Assets-old.xcassets/Library/Cloud/Cloud.imageset/icloud.png new file mode 100644 index 000000000..f9671066a Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/Library/Cloud/Cloud.imageset/icloud.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/Library/Cloud/CloudColor.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/Library/Cloud/CloudColor.imageset/Contents.json new file mode 100644 index 000000000..76c3f5c6c --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/Library/Cloud/CloudColor.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "sky.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/Library/Cloud/CloudColor.imageset/sky.png b/Kiwix-iOS/Assets-old.xcassets/Library/Cloud/CloudColor.imageset/sky.png new file mode 100644 index 000000000..d0af4d739 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/Library/Cloud/CloudColor.imageset/sky.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/Library/Cloud/CloudFilled.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/Library/Cloud/CloudFilled.imageset/Contents.json new file mode 100644 index 000000000..44cf83a69 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/Library/Cloud/CloudFilled.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "icloud-filled.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/Library/Cloud/CloudFilled.imageset/icloud-filled.png b/Kiwix-iOS/Assets-old.xcassets/Library/Cloud/CloudFilled.imageset/icloud-filled.png new file mode 100644 index 000000000..2e2d71808 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/Library/Cloud/CloudFilled.imageset/icloud-filled.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/Library/Cloud/Contents.json b/Kiwix-iOS/Assets-old.xcassets/Library/Cloud/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/Library/Cloud/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/Library/Cloud/LanguageFilter.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/Library/Cloud/LanguageFilter.imageset/Contents.json new file mode 100644 index 000000000..b5c4c5f70 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/Library/Cloud/LanguageFilter.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Filter.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/Library/Cloud/LanguageFilter.imageset/Filter.png b/Kiwix-iOS/Assets-old.xcassets/Library/Cloud/LanguageFilter.imageset/Filter.png new file mode 100644 index 000000000..73dc9c2e8 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/Library/Cloud/LanguageFilter.imageset/Filter.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/Library/Cloud/Refresh.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/Library/Cloud/Refresh.imageset/Contents.json new file mode 100644 index 000000000..dfae55790 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/Library/Cloud/Refresh.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "update23.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/Library/Cloud/Refresh.imageset/update23.png b/Kiwix-iOS/Assets-old.xcassets/Library/Cloud/Refresh.imageset/update23.png new file mode 100644 index 000000000..dc7aaca85 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/Library/Cloud/Refresh.imageset/update23.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/Library/Contents.json b/Kiwix-iOS/Assets-old.xcassets/Library/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/Library/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/Library/Library.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/Library/Library.imageset/Contents.json new file mode 100644 index 000000000..7d4e6c93f --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/Library/Library.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Library.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/Library/Library.imageset/Library.png b/Kiwix-iOS/Assets-old.xcassets/Library/Library.imageset/Library.png new file mode 100644 index 000000000..733958819 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/Library/Library.imageset/Library.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/LocalCellAccessory.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/LocalCellAccessory.imageset/Contents.json new file mode 100644 index 000000000..6bab5770e --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/LocalCellAccessory.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "close42.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/LocalCellAccessory.imageset/close42.png b/Kiwix-iOS/Assets-old.xcassets/LocalCellAccessory.imageset/close42.png new file mode 100644 index 000000000..6ff2cd08d Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/LocalCellAccessory.imageset/close42.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/Logo.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/Logo.imageset/Contents.json new file mode 100644 index 000000000..de424f81d --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/Logo.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Kiwix_logo_instaler-2.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/Logo.imageset/Kiwix_logo_instaler-2.png b/Kiwix-iOS/Assets-old.xcassets/Logo.imageset/Kiwix_logo_instaler-2.png new file mode 100644 index 000000000..2cd07160f Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/Logo.imageset/Kiwix_logo_instaler-2.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/MagnifyGlass.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/MagnifyGlass.imageset/Contents.json new file mode 100644 index 000000000..679870066 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/MagnifyGlass.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "magnifying-glass-2.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/MagnifyGlass.imageset/magnifying-glass-2.png b/Kiwix-iOS/Assets-old.xcassets/MagnifyGlass.imageset/magnifying-glass-2.png new file mode 100644 index 000000000..be4a58a31 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/MagnifyGlass.imageset/magnifying-glass-2.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/MainPage.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/MainPage.imageset/Contents.json new file mode 100644 index 000000000..dde12d399 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/MainPage.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "house158.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/MainPage.imageset/house158.png b/Kiwix-iOS/Assets-old.xcassets/MainPage.imageset/house158.png new file mode 100644 index 000000000..e5f62683d Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/MainPage.imageset/house158.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/MainPage_filled.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/MainPage_filled.imageset/Contents.json new file mode 100644 index 000000000..de5932e74 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/MainPage_filled.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "canvas1-small.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/MainPage_filled.imageset/canvas1-small.png b/Kiwix-iOS/Assets-old.xcassets/MainPage_filled.imageset/canvas1-small.png new file mode 100644 index 000000000..923fd5b1c Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/MainPage_filled.imageset/canvas1-small.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/Question.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/Question.imageset/Contents.json new file mode 100644 index 000000000..667086494 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/Question.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "round67.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/Question.imageset/round67.png b/Kiwix-iOS/Assets-old.xcassets/Question.imageset/round67.png new file mode 100644 index 000000000..52c15edb9 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/Question.imageset/round67.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/Recent.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/Recent.imageset/Contents.json new file mode 100644 index 000000000..3136e40ff --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/Recent.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "counterclockwise-rotation.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/Recent.imageset/counterclockwise-rotation.png b/Kiwix-iOS/Assets-old.xcassets/Recent.imageset/counterclockwise-rotation.png new file mode 100644 index 000000000..ce5b3b45d Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/Recent.imageset/counterclockwise-rotation.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/RightArrow.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/RightArrow.imageset/Contents.json new file mode 100644 index 000000000..7af8ad35b --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/RightArrow.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "RightArrow.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/RightArrow.imageset/RightArrow.png b/Kiwix-iOS/Assets-old.xcassets/RightArrow.imageset/RightArrow.png new file mode 100644 index 000000000..28e3498f9 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/RightArrow.imageset/RightArrow.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/SearchRound.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/SearchRound.imageset/Contents.json new file mode 100644 index 000000000..7e2d26a58 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/SearchRound.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "magnifying-glass.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/SearchRound.imageset/magnifying-glass.png b/Kiwix-iOS/Assets-old.xcassets/SearchRound.imageset/magnifying-glass.png new file mode 100644 index 000000000..d60809aed Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/SearchRound.imageset/magnifying-glass.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/SearchScopeControl/Check.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/SearchScopeControl/Check.imageset/Contents.json new file mode 100644 index 000000000..e5c10e383 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/SearchScopeControl/Check.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "success.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/SearchScopeControl/Check.imageset/success.png b/Kiwix-iOS/Assets-old.xcassets/SearchScopeControl/Check.imageset/success.png new file mode 100644 index 000000000..744364180 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/SearchScopeControl/Check.imageset/success.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/SearchScopeControl/CheckBlue.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/SearchScopeControl/CheckBlue.imageset/Contents.json new file mode 100644 index 000000000..0b165efbf --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/SearchScopeControl/CheckBlue.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "success-1.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/SearchScopeControl/CheckBlue.imageset/success-1.png b/Kiwix-iOS/Assets-old.xcassets/SearchScopeControl/CheckBlue.imageset/success-1.png new file mode 100644 index 000000000..9cbdd0aed Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/SearchScopeControl/CheckBlue.imageset/success-1.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/SearchScopeControl/Contents.json b/Kiwix-iOS/Assets-old.xcassets/SearchScopeControl/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/SearchScopeControl/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/SearchSetting.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/SearchSetting.imageset/Contents.json new file mode 100644 index 000000000..f5639fe23 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/SearchSetting.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "SearchSetting.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/SearchSetting.imageset/SearchSetting.png b/Kiwix-iOS/Assets-old.xcassets/SearchSetting.imageset/SearchSetting.png new file mode 100644 index 000000000..4e36f6049 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/SearchSetting.imageset/SearchSetting.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/SearchSetting_filled.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/SearchSetting_filled.imageset/Contents.json new file mode 100644 index 000000000..915b4ecf3 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/SearchSetting_filled.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "SearchSetting_filled.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/SearchSetting_filled.imageset/SearchSetting_filled.png b/Kiwix-iOS/Assets-old.xcassets/SearchSetting_filled.imageset/SearchSetting_filled.png new file mode 100644 index 000000000..183521dcf Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/SearchSetting_filled.imageset/SearchSetting_filled.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/Setting.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/Setting.imageset/Contents.json new file mode 100644 index 000000000..30bf882eb --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/Setting.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "settings@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/Setting.imageset/settings@3x.png b/Kiwix-iOS/Assets-old.xcassets/Setting.imageset/settings@3x.png new file mode 100644 index 000000000..0f1b7d41a Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/Setting.imageset/settings@3x.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/TableOfContent.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/TableOfContent.imageset/Contents.json new file mode 100644 index 000000000..0de111d91 --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/TableOfContent.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "list-1.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/TableOfContent.imageset/list-1.png b/Kiwix-iOS/Assets-old.xcassets/TableOfContent.imageset/list-1.png new file mode 100644 index 000000000..34a6fec4c Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/TableOfContent.imageset/list-1.png differ diff --git a/Kiwix-iOS/Assets-old.xcassets/USBRound.imageset/Contents.json b/Kiwix-iOS/Assets-old.xcassets/USBRound.imageset/Contents.json new file mode 100644 index 000000000..482655cfe --- /dev/null +++ b/Kiwix-iOS/Assets-old.xcassets/USBRound.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "usb-cable.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Kiwix-iOS/Assets-old.xcassets/USBRound.imageset/usb-cable.png b/Kiwix-iOS/Assets-old.xcassets/USBRound.imageset/usb-cable.png new file mode 100644 index 000000000..9928081f5 Binary files /dev/null and b/Kiwix-iOS/Assets-old.xcassets/USBRound.imageset/usb-cable.png differ diff --git a/Kiwix-iOS/Controller/Bookmark/BookmarkControllerAnimator.swift b/Kiwix-iOS/Controller/Bookmark/BookmarkControllerAnimator.swift index b662143e5..14f38f41e 100644 --- a/Kiwix-iOS/Controller/Bookmark/BookmarkControllerAnimator.swift +++ b/Kiwix-iOS/Controller/Bookmark/BookmarkControllerAnimator.swift @@ -28,8 +28,8 @@ class BookmarkControllerAnimator: NSObject, UIViewControllerAnimatedTransitionin } private func animateInTransition(transitionContext: UIViewControllerContextTransitioning) { - guard let containerView = transitionContext.containerView(), - let toController = transitionContext.viewControllerForKey(UITransitionContextToViewControllerKey) as? BookmarkController, + let containerView = transitionContext.containerView() + guard let toController = transitionContext.viewControllerForKey(UITransitionContextToViewControllerKey) as? BookmarkController, let toView = transitionContext.viewForKey(UITransitionContextToViewKey) else {return} let duration = transitionDuration(transitionContext) @@ -54,8 +54,8 @@ class BookmarkControllerAnimator: NSObject, UIViewControllerAnimatedTransitionin } private func animateOutTransition(transitionContext: UIViewControllerContextTransitioning) { - guard let containerView = transitionContext.containerView(), - let fromController = transitionContext.viewControllerForKey(UITransitionContextFromViewControllerKey) as? BookmarkController, + let containerView = transitionContext.containerView() + guard let fromController = transitionContext.viewControllerForKey(UITransitionContextFromViewControllerKey) as? BookmarkController, let fromView = transitionContext.viewForKey(UITransitionContextFromViewKey) else {return} let duration = transitionDuration(transitionContext) diff --git a/Kiwix-iOS/Controller/Library/BookDetailController.swift b/Kiwix-iOS/Controller/Library/BookDetailController.swift new file mode 100644 index 000000000..d768392b7 --- /dev/null +++ b/Kiwix-iOS/Controller/Library/BookDetailController.swift @@ -0,0 +1,116 @@ +// +// BookDetailController.swift +// Kiwix +// +// Created by Chris Li on 8/17/16. +// Copyright © 2016 Chris. All rights reserved. +// + +import UIKit + +class BookDetailController: UITableViewController { + + @IBOutlet weak var favIconImageView: UIImageView! + @IBOutlet weak var titleLabel: UILabel! + + @IBOutlet weak var hasPicIndicator: UILabel! + @IBOutlet weak var hasPicLabel: UILabel! + @IBOutlet weak var hasIndexIndicator: UILabel! + @IBOutlet weak var hasIndexLabel: UILabel! + + var book: Book? + + override func viewDidLoad() { + super.viewDidLoad() + + hasPicIndicator.layer.cornerRadius = 2.0 + hasIndexIndicator.layer.cornerRadius = 2.0 + hasPicIndicator.layer.masksToBounds = true + hasIndexIndicator.layer.masksToBounds = true + } + + override func viewWillAppear(animated: Bool) { + super.viewWillAppear(animated) + configureViews() + } + + func configureViews() { + guard let book = book else {return} + + favIconImageView.image = UIImage(data: book.favIcon ?? NSData()) + titleLabel.text = book.title + + hasPicIndicator.backgroundColor = book.hasPic ? AppColors.hasPicTintColor : UIColor.lightGrayColor() + hasPicLabel.text = book.hasPic ? LocalizedStrings.BookDetail.hasPic : LocalizedStrings.BookDetail.noPic + hasIndexIndicator.backgroundColor = book.hasIndex ? AppColors.hasIndexTintColor : UIColor.lightGrayColor() + hasIndexLabel.text = book.hasIndex ? LocalizedStrings.BookDetail.hasIndex : LocalizedStrings.BookDetail.noIndex + } + + // MARK: - Table view data source + + override func numberOfSectionsInTableView(tableView: UITableView) -> Int { + return 2 + } + + override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + switch section { + case 0: return 3 + case 1: return 3 + default: return 0 + } + } + + override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { + switch (indexPath.section, indexPath.row) { + case (0, 0): + let cell = tableView.dequeueReusableCellWithIdentifier("CenterTextCell", forIndexPath: indexPath) + cell.textLabel?.text = NSLocalizedString("Download Now", comment: LocalizedStrings.BookDetail.comment) + cell.textLabel?.textColor = UIColor.blueColor() + return cell + case (0, 1): + let cell = tableView.dequeueReusableCellWithIdentifier("CenterTextCell", forIndexPath: indexPath) + cell.textLabel?.text = NSLocalizedString("Schedule Download", comment: LocalizedStrings.BookDetail.comment) + cell.textLabel?.textColor = UIColor.blueColor() + return cell + case (0,2): + let cell = tableView.dequeueReusableCellWithIdentifier("TextSwitchCell", forIndexPath: indexPath) as! TextSwitchCell + cell.titleLabel.text = NSLocalizedString("Download Updates Automatically", comment: LocalizedStrings.BookDetail.comment) + return cell + case (1, 0): + let cell = tableView.dequeueReusableCellWithIdentifier("RightDetailCell", forIndexPath: indexPath) + cell.textLabel?.text = NSLocalizedString("Size", comment: LocalizedStrings.BookDetail.comment) + cell.detailTextLabel?.text = book?.fileSizeFormatted + return cell + case (1, 1): + let cell = tableView.dequeueReusableCellWithIdentifier("RightDetailCell", forIndexPath: indexPath) + cell.textLabel?.text = NSLocalizedString("Creation Date", comment: LocalizedStrings.BookDetail.comment) + cell.detailTextLabel?.text = book?.dateFormatted + return cell + case (1, 2): + let cell = tableView.dequeueReusableCellWithIdentifier("RightDetailCell", forIndexPath: indexPath) + cell.textLabel?.text = NSLocalizedString("Article Count", comment: LocalizedStrings.BookDetail.comment) + cell.detailTextLabel?.text = book?.articleCountFormatted + return cell + default: + let cell = tableView.dequeueReusableCellWithIdentifier("RightDetailCell", forIndexPath: indexPath) + return cell + } + } + + override func tableView(tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { + if section == 0 {return 25.0} + return super.tableView(tableView, heightForHeaderInSection: section) + } +} + +extension LocalizedStrings { + class BookDetail { + private static let comment = "Library, Book Detail" + static let hasIndex = NSLocalizedString("Index", comment: comment) + static let hasPic = NSLocalizedString("Pictures", comment: comment) + static let noIndex = NSLocalizedString("No Index", comment: comment) + static let noPic = NSLocalizedString("No Picture", comment: comment) + +// static let noPic = NSLocalizedString("No Picture", comment: comment) + } +} diff --git a/Kiwix-iOS/Controller/Library/CloudBooksController.swift b/Kiwix-iOS/Controller/Library/CloudBooksController.swift new file mode 100644 index 000000000..3732600a5 --- /dev/null +++ b/Kiwix-iOS/Controller/Library/CloudBooksController.swift @@ -0,0 +1,176 @@ +// +// CloudBooksController.swift +// Kiwix +// +// Created by Chris Li on 8/17/16. +// Copyright © 2016 Chris. All rights reserved. +// + +import UIKit +import CoreData + +class CloudBooksController: UITableViewController, NSFetchedResultsControllerDelegate { + + override func viewDidLoad() { + super.viewDidLoad() + title = "" + tabBarItem.title = "Cloud" + tabBarItem.image = UIImage(named: "Cloud") + tabBarItem.selectedImage = UIImage(named: "CloudFilled") + tabBarController?.navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .Add) + clearsSelectionOnViewWillAppear = true + + } + + override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { + guard let identifier = segue.identifier else {return} + switch identifier { + case "ShowBookDetail": + guard let navController = segue.destinationViewController as? UINavigationController, + let bookDetailController = navController.topViewController as? BookDetailController, + let cell = sender as? UITableViewCell, + let indexPath = tableView.indexPathForCell(cell), + let book = fetchedResultController.objectAtIndexPath(indexPath) as? Book else {return} + bookDetailController.book = book + default: + break + } + } + + // MARK: - TableView Data Source + + override func numberOfSectionsInTableView(tableView: UITableView) -> Int { + return fetchedResultController.sections?.count ?? 0 + } + + override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return fetchedResultController.sections?[section].numberOfObjects ?? 0 + } + + override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) + self.configureCell(cell, atIndexPath: indexPath) + return cell + } + + func configureCell(cell: UITableViewCell, atIndexPath indexPath: NSIndexPath) { + guard let book = fetchedResultController.objectAtIndexPath(indexPath) as? Book else {return} + guard let cell = cell as? BasicBookCell else {return} + + cell.titleLabel.text = book.title + cell.hasPic = book.hasPic + cell.hasIndex = false + cell.favIcon.image = UIImage(data: book.favIcon ?? NSData()) + cell.subtitleLabel.text = book.detailedDescription + } + + // MARK: Other Data Source + + override func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? { + guard tableView.numberOfSections > 1 else {return nil} + guard let languageName = fetchedResultController.sections?[section].name else {return nil} + return languageName + } + + override func sectionIndexTitlesForTableView(tableView: UITableView) -> [String]? { + let sectionIndexTitles = fetchedResultController.sectionIndexTitles + guard sectionIndexTitles.count > 2 else {return nil} + return sectionIndexTitles + } + + override func tableView(tableView: UITableView, sectionForSectionIndexTitle title: String, atIndex index: Int) -> Int { + return fetchedResultController.sectionForSectionIndexTitle(title, atIndex: index) + } + + // MARK: - Table View Delegate + + override func tableView(tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { + guard tableView.numberOfSections > 1 else {return 0.0} + guard let headerText = self.tableView(tableView, titleForHeaderInSection: section) else {return 0.0} + guard headerText != "" else {return 0.0} + return 20.0 + } + + override func tableView(tableView: UITableView, willDisplayHeaderView view: UIView, forSection section: Int) { + guard let header = view as? UITableViewHeaderFooterView else {return} + header.textLabel?.font = UIFont.boldSystemFontOfSize(14) + } + + // MARK: - Fetched Results Controller + + let managedObjectContext = UIApplication.appDelegate.managedObjectContext + lazy var fetchedResultController: NSFetchedResultsController = { + let fetchRequest = NSFetchRequest(entityName: "Book") + let langDescriptor = NSSortDescriptor(key: "language.name", ascending: true) + let titleDescriptor = NSSortDescriptor(key: "title", ascending: true) + fetchRequest.sortDescriptors = [langDescriptor, titleDescriptor] + fetchRequest.predicate = self.onlineCompoundPredicate + + let fetchedResultsController = NSFetchedResultsController(fetchRequest: fetchRequest, managedObjectContext: self.managedObjectContext, sectionNameKeyPath: "language.name", cacheName: "OnlineFRC") + fetchedResultsController.delegate = self + fetchedResultsController.performFetch(deleteCache: false) + return fetchedResultsController + }() + + func refreshFetchedResultController() { + fetchedResultController.fetchRequest.predicate = onlineCompoundPredicate + fetchedResultController.performFetch(deleteCache: true) + tableView.reloadData() +// configureMessage() + } + + private var langPredicate: NSPredicate { + let displayedLanguages = Language.fetch(displayed: true, context: managedObjectContext) + if displayedLanguages.count > 0 { + return NSPredicate(format: "language IN %@", displayedLanguages) + } else { + return NSPredicate(format: "language.name != nil") + } + } + + private var onlineCompoundPredicate: NSCompoundPredicate { + let isCloudPredicate = NSPredicate(format: "isLocal == false") + return NSCompoundPredicate(andPredicateWithSubpredicates: [langPredicate, isCloudPredicate]) + } + + // MARK: - Fetched Result Controller Delegate + + func controllerWillChangeContent(controller: NSFetchedResultsController) { + tableView.beginUpdates() + } + + func controller(controller: NSFetchedResultsController, didChangeSection sectionInfo: NSFetchedResultsSectionInfo, atIndex sectionIndex: Int, forChangeType type: NSFetchedResultsChangeType) { + switch type { + case .Insert: + tableView.insertSections(NSIndexSet(index: sectionIndex), withRowAnimation: .Fade) + case .Delete: + tableView.deleteSections(NSIndexSet(index: sectionIndex), withRowAnimation: .Fade) + default: + return + } + } + + func controller(controller: NSFetchedResultsController, didChangeObject anObject: AnyObject, atIndexPath indexPath: NSIndexPath?, forChangeType type: NSFetchedResultsChangeType, newIndexPath: NSIndexPath?) { + switch type { + case .Insert: + guard let newIndexPath = newIndexPath else {return} + tableView.insertRowsAtIndexPaths([newIndexPath], withRowAnimation: .Fade) + case .Delete: + guard let indexPath = indexPath else {return} + tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Fade) + case .Update: + guard let indexPath = indexPath, let cell = tableView.cellForRowAtIndexPath(indexPath) else {return} + configureCell(cell, atIndexPath: indexPath) + case .Move: + guard let indexPath = indexPath, let newIndexPath = newIndexPath else {return} + tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Fade) + tableView.insertRowsAtIndexPaths([newIndexPath], withRowAnimation: .Fade) + } + } + + func controllerDidChangeContent(controller: NSFetchedResultsController) { + tableView.endUpdates() +// configureMessage() + } +} + diff --git a/Kiwix-iOS/Controller/Library/LibrarySplitViewController.swift b/Kiwix-iOS/Controller/Library/LibrarySplitViewController.swift new file mode 100644 index 000000000..adc96aa75 --- /dev/null +++ b/Kiwix-iOS/Controller/Library/LibrarySplitViewController.swift @@ -0,0 +1,35 @@ +// +// LibrarySplitViewController.swift +// Kiwix +// +// Created by Chris Li on 8/17/16. +// Copyright © 2016 Chris. All rights reserved. +// + +import UIKit + +class LibrarySplitViewController: UISplitViewController, UISplitViewControllerDelegate { + override func viewDidLoad() { + super.viewDidLoad() + + preferredDisplayMode = .AllVisible + minimumPrimaryColumnWidth = 320.0 + delegate = self + + configureDismissButton() + } + + func configureDismissButton() { + guard let master = viewControllers.first as? UINavigationController else {return} + let barButtonItem = UIBarButtonItem(image: UIImage(named: "Cross"), style: .Plain, target: self, action: #selector(LibrarySplitViewController.dismiss)) + master.topViewController?.navigationItem.leftBarButtonItem = barButtonItem + } + + func dismiss() { + dismissViewControllerAnimated(true, completion: nil) + } + + func splitViewController(splitViewController: UISplitViewController, collapseSecondaryViewController secondaryViewController: UIViewController, ontoPrimaryViewController primaryViewController: UIViewController) -> Bool { + return true + } +} diff --git a/Kiwix-iOS/Controller/LibraryBackupTBVC.swift b/Kiwix-iOS/Controller/LibraryBackupTBVC.swift index 29759e032..ffede5723 100644 --- a/Kiwix-iOS/Controller/LibraryBackupTBVC.swift +++ b/Kiwix-iOS/Controller/LibraryBackupTBVC.swift @@ -16,7 +16,7 @@ class LibraryBackupTBVC: UITableViewController { super.viewDidLoad() title = NSLocalizedString("Backup", comment: "Setting: Backup local files title") toggle.addTarget(self, action: #selector(LibraryBackupTBVC.switcherValueChanged(_:)), forControlEvents: .ValueChanged) - toggle.on = !(FileManager.getSkipBackupAttribute(item: FileManager.docDirURL) ?? false) + toggle.on = !(FileManager.getSkipBackupAttribute(item: NSFileManager.docDirURL) ?? false) } // MARK: - Table view data source @@ -48,7 +48,7 @@ class LibraryBackupTBVC: UITableViewController { func switcherValueChanged(switcher: UISwitch) { guard switcher == toggle else {return} - FileManager.setSkipBackupAttribute(!switcher.on, url: FileManager.docDirURL) + FileManager.setSkipBackupAttribute(!switcher.on, url: NSFileManager.docDirURL) } } diff --git a/Kiwix-iOS/Controller/LibraryDownloadTBVC.swift b/Kiwix-iOS/Controller/LibraryDownloadTBVC.swift index fa3d20dcb..a12ede2f7 100644 --- a/Kiwix-iOS/Controller/LibraryDownloadTBVC.swift +++ b/Kiwix-iOS/Controller/LibraryDownloadTBVC.swift @@ -169,7 +169,7 @@ class LibraryDownloadTBVC: UITableViewController, NSFetchedResultsControllerDele let cell = cell as? DownloadBookCell else {return} cell.titleLabel.text = book.title - cell.hasPicIndicator.backgroundColor = book.hasPic ? UIColor.havePicTintColor : UIColor.lightGrayColor() + cell.hasPicIndicator.backgroundColor = book.hasPic ? AppColors.hasPicTintColor : UIColor.lightGrayColor() cell.favIcon.image = UIImage(data: book.favIcon ?? NSData()) cell.dateLabel.text = book.dateFormatted cell.articleCountLabel.text = book.articleCountFormatted diff --git a/Kiwix-iOS/Controller/LibraryLocalTBVC.swift b/Kiwix-iOS/Controller/LibraryLocalTBVC.swift index b689fe275..adf50b982 100644 --- a/Kiwix-iOS/Controller/LibraryLocalTBVC.swift +++ b/Kiwix-iOS/Controller/LibraryLocalTBVC.swift @@ -190,7 +190,7 @@ class LibraryLocalTBVC: UITableViewController, NSFetchedResultsControllerDelegat FileManager.removeItem(atURL: zimURL) let indexFolderURL = zimURL.URLByAppendingPathExtension("idx") - FileManager.removeItem(atURL: indexFolderURL) + FileManager.removeItem(atURL: indexFolderURL!) } if let _ = book.url { diff --git a/Kiwix-iOS/Controller/LibraryOnlineTBVC.swift b/Kiwix-iOS/Controller/LibraryOnlineTBVC.swift index ae848170e..c582f891e 100644 --- a/Kiwix-iOS/Controller/LibraryOnlineTBVC.swift +++ b/Kiwix-iOS/Controller/LibraryOnlineTBVC.swift @@ -101,7 +101,7 @@ class LibraryOnlineTBVC: UITableViewController, NSFetchedResultsControllerDelega } } else { guard !Preference.libraryHasShownPreferredLanguagePrompt else {return} - let operation = RefreshLibraryLanguageFilterAlert(libraryOnlineTBVC: self) + let operation = RefreshLibraryLanguageFilterAlert(presentationContext: self) GlobalOperationQueue.sharedInstance.addOperation(operation) } } @@ -245,7 +245,7 @@ class LibraryOnlineTBVC: UITableViewController, NSFetchedResultsControllerDelega guard let cell = cell as? CloudBookCell else {return} cell.titleLabel.text = book.title - cell.hasPicIndicator.backgroundColor = book.hasPic ? UIColor.havePicTintColor : UIColor.lightGrayColor() + cell.hasPicIndicator.backgroundColor = book.hasPic ? AppColors.hasPicTintColor : UIColor.lightGrayColor() cell.favIcon.image = UIImage(data: book.favIcon ?? NSData()) cell.delegate = self cell.subtitleLabel.text = booksShowingDetail.contains(book) ? book.detailedDescription2 : book.detailedDescription diff --git a/Kiwix-iOS/Controller/LibraryTabBarController.swift b/Kiwix-iOS/Controller/LibraryTabBarController.swift index 2e667bfbe..a9150282b 100644 --- a/Kiwix-iOS/Controller/LibraryTabBarController.swift +++ b/Kiwix-iOS/Controller/LibraryTabBarController.swift @@ -9,6 +9,8 @@ import UIKit class LibraryTabBarController: UITabBarController { + @IBAction func dismissSelf(sender: UIBarButtonItem) { + } override func viewWillLayoutSubviews() { super.viewWillLayoutSubviews() diff --git a/Kiwix-iOS/Controller/Main/MainController.swift b/Kiwix-iOS/Controller/Main/MainController.swift index c3d5a8bef..29641d1bf 100644 --- a/Kiwix-iOS/Controller/Main/MainController.swift +++ b/Kiwix-iOS/Controller/Main/MainController.swift @@ -8,7 +8,7 @@ // import UIKit -import PSOperations +import Operations class MainController: UIViewController { @@ -23,6 +23,7 @@ class MainController: UIViewController { var bookmarkController: BookmarkController? var bookmarkNav: UIViewController? var libraryController: UIViewController? + var libraryNewController: UIViewController? var settingController: UIViewController? var searchController: SearchController? var welcomeController: UIViewController? diff --git a/Kiwix-iOS/Controller/Main/MainControllerDelegates.swift b/Kiwix-iOS/Controller/Main/MainControllerDelegates.swift index 08f3292ae..b24f19c73 100644 --- a/Kiwix-iOS/Controller/Main/MainControllerDelegates.swift +++ b/Kiwix-iOS/Controller/Main/MainControllerDelegates.swift @@ -112,7 +112,7 @@ extension MainController: LPTBarButtonItemDelegate, TableOfContentsDelegate, Zim func webViewDidFinishLoad(webView: UIWebView) { guard let url = webView.request?.URL else {return} - guard url.scheme.caseInsensitiveCompare("Kiwix") == .OrderedSame else {return} + guard url.scheme!.caseInsensitiveCompare("Kiwix") == .OrderedSame else {return} let title = webView.stringByEvaluatingJavaScriptFromString("document.title") let managedObjectContext = UIApplication.appDelegate.managedObjectContext @@ -293,4 +293,4 @@ class HTMLHeading { var scrollToJavaScript: String { return "document.getElementById('\(id)').scrollIntoView();" } -} \ No newline at end of file +} diff --git a/Kiwix-iOS/Controller/Main/MainControllerShowHide.swift b/Kiwix-iOS/Controller/Main/MainControllerShowHide.swift index ff660daff..7e0b95443 100644 --- a/Kiwix-iOS/Controller/Main/MainControllerShowHide.swift +++ b/Kiwix-iOS/Controller/Main/MainControllerShowHide.swift @@ -60,7 +60,8 @@ extension MainController { let views = ["SearchController": searchController.view] view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|[SearchController]|", options: .AlignAllCenterY, metrics: nil, views: views)) - view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:|[SearchController]|", options: .AlignAllCenterX, metrics: nil, views: views)) + view.addConstraint(searchController.view.topAnchor.constraintEqualToAnchor(topLayoutGuide.bottomAnchor)) + view.addConstraint(searchController.view.bottomAnchor.constraintEqualToAnchor(bottomLayoutGuide.topAnchor)) if animated { searchController.view.alpha = 0.5 @@ -191,8 +192,8 @@ extension MainController { func showGetStartedAlert() { guard !Preference.hasShowGetStartedAlert else {return} - let operation = GetStartedAlert(mainController: self) + let operation = GetStartedAlert(presentationContext: self) GlobalOperationQueue.sharedInstance.addOperation(operation) Preference.hasShowGetStartedAlert = true } -} \ No newline at end of file +} diff --git a/Kiwix-iOS/Controller/SearchResultTBVC.swift b/Kiwix-iOS/Controller/SearchResultTBVC.swift index dbf0b58a2..0da2ea668 100644 --- a/Kiwix-iOS/Controller/SearchResultTBVC.swift +++ b/Kiwix-iOS/Controller/SearchResultTBVC.swift @@ -97,7 +97,7 @@ class SearchResultTBVC: UIViewController, UITableViewDataSource, UITableViewDele } else { cell.titleLabel.text = result.title } - cell.hasPicIndicator.backgroundColor = book.hasPic ? UIColor.havePicTintColor : UIColor.lightGrayColor() + cell.hasPicIndicator.backgroundColor = book.hasPic ? AppColors.hasPicTintColor : UIColor.lightGrayColor() cell.favIcon.image = book.favIcon != nil ? UIImage(data: book.favIcon!) : nil } diff --git a/Kiwix-iOS/Controller/SettingTBVC.swift b/Kiwix-iOS/Controller/SettingTBVC.swift index db4bd6924..1b36e9c66 100644 --- a/Kiwix-iOS/Controller/SettingTBVC.swift +++ b/Kiwix-iOS/Controller/SettingTBVC.swift @@ -67,7 +67,7 @@ class SettingTBVC: UITableViewController { case NSIndexPath(forRow: 1, inSection: 0): return Preference.libraryRefreshAllowCellularData ? LocalizedStrings.on : LocalizedStrings.off case NSIndexPath(forRow: 2, inSection: 0): - guard let skipBackup = FileManager.getSkipBackupAttribute(item: FileManager.docDirURL) else {return ""} + guard let skipBackup = FileManager.getSkipBackupAttribute(item: NSFileManager.docDirURL) else {return ""} return skipBackup ? LocalizedStrings.off: LocalizedStrings.on case NSIndexPath(forRow: 0, inSection: 1): return String.formattedPercentString(Preference.webViewZoomScale / 100) diff --git a/Kiwix-iOS/Info.plist b/Kiwix-iOS/Info.plist index 77c6331cd..5b064f37f 100644 --- a/Kiwix-iOS/Info.plist +++ b/Kiwix-iOS/Info.plist @@ -32,7 +32,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.7 + 1.7.1 CFBundleSignature ???? CFBundleURLTypes @@ -49,7 +49,7 @@ CFBundleVersion - 1.7.697 + 1.7.776 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS @@ -69,6 +69,8 @@ + NSCalendarsUsageDescription + Kiwix does NOT need to have access your Calendar UIApplicationShortcutItems diff --git a/Kiwix-iOS/Model/Network.swift b/Kiwix-iOS/Model/Network.swift index e980e32a8..5115c2189 100644 --- a/Kiwix-iOS/Model/Network.swift +++ b/Kiwix-iOS/Model/Network.swift @@ -7,7 +7,7 @@ // import CoreData -import PSOperations +import Operations class Network: NSObject, NSURLSessionDelegate, NSURLSessionDownloadDelegate, NSURLSessionTaskDelegate, OperationQueueDelegate { static let sharedInstance = Network() @@ -66,13 +66,74 @@ class Network: NSObject, NSURLSessionDelegate, NSURLSessionDownloadDelegate, NSU } func resume(book: Book) { - guard let resumeData = FileManager.readResumeData(book) else { - // TODO: Alert - print("Could not resume, data mmissing / damaged") - return + if #available(iOS 10, *) { + func correctResuleData(data: NSData?) -> NSData? { + let kResumeCurrentRequest = "NSURLSessionResumeCurrentRequest" + let kResumeOriginalRequest = "NSURLSessionResumeOriginalRequest" + + guard let data = data, let resumeDictionary = (try? NSPropertyListSerialization.propertyListWithData(data, options: [.MutableContainersAndLeaves], format: nil)) as? NSMutableDictionary else { + return nil + } + + resumeDictionary[kResumeCurrentRequest] = correctFuckingRequestData(resumeDictionary[kResumeCurrentRequest] as? NSData) + resumeDictionary[kResumeOriginalRequest] = correctFuckingRequestData(resumeDictionary[kResumeOriginalRequest] as? NSData) + + let result = try? NSPropertyListSerialization.dataWithPropertyList(resumeDictionary, format: NSPropertyListFormat.XMLFormat_v1_0, options: NSPropertyListWriteOptions()) + return result + } + func correctFuckingRequestData(data: NSData?) -> NSData? { + guard let data = data else { + return nil + } + guard let archive = (try? NSPropertyListSerialization.propertyListWithData(data, options: [.MutableContainersAndLeaves], format: nil)) as? NSMutableDictionary else { + return nil + } + // Rectify weird __nsurlrequest_proto_props objects to $number pattern + var i = 0 + while archive["$objects"]?[1].objectForKey("__nsurlrequest_proto_prop_obj_\(i)") != nil { + let arr = archive["$objects"] as? NSMutableArray + if let dic = arr?[1] as? NSMutableDictionary, let obj = dic["__nsurlrequest_proto_prop_obj_\(i)"] { + dic.setObject(obj, forKey: "$\(i + 3)") + dic.removeObjectForKey("__nsurlrequest_proto_prop_obj_\(i)") + arr?[1] = dic + archive["$objects"] = arr + } + i += 1 + } + if archive["$objects"]?[1]["__nsurlrequest_proto_props"] != nil { + let arr = archive["$objects"] as? NSMutableArray + if let dic = arr?[1] as? NSMutableDictionary, let obj = dic["__nsurlrequest_proto_props"] { + dic.setObject(obj, forKey: "$\(i + 3)") + dic.removeObjectForKey("__nsurlrequest_proto_props") + arr?[1] = dic + archive["$objects"] = arr + } + } + // Rectify weird "NSKeyedArchiveRootObjectKey" top key to NSKeyedArchiveRootObjectKey = "root" + if archive["$top"]?["NSKeyedArchiveRootObjectKey"] != nil { + archive["$top"]?.setObject(archive["$top"]?["NSKeyedArchiveRootObjectKey"], forKey: NSKeyedArchiveRootObjectKey) + archive["$top"]?.removeObjectForKey("NSKeyedArchiveRootObjectKey") + } + // Re-encode archived object + let result = try? NSPropertyListSerialization.dataWithPropertyList(archive, format: NSPropertyListFormat.BinaryFormat_v1_0, options: NSPropertyListWriteOptions()) + return result + } + guard let resumeData = correctResuleData(FileManager.readResumeData(book)) else { + // TODO: Alert + print("Could not resume, data mmissing / damaged") + return + } + let task = session.downloadTaskWithResumeData(resumeData) + startTask(task, book: book) + } else { + guard let resumeData = FileManager.readResumeData(book) else { + // TODO: Alert + print("Could not resume, data mmissing / damaged") + return + } + let task = session.downloadTaskWithResumeData(resumeData) + startTask(task, book: book) } - let task = session.downloadTaskWithResumeData(resumeData) - startTask(task, book: book) } func pause(book: Book) { @@ -106,7 +167,7 @@ class Network: NSObject, NSURLSessionDelegate, NSURLSessionDownloadDelegate, NSU // MARK: - OperationQueueDelegate - func operationQueue(operationQueue: OperationQueue, willAddOperation operation: NSOperation) { + func operationQueue(queue: OperationQueue, willAddOperation operation: NSOperation) { guard operationQueue.operationCount == 0 else {return} shouldReportProgress = true NSOperationQueue.mainQueue().addOperationWithBlock { () -> Void in @@ -114,7 +175,9 @@ class Network: NSObject, NSURLSessionDelegate, NSURLSessionDownloadDelegate, NSU } } - func operationQueue(operationQueue: OperationQueue, operationDidFinish operation: NSOperation, withErrors errors: [NSError]) { + func operationQueue(queue: OperationQueue, willFinishOperation operation: NSOperation, withErrors errors: [ErrorType]) {} + + func operationQueue(queue: OperationQueue, didFinishOperation operation: NSOperation, withErrors errors: [ErrorType]) { guard operationQueue.operationCount == 1 else {return} NSOperationQueue.mainQueue().addOperationWithBlock { () -> Void in self.timer?.invalidate() @@ -122,6 +185,8 @@ class Network: NSObject, NSURLSessionDelegate, NSURLSessionDownloadDelegate, NSU } } + func operationQueue(queue: OperationQueue, willProduceOperation operation: NSOperation) {} + // MARK: - NSURLSessionDelegate func URLSessionDidFinishEventsForBackgroundURLSession(session: NSURLSession) { diff --git a/Kiwix-iOS/Model/Utilities.swift b/Kiwix-iOS/Model/Utilities.swift index a897bbf62..f78a0d1fc 100644 --- a/Kiwix-iOS/Model/Utilities.swift +++ b/Kiwix-iOS/Model/Utilities.swift @@ -35,17 +35,3 @@ class Utilities: NSObject { } } } - -extension UIDevice { - class var availableDiskSpace: Int64? { - do { - let docDirPath = NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory.DocumentDirectory, NSSearchPathDomainMask.UserDomainMask, true).first! - let systemAttributes = try NSFileManager.defaultManager().attributesOfFileSystemForPath(docDirPath) - guard let freeSize = systemAttributes[NSFileSystemFreeSize] as? NSNumber else {return nil} - return freeSize.longLongValue - } catch let error as NSError { - print("Fetch system disk free space failed, error: \(error.localizedDescription)") - return nil - } - } -} \ No newline at end of file diff --git a/Kiwix-iOS/Storyboard/Library.storyboard b/Kiwix-iOS/Storyboard/Library.storyboard index 6f749e337..443de606c 100644 --- a/Kiwix-iOS/Storyboard/Library.storyboard +++ b/Kiwix-iOS/Storyboard/Library.storyboard @@ -1,9 +1,10 @@ - - + + - + + @@ -14,7 +15,7 @@ - + @@ -34,48 +35,43 @@ - + - + - + - + - - - + - @@ -140,7 +136,7 @@ - + @@ -165,28 +161,27 @@ - + - + - + - + - - + @@ -1000,8 +565,5 @@ - - - diff --git a/Kiwix-iOS/View/TableViewCells.swift b/Kiwix-iOS/View/TableViewCells.swift index d4b468fd9..857d516f0 100644 --- a/Kiwix-iOS/View/TableViewCells.swift +++ b/Kiwix-iOS/View/TableViewCells.swift @@ -8,35 +8,45 @@ import UIKit -// MARK: - Book Cells +// MARK: - Book Cells (new) /* Book Cell With P & I indicator */ class BasicBookCell: UITableViewCell { - private let hasPicIndicatorOrange = UIColor(red: 1, green: 0.5, blue: 0, alpha: 1) - private let hasIndexIndicatorBlue = UIColor(red: 0.304706, green: 0.47158, blue: 1, alpha: 1) + + @IBOutlet weak var favIcon: UIImageView! + @IBOutlet weak var titleLabel: UILabel! + @IBOutlet weak var subtitleLabel: UILabel! + @IBOutlet weak private var hasPicIndicator: UILabel! + @IBOutlet weak private var hasIndexIndicator: UILabel! + + // MARK: - Override override func awakeFromNib() { hasPicIndicator.layer.cornerRadius = 2.0 hasIndexIndicator.layer.cornerRadius = 2.0 hasPicIndicator.layer.masksToBounds = true hasIndexIndicator.layer.masksToBounds = true + hasPicIndicator.backgroundColor = UIColor.clearColor() + hasIndexIndicator.backgroundColor = UIColor.clearColor() } - @IBOutlet weak var favIcon: UIImageView! - @IBOutlet weak var titleLabel: UILabel! - @IBOutlet weak var subtitleLabel: UILabel! - @IBOutlet weak var hasPicIndicator: UILabel! - @IBOutlet weak var hasIndexIndicator: UILabel! + override func prepareForReuse() { + super.prepareForReuse() + selected = false + highlighted = false + } + + // MARK: - Shorthand properties var hasPic: Bool = false { didSet { - hasPicIndicator.backgroundColor = hasPic ? hasPicIndicatorOrange : UIColor.lightGrayColor() + hasPicIndicator.layer.backgroundColor = hasPic ? AppColors.hasPicTintColor.CGColor : UIColor.lightGrayColor().CGColor } } var hasIndex: Bool = false { didSet { - hasIndexIndicator.backgroundColor = hasIndex ? hasIndexIndicatorBlue : UIColor.lightGrayColor() + hasIndexIndicator.layer.backgroundColor = hasIndex ? AppColors.hasIndexTintColor.CGColor : UIColor.lightGrayColor().CGColor } } } @@ -169,4 +179,11 @@ class BookmarkSnippetCell: BookmarkCell { protocol TableCellDelegate: class { func didTapOnAccessoryViewForCell(cell: UITableViewCell) +} + +// MARK: - General + +class TextSwitchCell: UITableViewCell { + @IBOutlet weak var titleLabel: UILabel! + @IBOutlet weak var switchControl: UISwitch! } \ No newline at end of file diff --git a/Kiwix-iOS/iOSExtensions.swift b/Kiwix-iOS/iOSExtensions.swift index ad200e576..33f79aa01 100644 --- a/Kiwix-iOS/iOSExtensions.swift +++ b/Kiwix-iOS/iOSExtensions.swift @@ -49,6 +49,7 @@ extension UIApplication { extension UIStoryboard { class var library: UIStoryboard {get {return UIStoryboard(name: "Library", bundle: nil)}} + class var libraryNew: UIStoryboard {get {return UIStoryboard(name: "LibraryNew", 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)}} @@ -72,15 +73,17 @@ extension UIStoryboard { } extension UIColor { - class var havePicTintColor: UIColor { - return UIColor(red: 255.0/255.0, green: 153.0/255.0, blue: 51.0/255.0, alpha: 1.0) - } class var themeColor: UIColor { return UIColor(red: 71.0 / 255.0, green: 128.0 / 255.0, blue: 182.0 / 255.0, alpha: 1.0) } } +class AppColors { + static let hasPicTintColor = UIColor(red: 1, green: 0.5, blue: 0, alpha: 1) + static let hasIndexTintColor = UIColor(red: 0.304706, green: 0.47158, blue: 1, alpha: 1) +} + extension UITableView { func setBackgroundText(text: String?) { @@ -94,58 +97,6 @@ extension UITableView { } } -extension UINavigationBar { - func hideBottomHairline() { - let navigationBarImageView = hairlineImageViewInNavigationBar(self) - navigationBarImageView!.hidden = true - } - - func showBottomHairline() { - let navigationBarImageView = hairlineImageViewInNavigationBar(self) - navigationBarImageView!.hidden = false - } - - private func hairlineImageViewInNavigationBar(view: UIView) -> UIImageView? { - if view.isKindOfClass(UIImageView) && view.bounds.height <= 1.0 { - return (view as! UIImageView) - } - - let subviews = (view.subviews as [UIView]) - for subview: UIView in subviews { - if let imageView: UIImageView = hairlineImageViewInNavigationBar(subview) { - return imageView - } - } - return nil - } -} - -extension UIToolbar { - func hideHairline() { - let navigationBarImageView = hairlineImageViewInToolbar(self) - navigationBarImageView!.hidden = true - } - - func showHairline() { - let navigationBarImageView = hairlineImageViewInToolbar(self) - navigationBarImageView!.hidden = false - } - - private func hairlineImageViewInToolbar(view: UIView) -> UIImageView? { - if view.isKindOfClass(UIImageView) && view.bounds.height <= 1.0 { - return (view as! UIImageView) - } - - let subviews = (view.subviews as [UIView]) - for subview: UIView in subviews { - if let imageView: UIImageView = hairlineImageViewInToolbar(subview) { - return imageView - } - } - return nil - } -} - // MARK: - View Controller extension UIAlertController { @@ -153,4 +104,4 @@ extension UIAlertController { self.init(title: title, message: message , preferredStyle: style) for action in actions {addAction(action)} } -} \ No newline at end of file +} diff --git a/Kiwix-iOSUITests/SnapshotAutomation.swift b/Kiwix-iOSUITests/SnapshotAutomation.swift deleted file mode 100644 index 457545369..000000000 --- a/Kiwix-iOSUITests/SnapshotAutomation.swift +++ /dev/null @@ -1,57 +0,0 @@ -// -// KiwixUITests.swift -// KiwixUITests -// -// Created by Chris on 12/11/15. -// Copyright © 2015 Chris. All rights reserved. -// - -import XCTest - -class SnapshotAutomation: XCTestCase { - - override func setUp() { - super.setUp() - - continueAfterFailure = false - XCUIApplication().launch() - - let app = XCUIApplication() - if app.alerts.count > 0 { - app.alerts["Welcome to Kiwix"].collectionViews.buttons["Dismiss"].tap() - } - - snapshot("01WelcomeScreen") - - if app.toolbars.buttons["Library"].exists { - // iPhone - app.toolbars.buttons["Library"].tap() - sleep(4) - if app.alerts.count > 0 { - app.alerts["Only Show Preferred Language?"].collectionViews.buttons["OK"].tap() - } - snapshot("02LibraryScreen") - } else { - // iPad - app.navigationBars["Kiwix.MainController"].childrenMatchingType(.Button).elementBoundByIndex(4).tap() - sleep(4) - if app.alerts.count > 0 { - app.alerts["Only Show Preferred Language?"].collectionViews.buttons["OK"].tap() - } - snapshot("02LibraryScreen") - } - - - } - - override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. - super.tearDown() - } - - func testExample() { - // Use recording to get started writing UI tests. - // Use XCTAssert and related functions to verify your tests produce the correct results. - } - -} diff --git a/Kiwix-iOSUITests/SnapshotHelper.swift b/Kiwix-iOSUITests/SnapshotHelper.swift deleted file mode 100644 index e534eb329..000000000 --- a/Kiwix-iOSUITests/SnapshotHelper.swift +++ /dev/null @@ -1,129 +0,0 @@ -// -// SnapshotHelper.swift -// Example -// -// Created by Felix Krause on 10/8/15. -// Copyright © 2015 Felix Krause. All rights reserved. -// - -import Foundation -import XCTest - -var deviceLanguage = "" -var locale = "" - -@available(*, deprecated, message="use setupSnapshot: instead") -func setLanguage(app: XCUIApplication) { - setupSnapshot(app) -} - -func setupSnapshot(app: XCUIApplication) { - Snapshot.setupSnapshot(app) -} - -func snapshot(name: String, waitForLoadingIndicator: Bool = true) { - Snapshot.snapshot(name, waitForLoadingIndicator: waitForLoadingIndicator) -} - -public class Snapshot: NSObject { - - public class func setupSnapshot(app: XCUIApplication) { - setLanguage(app) - setLocale(app) - setLaunchArguments(app) - } - - class func setLanguage(app: XCUIApplication) { - guard let prefix = pathPrefix() else { - return - } - - let path = prefix.stringByAppendingPathComponent("language.txt") - - do { - let trimCharacterSet = NSCharacterSet.whitespaceAndNewlineCharacterSet() - deviceLanguage = try NSString(contentsOfFile: path, encoding: NSUTF8StringEncoding).stringByTrimmingCharactersInSet(trimCharacterSet) as String - app.launchArguments += ["-AppleLanguages", "(\(deviceLanguage))"] - } catch { - print("Couldn't detect/set language...") - } - } - - class func setLocale(app: XCUIApplication) { - guard let prefix = pathPrefix() else { - return - } - - let path = prefix.stringByAppendingPathComponent("locale.txt") - - do { - let trimCharacterSet = NSCharacterSet.whitespaceAndNewlineCharacterSet() - locale = try NSString(contentsOfFile: path, encoding: NSUTF8StringEncoding).stringByTrimmingCharactersInSet(trimCharacterSet) as String - } catch { - print("Couldn't detect/set locale...") - } - if locale.isEmpty { - locale = NSLocale(localeIdentifier: deviceLanguage).localeIdentifier - } - app.launchArguments += ["-AppleLocale", "\"\(locale)\""] - } - - class func setLaunchArguments(app: XCUIApplication) { - guard let prefix = pathPrefix() else { - return - } - - let path = prefix.stringByAppendingPathComponent("snapshot-launch_arguments.txt") - app.launchArguments += ["-FASTLANE_SNAPSHOT", "YES", "-ui_testing"] - - do { - let launchArguments = try NSString(contentsOfFile: path, encoding: NSUTF8StringEncoding) as String - let regex = try NSRegularExpression(pattern: "(\\\".+?\\\"|\\S+)", options: []) - let matches = regex.matchesInString(launchArguments, options: [], range: NSRange(location:0, length:launchArguments.characters.count)) - let results = matches.map { result -> String in - (launchArguments as NSString).substringWithRange(result.range) - } - app.launchArguments += results - } catch { - print("Couldn't detect/set launch_arguments...") - } - } - - public class func snapshot(name: String, waitForLoadingIndicator: Bool = true) { - if waitForLoadingIndicator { - waitForLoadingIndicatorToDisappear() - } - - print("snapshot: \(name)") // more information about this, check out https://github.com/fastlane/snapshot - - sleep(1) // Waiting for the animation to be finished (kind of) - XCUIDevice.sharedDevice().orientation = .Unknown - } - - class func waitForLoadingIndicatorToDisappear() { - let query = XCUIApplication().statusBars.childrenMatchingType(.Other).elementBoundByIndex(1).childrenMatchingType(.Other) - - while (0.. NSString? { - if let path = NSProcessInfo().environment["SIMULATOR_HOST_HOME"] as NSString? { - return path.stringByAppendingPathComponent("Library/Caches/tools.fastlane") - } - print("Couldn't find Snapshot configuration files at ~/Library/Caches/tools.fastlane") - return nil - } -} - -extension XCUIElement { - var isLoadingIndicator: Bool { - return self.frame.size == CGSize(width: 10, height: 20) - } -} - -// Please don't remove the lines below -// They are used to detect outdated configuration files -// SnapshotHelperVersion [1.2] diff --git a/Kiwix-iOSWidgets/Bookmarks/Info.plist b/Kiwix-iOSWidgets/Bookmarks/Info.plist index 102ec56a5..76fd6d1bc 100644 --- a/Kiwix-iOSWidgets/Bookmarks/Info.plist +++ b/Kiwix-iOSWidgets/Bookmarks/Info.plist @@ -17,11 +17,11 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 1.7 + 1.7.1 CFBundleSignature ???? CFBundleVersion - 1.7.697 + 1.7.776 NSExtension NSExtensionMainStoryboard diff --git a/Kiwix-iOSWidgets/Bookmarks/TodayViewController.swift b/Kiwix-iOSWidgets/Bookmarks/TodayViewController.swift index 19d1e8ba1..32da0850e 100644 --- a/Kiwix-iOSWidgets/Bookmarks/TodayViewController.swift +++ b/Kiwix-iOSWidgets/Bookmarks/TodayViewController.swift @@ -72,7 +72,7 @@ class TodayViewController: UIViewController, NCWidgetProviding, UICollectionView itemSize = CGSizeMake(itemWidth, itemHeight) rowCount = min(ceil(CGFloat(bookmarks.count) / CGFloat(itemsPerRow)), maxRowCount) - let collectionViewHeight = itemHeight * rowCount + hInset * rowCount + let collectionViewHeight = itemHeight * rowCount + hInset * (rowCount - 1) preferredContentSize = CGSizeMake(0, max(1, collectionViewHeight)) } @@ -114,6 +114,9 @@ class TodayViewController: UIViewController, NCWidgetProviding, UICollectionView cell.label.text = title cell.imageView.image = UIImage(data: thumbImageData) + if #available(iOS 10.0, *) { + cell.label.textColor = UIColor.darkTextColor() + } } // MARK: - UICollectionViewDelegate diff --git a/Kiwix.xcodeproj/project.pbxproj b/Kiwix.xcodeproj/project.pbxproj index 414ffd90c..7acc51e56 100644 --- a/Kiwix.xcodeproj/project.pbxproj +++ b/Kiwix.xcodeproj/project.pbxproj @@ -10,7 +10,6 @@ 7356F9FACBB84380CFC8F68F /* Pods_Kiwix_iOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EC884ACBBA260AF741C4C4FE /* Pods_Kiwix_iOS.framework */; }; 970C3DCA1CBD79450026A240 /* MigrationPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 970C3DC91CBD79450026A240 /* MigrationPolicy.swift */; }; 970C61971D34243600087758 /* URLSessionDownloadTaskOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 970C61961D34243600087758 /* URLSessionDownloadTaskOperation.swift */; }; - 970C61991D3429E400087758 /* ReachabilityCondition.swift in Sources */ = {isa = PBXBuildFile; fileRef = 970C61981D3429E400087758 /* ReachabilityCondition.swift */; }; 970C65501D398D5A007032F8 /* BookmarkControllerAnimator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 970C654F1D398D5A007032F8 /* BookmarkControllerAnimator.swift */; }; 970E68B21D37E1DD001E8514 /* SettingSearchTuneController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 970E68B11D37E1DD001E8514 /* SettingSearchTuneController.swift */; }; 970E68B61D37E224001E8514 /* SettingSearchHistoryTBVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 970E68B51D37E224001E8514 /* SettingSearchHistoryTBVC.swift */; }; @@ -58,6 +57,7 @@ 9711879A1CEB546C00B9909D /* CoreDataExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 971187991CEB546C00B9909D /* CoreDataExtension.swift */; }; 9711879B1CEB546C00B9909D /* CoreDataExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 971187991CEB546C00B9909D /* CoreDataExtension.swift */; }; 971187A91CEB694400B9909D /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 971187A81CEB694400B9909D /* WebKit.framework */; }; + 971329B21D84F117003676F9 /* liblzma.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 971329B11D84F117003676F9 /* liblzma.a */; }; 971A10161D022872007FC62C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 971A10151D022872007FC62C /* Assets.xcassets */; }; 971A101D1D0228E8007FC62C /* adjustlayoutiPad.js in Resources */ = {isa = PBXBuildFile; fileRef = 971A101A1D0228E8007FC62C /* adjustlayoutiPad.js */; }; 971A101E1D0228E8007FC62C /* adjustlayoutiPhone.js in Resources */ = {isa = PBXBuildFile; fileRef = 971A101B1D0228E8007FC62C /* adjustlayoutiPhone.js */; }; @@ -102,7 +102,6 @@ 973BCD011CEB3FA500F10B44 /* Kiwix_OSXTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 973BCD001CEB3FA500F10B44 /* Kiwix_OSXTests.swift */; }; 973BCD0C1CEB3FA500F10B44 /* Kiwix_OSXUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 973BCD0B1CEB3FA500F10B44 /* Kiwix_OSXUITests.swift */; }; 973BCD1A1CEB402900F10B44 /* KiwixTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 973BCD181CEB402900F10B44 /* KiwixTests.swift */; }; - 973BCD1E1CEB403700F10B44 /* SnapshotAutomation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 973BCD1C1CEB403700F10B44 /* SnapshotAutomation.swift */; }; 973C8D5C1C25F945007272F9 /* Preference.swift in Sources */ = {isa = PBXBuildFile; fileRef = 973C8D5B1C25F945007272F9 /* Preference.swift */; }; 973DD40F1D343F2F009D45DB /* libicudata.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 973DD4041D343F2F009D45DB /* libicudata.a */; }; 973DD4101D343F2F009D45DB /* libicui18n.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 973DD4051D343F2F009D45DB /* libicui18n.a */; }; @@ -112,7 +111,6 @@ 973DD4141D343F2F009D45DB /* libicutest.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 973DD4091D343F2F009D45DB /* libicutest.a */; }; 973DD4151D343F2F009D45DB /* libicutu.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 973DD40A1D343F2F009D45DB /* libicutu.a */; }; 973DD4161D343F2F009D45DB /* libicuuc.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 973DD40B1D343F2F009D45DB /* libicuuc.a */; }; - 973DD4171D343F2F009D45DB /* liblzma.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 973DD40C1D343F2F009D45DB /* liblzma.a */; }; 973DD4181D343F2F009D45DB /* libxapian.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 973DD40D1D343F2F009D45DB /* libxapian.a */; }; 973DD4191D343F2F009D45DB /* libzim.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 973DD40E1D343F2F009D45DB /* libzim.a */; }; 973DD41D1D34428F009D45DB /* DirectoryMonitor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 973DD41A1D34428F009D45DB /* DirectoryMonitor.swift */; }; @@ -133,8 +131,6 @@ 975227A11D020C00001D1DDE /* resourceTools.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 975227961D020C00001D1DDE /* resourceTools.cpp */; }; 975227A21D020C00001D1DDE /* stringTools.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 975227971D020C00001D1DDE /* stringTools.cpp */; settings = {COMPILER_FLAGS = "-w"; }; }; 975227A31D020C00001D1DDE /* stringTools.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 975227971D020C00001D1DDE /* stringTools.cpp */; settings = {COMPILER_FLAGS = "-w"; }; }; - 975227A81D020C2E001D1DDE /* htmlparse.cc in Sources */ = {isa = PBXBuildFile; fileRef = 975227A61D020C2E001D1DDE /* htmlparse.cc */; }; - 975227A91D020C2E001D1DDE /* myhtmlparse.cc in Sources */ = {isa = PBXBuildFile; fileRef = 975227A71D020C2E001D1DDE /* myhtmlparse.cc */; }; 975227AC1D020D83001D1DDE /* ZimIndexer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 975227AB1D020D83001D1DDE /* ZimIndexer.mm */; }; 975227AE1D0213D3001D1DDE /* xapianIndexer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 975227AD1D0213D3001D1DDE /* xapianIndexer.cpp */; settings = {COMPILER_FLAGS = "-w"; }; }; 975227B01D021539001D1DDE /* IndexerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 975227AF1D021539001D1DDE /* IndexerController.swift */; }; @@ -146,11 +142,11 @@ 975334CB1CEB6A43007ED50B /* Preference.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 975334CA1CEB6A43007ED50B /* Preference.storyboard */; }; 975334D01CEB6AE3007ED50B /* PreferenceGeneralController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 975334CF1CEB6AE3007ED50B /* PreferenceGeneralController.swift */; }; 975334D21CEB6B01007ED50B /* LibraryController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 975334D11CEB6B01007ED50B /* LibraryController.swift */; }; - 97587A961D1061C0006EE1AA /* SnapshotHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97587A951D1061C0006EE1AA /* SnapshotHelper.swift */; }; 975B90F91CEB75CB00D13906 /* ZimFilesController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 975B90F81CEB75CB00D13906 /* ZimFilesController.swift */; }; 975B90FE1CEB909100D13906 /* iOSExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 975B90FD1CEB909100D13906 /* iOSExtensions.swift */; }; 975B90FF1CEB909900D13906 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9779987A1C1E1C9600B1DD5E /* Extensions.swift */; }; 975B912F1CEB9B0F00D13906 /* Preference.swift in Sources */ = {isa = PBXBuildFile; fileRef = 973C8D5B1C25F945007272F9 /* Preference.swift */; }; + 9763275E1D64FE0F0034F120 /* BookDetailController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9763275D1D64FE0F0034F120 /* BookDetailController.swift */; }; 9763A6291CEB9E55008A2718 /* OSXExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9763A6281CEB9E55008A2718 /* OSXExtensions.swift */; }; 9763A62D1CEBA524008A2718 /* FileManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97E891681CA976E90001CA32 /* FileManager.swift */; }; 976AB2671CBD8B3D00B06EB0 /* 1.5.xcmappingmodel in Sources */ = {isa = PBXBuildFile; fileRef = 976AB2661CBD8B3D00B06EB0 /* 1.5.xcmappingmodel */; }; @@ -160,9 +156,7 @@ 977998771C1E0B7900B1DD5E /* Article+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 977998711C1E0B7900B1DD5E /* Article+CoreDataProperties.swift */; }; 977998781C1E0B7900B1DD5E /* Language+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 977998721C1E0B7900B1DD5E /* Language+CoreDataProperties.swift */; }; 9779987B1C1E1C9600B1DD5E /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9779987A1C1E1C9600B1DD5E /* Extensions.swift */; }; - 9779A1C81D34225E0071EFAB /* AlertOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9779A1C21D34225E0071EFAB /* AlertOperation.swift */; }; 9779A1C91D34225E0071EFAB /* GlobalOperationQueue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9779A1C31D34225E0071EFAB /* GlobalOperationQueue.swift */; }; - 9779A1CA1D34225E0071EFAB /* NetworkObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9779A1C41D34225E0071EFAB /* NetworkObserver.swift */; }; 9779A1CB1D34225E0071EFAB /* RefreshLibraryOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9779A1C51D34225E0071EFAB /* RefreshLibraryOperation.swift */; }; 9779A1CC1D34225E0071EFAB /* SearchOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9779A1C61D34225E0071EFAB /* SearchOperation.swift */; }; 9779A1CD1D34225E0071EFAB /* UIOperations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9779A1C71D34225E0071EFAB /* UIOperations.swift */; }; @@ -183,6 +177,9 @@ 97BA32A51CEBC36300339A47 /* RootWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97BA32A31CEBC29500339A47 /* RootWindowController.swift */; }; 97BAA8EC1D3D2D7B0038F57F /* PacketAnalyzer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97BAA8EB1D3D2D7B0038F57F /* PacketAnalyzer.swift */; }; 97BAA8EE1D3D2D9B0038F57F /* KiwixURLProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97BAA8ED1D3D2D9B0038F57F /* KiwixURLProtocol.swift */; }; + 97C005D61D64B3B0004352E8 /* LibraryNew.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C005D51D64B3B0004352E8 /* LibraryNew.storyboard */; }; + 97C005D81D64B99E004352E8 /* LibrarySplitViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97C005D71D64B99E004352E8 /* LibrarySplitViewController.swift */; }; + 97C005DC1D64BEFE004352E8 /* CloudBooksController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97C005DB1D64BEFE004352E8 /* CloudBooksController.swift */; }; 97D452BC1D16FF010033666F /* RecentSearchCVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D452BB1D16FF010033666F /* RecentSearchCVC.swift */; }; 97D452BE1D1723FF0033666F /* CollectionViewCells.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D452BD1D1723FF0033666F /* CollectionViewCells.swift */; }; 97D55EF61D2075180081B523 /* TableOfContentsController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D55EF51D2075180081B523 /* TableOfContentsController.swift */; }; @@ -275,7 +272,6 @@ 6DCB0E958A1083CA248C5A12 /* Pods-Kiwix-OSX.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Kiwix-OSX.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Kiwix-OSX/Pods-Kiwix-OSX.debug.xcconfig"; sourceTree = ""; }; 970C3DC91CBD79450026A240 /* MigrationPolicy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MigrationPolicy.swift; path = CoreData/Migration/MigrationPolicy.swift; sourceTree = ""; }; 970C61961D34243600087758 /* URLSessionDownloadTaskOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = URLSessionDownloadTaskOperation.swift; path = Operations/URLSessionDownloadTaskOperation.swift; sourceTree = ""; }; - 970C61981D3429E400087758 /* ReachabilityCondition.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReachabilityCondition.swift; sourceTree = ""; }; 970C654F1D398D5A007032F8 /* BookmarkControllerAnimator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = BookmarkControllerAnimator.swift; path = "Kiwix-iOS/Controller/Bookmark/BookmarkControllerAnimator.swift"; sourceTree = SOURCE_ROOT; }; 970E68B11D37E1DD001E8514 /* SettingSearchTuneController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SettingSearchTuneController.swift; path = "Kiwix-iOS/Controller/Setting/SettingSearchTuneController.swift"; sourceTree = SOURCE_ROOT; }; 970E68B51D37E224001E8514 /* SettingSearchHistoryTBVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SettingSearchHistoryTBVC.swift; path = "Kiwix-iOS/Controller/Setting/SettingSearchHistoryTBVC.swift"; sourceTree = SOURCE_ROOT; }; @@ -302,6 +298,7 @@ 9711878C1CEB541100B9909D /* Kiwix.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Kiwix.xcdatamodel; sourceTree = ""; }; 971187991CEB546C00B9909D /* CoreDataExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CoreDataExtension.swift; path = Kiwix/CoreData/CoreDataExtension.swift; sourceTree = ""; }; 971187A81CEB694400B9909D /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/WebKit.framework; sourceTree = DEVELOPER_DIR; }; + 971329B11D84F117003676F9 /* liblzma.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = liblzma.a; path = Kiwix/libkiwix/iOS/liblzma.a; sourceTree = ""; }; 971A10151D022872007FC62C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = "Kiwix-iOS/Assets.xcassets"; sourceTree = SOURCE_ROOT; }; 971A101A1D0228E8007FC62C /* adjustlayoutiPad.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = adjustlayoutiPad.js; sourceTree = ""; }; 971A101B1D0228E8007FC62C /* adjustlayoutiPhone.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = adjustlayoutiPhone.js; sourceTree = ""; }; @@ -356,7 +353,6 @@ 973BCD171CEB402900F10B44 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = "Kiwix-iOSTests/Info.plist"; sourceTree = SOURCE_ROOT; }; 973BCD181CEB402900F10B44 /* KiwixTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = KiwixTests.swift; path = "Kiwix-iOSTests/KiwixTests.swift"; sourceTree = SOURCE_ROOT; }; 973BCD1B1CEB403700F10B44 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = "Kiwix-iOSUITests/Info.plist"; sourceTree = SOURCE_ROOT; }; - 973BCD1C1CEB403700F10B44 /* SnapshotAutomation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SnapshotAutomation.swift; path = "Kiwix-iOSUITests/SnapshotAutomation.swift"; sourceTree = SOURCE_ROOT; }; 973C8D5B1C25F945007272F9 /* Preference.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Preference.swift; path = Kiwix/Preference.swift; sourceTree = ""; }; 973DD4041D343F2F009D45DB /* libicudata.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libicudata.a; path = Kiwix/libkiwix/iOS/libicudata.a; sourceTree = ""; }; 973DD4051D343F2F009D45DB /* libicui18n.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libicui18n.a; path = Kiwix/libkiwix/iOS/libicui18n.a; sourceTree = ""; }; @@ -366,7 +362,6 @@ 973DD4091D343F2F009D45DB /* libicutest.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libicutest.a; path = Kiwix/libkiwix/iOS/libicutest.a; sourceTree = ""; }; 973DD40A1D343F2F009D45DB /* libicutu.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libicutu.a; path = Kiwix/libkiwix/iOS/libicutu.a; sourceTree = ""; }; 973DD40B1D343F2F009D45DB /* libicuuc.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libicuuc.a; path = Kiwix/libkiwix/iOS/libicuuc.a; sourceTree = ""; }; - 973DD40C1D343F2F009D45DB /* liblzma.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = liblzma.a; path = Kiwix/libkiwix/iOS/liblzma.a; sourceTree = ""; }; 973DD40D1D343F2F009D45DB /* libxapian.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libxapian.a; path = Kiwix/libkiwix/iOS/libxapian.a; sourceTree = ""; }; 973DD40E1D343F2F009D45DB /* libzim.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libzim.a; path = Kiwix/libkiwix/iOS/libzim.a; sourceTree = ""; }; 973DD41A1D34428F009D45DB /* DirectoryMonitor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = DirectoryMonitor.swift; path = ZimMultiReader/DirectoryMonitor.swift; sourceTree = ""; }; @@ -377,8 +372,6 @@ 973DD4271D36E3E4009D45DB /* SettingSingleSwitchTBVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SettingSingleSwitchTBVC.swift; path = "Kiwix-iOS/Controller/Setting/SettingSingleSwitchTBVC.swift"; sourceTree = SOURCE_ROOT; }; 97497B5A1D07487000ECD691 /* indexer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = indexer.h; path = "Kiwix/libkiwix/C&C++/indexer.h"; sourceTree = ""; }; 97497B5B1D07487000ECD691 /* resourceTools.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = resourceTools.h; path = "Kiwix/libkiwix/C&C++/resourceTools.h"; sourceTree = ""; }; - 97497B5C1D074FB800ECD691 /* htmlparse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = htmlparse.h; path = "Kiwix/libkiwix/C&C++/xapian/htmlparse.h"; sourceTree = ""; }; - 97497B5D1D074FB800ECD691 /* myhtmlparse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = myhtmlparse.h; path = "Kiwix/libkiwix/C&C++/xapian/myhtmlparse.h"; sourceTree = ""; }; 97497B5E1D07584100ECD691 /* xapianIndexer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = xapianIndexer.h; path = "Kiwix/libkiwix/C&C++/xapianIndexer.h"; sourceTree = ""; }; 974F42811D47E19A00F8074C /* SettingWidgetBookmarksTBVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SettingWidgetBookmarksTBVC.swift; path = "Kiwix-iOS/Controller/Setting/SettingWidgetBookmarksTBVC.swift"; sourceTree = SOURCE_ROOT; }; 975227811D020560001D1DDE /* Indexer.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Indexer.storyboard; path = "Kiwix-OSX/StoryBoards/Indexer.storyboard"; sourceTree = SOURCE_ROOT; }; @@ -388,8 +381,6 @@ 975227951D020C00001D1DDE /* reader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = reader.cpp; path = "Kiwix/libkiwix/C&C++/reader.cpp"; sourceTree = ""; tabWidth = 2; }; 975227961D020C00001D1DDE /* resourceTools.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = resourceTools.cpp; path = "Kiwix/libkiwix/C&C++/resourceTools.cpp"; sourceTree = ""; }; 975227971D020C00001D1DDE /* stringTools.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = stringTools.cpp; path = "Kiwix/libkiwix/C&C++/stringTools.cpp"; sourceTree = ""; }; - 975227A61D020C2E001D1DDE /* htmlparse.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = htmlparse.cc; path = "Kiwix/libkiwix/C&C++/xapian/htmlparse.cc"; sourceTree = ""; }; - 975227A71D020C2E001D1DDE /* myhtmlparse.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = myhtmlparse.cc; path = "Kiwix/libkiwix/C&C++/xapian/myhtmlparse.cc"; sourceTree = ""; }; 975227AA1D020D83001D1DDE /* ZimIndexer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ZimIndexer.h; path = Kiwix/libkiwix/ZimIndexer.h; sourceTree = ""; }; 975227AB1D020D83001D1DDE /* ZimIndexer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ZimIndexer.mm; path = Kiwix/libkiwix/ZimIndexer.mm; sourceTree = ""; }; 975227AD1D0213D3001D1DDE /* xapianIndexer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = xapianIndexer.cpp; path = "Kiwix/libkiwix/C&C++/xapianIndexer.cpp"; sourceTree = ""; tabWidth = 2; }; @@ -402,9 +393,9 @@ 975334CA1CEB6A43007ED50B /* Preference.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Preference.storyboard; path = "Kiwix-OSX/StoryBoards/Preference.storyboard"; sourceTree = SOURCE_ROOT; }; 975334CF1CEB6AE3007ED50B /* PreferenceGeneralController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = PreferenceGeneralController.swift; path = "Kiwix-OSX/Controllers/PreferenceGeneralController.swift"; sourceTree = SOURCE_ROOT; }; 975334D11CEB6B01007ED50B /* LibraryController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = LibraryController.swift; path = "Kiwix-OSX/Controllers/LibraryController.swift"; sourceTree = SOURCE_ROOT; }; - 97587A951D1061C0006EE1AA /* SnapshotHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SnapshotHelper.swift; path = "Kiwix-iOSUITests/SnapshotHelper.swift"; sourceTree = SOURCE_ROOT; }; 975B90F81CEB75CB00D13906 /* ZimFilesController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ZimFilesController.swift; path = "Kiwix-OSX/Controllers/ZimFilesController.swift"; sourceTree = SOURCE_ROOT; }; 975B90FD1CEB909100D13906 /* iOSExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = iOSExtensions.swift; path = "Kiwix-iOS/iOSExtensions.swift"; sourceTree = SOURCE_ROOT; }; + 9763275D1D64FE0F0034F120 /* BookDetailController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BookDetailController.swift; sourceTree = ""; }; 9763A6281CEB9E55008A2718 /* OSXExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OSXExtensions.swift; path = "Kiwix-OSX/OSXExtensions.swift"; sourceTree = SOURCE_ROOT; }; 976A0C801D41619C0006A742 /* DZNEmptyDataSet.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DZNEmptyDataSet.framework; path = "../../../../Users/chrisli/Library/Developer/Xcode/DerivedData/Kiwix-ayxrfhaqnfxzendihdolvkklkmhk/Build/Products/Debug-iphoneos/DZNEmptyDataSet/DZNEmptyDataSet.framework"; sourceTree = ""; }; 976AB2661CBD8B3D00B06EB0 /* 1.5.xcmappingmodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcmappingmodel; name = 1.5.xcmappingmodel; path = CoreData/Migration/1.5.xcmappingmodel; sourceTree = ""; }; @@ -414,9 +405,7 @@ 977998711C1E0B7900B1DD5E /* Article+CoreDataProperties.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "Article+CoreDataProperties.swift"; path = "Kiwix/CoreData/Article+CoreDataProperties.swift"; sourceTree = ""; }; 977998721C1E0B7900B1DD5E /* Language+CoreDataProperties.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "Language+CoreDataProperties.swift"; path = "Kiwix/CoreData/Language+CoreDataProperties.swift"; sourceTree = ""; }; 9779987A1C1E1C9600B1DD5E /* Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Extensions.swift; path = Kiwix/Extensions.swift; sourceTree = ""; }; - 9779A1C21D34225E0071EFAB /* AlertOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AlertOperation.swift; path = Operations/AlertOperation.swift; sourceTree = ""; }; 9779A1C31D34225E0071EFAB /* GlobalOperationQueue.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = GlobalOperationQueue.swift; path = Operations/GlobalOperationQueue.swift; sourceTree = ""; }; - 9779A1C41D34225E0071EFAB /* NetworkObserver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = NetworkObserver.swift; path = Operations/NetworkObserver.swift; sourceTree = ""; }; 9779A1C51D34225E0071EFAB /* RefreshLibraryOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = RefreshLibraryOperation.swift; path = Operations/RefreshLibraryOperation.swift; sourceTree = ""; }; 9779A1C61D34225E0071EFAB /* SearchOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SearchOperation.swift; path = Operations/SearchOperation.swift; sourceTree = ""; }; 9779A1C71D34225E0071EFAB /* UIOperations.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UIOperations.swift; path = Operations/UIOperations.swift; sourceTree = ""; }; @@ -440,10 +429,14 @@ 97BAA8EB1D3D2D7B0038F57F /* PacketAnalyzer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = PacketAnalyzer.swift; path = Kiwix/URLProtocol/PacketAnalyzer.swift; sourceTree = ""; }; 97BAA8ED1D3D2D9B0038F57F /* KiwixURLProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = KiwixURLProtocol.swift; path = Kiwix/URLProtocol/KiwixURLProtocol.swift; sourceTree = ""; }; 97BAA8EF1D3D32770038F57F /* 1.7.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = 1.7.xcdatamodel; sourceTree = ""; }; + 97C005D51D64B3B0004352E8 /* LibraryNew.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LibraryNew.storyboard; path = "Kiwix-iOS/Storyboard/LibraryNew.storyboard"; sourceTree = SOURCE_ROOT; }; + 97C005D71D64B99E004352E8 /* LibrarySplitViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = LibrarySplitViewController.swift; path = "Kiwix-iOS/Controller/Library/LibrarySplitViewController.swift"; sourceTree = SOURCE_ROOT; }; + 97C005DB1D64BEFE004352E8 /* CloudBooksController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CloudBooksController.swift; sourceTree = ""; }; 97D452BB1D16FF010033666F /* RecentSearchCVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = RecentSearchCVC.swift; path = "Kiwix-iOS/Controller/Search/RecentSearchCVC.swift"; sourceTree = SOURCE_ROOT; }; 97D452BD1D1723FF0033666F /* CollectionViewCells.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CollectionViewCells.swift; sourceTree = ""; }; 97D452C01D1871E70033666F /* SearchLocalBooksCVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = SearchLocalBooksCVC.swift; path = "Kiwix-iOS/Controller/Search/SearchLocalBooksCVC.swift"; sourceTree = SOURCE_ROOT; }; 97D452C11D1871E70033666F /* SearchTabController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = SearchTabController.swift; path = "Kiwix-iOS/Controller/Search/SearchTabController.swift"; sourceTree = SOURCE_ROOT; }; + 97D527451D836116008D6E44 /* liblzma.5.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = liblzma.5.tbd; path = usr/lib/liblzma.5.tbd; sourceTree = SDKROOT; }; 97D55EF51D2075180081B523 /* TableOfContentsController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TableOfContentsController.swift; path = "Kiwix-iOS/Controller/TableOfContentsController.swift"; sourceTree = SOURCE_ROOT; }; 97DB65D91D4576B600A2CC42 /* BookmarkWidgetCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BookmarkWidgetCell.swift; sourceTree = ""; }; 97E609F01D103DED00EBCB9D /* NotificationCenter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NotificationCenter.framework; path = System/Library/Frameworks/NotificationCenter.framework; sourceTree = SDKROOT; }; @@ -505,6 +498,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 971329B21D84F117003676F9 /* liblzma.a in Frameworks */, 973DD40F1D343F2F009D45DB /* libicudata.a in Frameworks */, 973DD4101D343F2F009D45DB /* libicui18n.a in Frameworks */, 973DD4111D343F2F009D45DB /* libicuio.a in Frameworks */, @@ -513,7 +507,6 @@ 973DD4141D343F2F009D45DB /* libicutest.a in Frameworks */, 973DD4151D343F2F009D45DB /* libicutu.a in Frameworks */, 973DD4161D343F2F009D45DB /* libicuuc.a in Frameworks */, - 973DD4171D343F2F009D45DB /* liblzma.a in Frameworks */, 973DD4181D343F2F009D45DB /* libxapian.a in Frameworks */, 973DD4191D343F2F009D45DB /* libzim.a in Frameworks */, 9711871E1CEB449A00B9909D /* libz.tbd in Frameworks */, @@ -541,6 +534,7 @@ 931D277C156AE671D3F9EADA /* Frameworks */ = { isa = PBXGroup; children = ( + 97D527451D836116008D6E44 /* liblzma.5.tbd */, 976A0C801D41619C0006A742 /* DZNEmptyDataSet.framework */, 973DD4041D343F2F009D45DB /* libicudata.a */, 973DD4051D343F2F009D45DB /* libicui18n.a */, @@ -550,8 +544,8 @@ 973DD4091D343F2F009D45DB /* libicutest.a */, 973DD40A1D343F2F009D45DB /* libicutu.a */, 973DD40B1D343F2F009D45DB /* libicuuc.a */, - 973DD40C1D343F2F009D45DB /* liblzma.a */, 973DD40D1D343F2F009D45DB /* libxapian.a */, + 971329B11D84F117003676F9 /* liblzma.a */, 973DD40E1D343F2F009D45DB /* libzim.a */, 97E609F01D103DED00EBCB9D /* NotificationCenter.framework */, 198ECFA618CDD6B29CD462A0 /* Pods_Kiwix_OSX.framework */, @@ -713,13 +707,13 @@ isa = PBXGroup; children = ( 971A10241D022AD5007FC62C /* BarButtonItems.swift */, - 971A10261D022AD5007FC62C /* TableViewCells.swift */, 97D452BD1D1723FF0033666F /* CollectionViewCells.swift */, 971A10271D022AD5007FC62C /* Logo.swift */, 971A10281D022AD5007FC62C /* LTBarButtonItem.swift */, 971A10291D022AD5007FC62C /* RefreshHUD.swift */, 971A102A1D022AD5007FC62C /* SearchBar.swift */, 97E60A011D10423A00EBCB9D /* ShadowViews.swift */, + 971A10261D022AD5007FC62C /* TableViewCells.swift */, ); path = View; sourceTree = ""; @@ -784,7 +778,6 @@ isa = PBXGroup; children = ( 9711872D1CEB507600B9909D /* CoreData */, - 9779987A1C1E1C9600B1DD5E /* Extensions.swift */, 97163D321CD7E79F008BE2D6 /* Help Docs */, 971187051CEB426E00B9909D /* libkiwix */, 97E5712A1CA0525300FF4F1D /* Operation */, @@ -795,20 +788,10 @@ name = Shared; sourceTree = ""; }; - 973DD4031D343F09009D45DB /* Basic */ = { - isa = PBXGroup; - children = ( - 9779A1C21D34225E0071EFAB /* AlertOperation.swift */, - 9779A1C41D34225E0071EFAB /* NetworkObserver.swift */, - 970C61981D3429E400087758 /* ReachabilityCondition.swift */, - 9779A1C71D34225E0071EFAB /* UIOperations.swift */, - ); - name = Basic; - sourceTree = ""; - }; 973DD4261D36E395009D45DB /* Tools */ = { isa = PBXGroup; children = ( + 9779987A1C1E1C9600B1DD5E /* Extensions.swift */, 97E891681CA976E90001CA32 /* FileManager.swift */, 973C8D5B1C25F945007272F9 /* Preference.swift */, 979C51511CECA9AF001707F2 /* StringTools.swift */, @@ -841,10 +824,6 @@ 975227921D020C00001D1DDE /* indexer.cpp */, 97497B5E1D07584100ECD691 /* xapianIndexer.h */, 975227AD1D0213D3001D1DDE /* xapianIndexer.cpp */, - 97497B5C1D074FB800ECD691 /* htmlparse.h */, - 975227A61D020C2E001D1DDE /* htmlparse.cc */, - 97497B5D1D074FB800ECD691 /* myhtmlparse.h */, - 975227A71D020C2E001D1DDE /* myhtmlparse.cc */, 975227931D020C00001D1DDE /* otherTools.cpp */, ); name = indexer; @@ -947,6 +926,7 @@ children = ( 975227CA1D0227E8001D1DDE /* Main.storyboard */, 975227C91D0227E8001D1DDE /* Library.storyboard */, + 97C005D51D64B3B0004352E8 /* LibraryNew.storyboard */, 97F03CE11D2440470040D26E /* Search.storyboard */, 975227CB1D0227E8001D1DDE /* Setting.storyboard */, 9734E54D1D289D060061C39B /* Welcome.storyboard */, @@ -959,6 +939,7 @@ isa = PBXGroup; children = ( 9749A1B21C430653000F2D1E /* Bookmark */, + 97C005D41D64B369004352E8 /* Library */, 978C588C1C1CD5080077AE47 /* LibraryTBVC */, 972B007D1C35DBAB00B5FDC5 /* Main */, 97E108221C5D5A0D00E27FD3 /* Search */, @@ -967,7 +948,7 @@ 97A7017E1D2C59CA00AAE2D8 /* GetStartedController.swift */, ); name = Controllers; - path = Kiwix; + path = Controller; sourceTree = ""; }; 978C588B1C1CD1E30077AE47 /* Model */ = { @@ -1058,8 +1039,6 @@ isa = PBXGroup; children = ( 973BCD1B1CEB403700F10B44 /* Info.plist */, - 973BCD1C1CEB403700F10B44 /* SnapshotAutomation.swift */, - 97587A951D1061C0006EE1AA /* SnapshotHelper.swift */, ); name = "Kiwix-iOSUITests"; path = KiwixUITests; @@ -1074,6 +1053,16 @@ name = URLProtocol; sourceTree = ""; }; + 97C005D41D64B369004352E8 /* Library */ = { + isa = PBXGroup; + children = ( + 97C005D71D64B99E004352E8 /* LibrarySplitViewController.swift */, + 97C005DB1D64BEFE004352E8 /* CloudBooksController.swift */, + 9763275D1D64FE0F0034F120 /* BookDetailController.swift */, + ); + path = Library; + sourceTree = ""; + }; 97C01FCA1C39B7F100D010E5 /* Library */ = { isa = PBXGroup; children = ( @@ -1108,11 +1097,11 @@ 97E5712A1CA0525300FF4F1D /* Operation */ = { isa = PBXGroup; children = ( - 973DD4031D343F09009D45DB /* Basic */, 9779A1C31D34225E0071EFAB /* GlobalOperationQueue.swift */, 9779A1C51D34225E0071EFAB /* RefreshLibraryOperation.swift */, 973DD4241D344558009D45DB /* ScanLocalBookOperation.swift */, 9779A1C61D34225E0071EFAB /* SearchOperation.swift */, + 9779A1C71D34225E0071EFAB /* UIOperations.swift */, 971C4F0D1D400F010027B7D2 /* UpdateWidgetDataSourceOperation.swift */, 970C61961D34243600087758 /* URLSessionDownloadTaskOperation.swift */, ); @@ -1295,7 +1284,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0730; + LastUpgradeCheck = 0800; ORGANIZATIONNAME = Chris; TargetAttributes = { 973BCCE81CEB3FA400F10B44 = { @@ -1312,6 +1301,7 @@ 9779C3121D4575AD0064CC8E = { CreatedOnToolsVersion = 7.3.1; DevelopmentTeam = L7HWM3SP3L; + LastSwiftMigration = 0800; SystemCapabilities = { com.apple.ApplicationGroups.iOS = { enabled = 1; @@ -1321,6 +1311,7 @@ 97A2AB871C1B80FF00052E74 = { CreatedOnToolsVersion = 7.2; DevelopmentTeam = L7HWM3SP3L; + LastSwiftMigration = 0800; SystemCapabilities = { com.apple.ApplicationGroups.iOS = { enabled = 1; @@ -1335,10 +1326,12 @@ }; 97A2AB9E1C1B80FF00052E74 = { CreatedOnToolsVersion = 7.2; + LastSwiftMigration = 0800; TestTargetID = 97A2AB871C1B80FF00052E74; }; 97A2ABA91C1B810000052E74 = { CreatedOnToolsVersion = 7.2; + LastSwiftMigration = 0800; TestTargetID = 97A2AB871C1B80FF00052E74; }; }; @@ -1420,6 +1413,7 @@ 971A10801D022F74007FC62C /* Pic_I.png in Resources */, 971A101E1D0228E8007FC62C /* adjustlayoutiPhone.js in Resources */, 975227CC1D0227E8001D1DDE /* Library.storyboard in Resources */, + 97C005D61D64B3B0004352E8 /* LibraryNew.storyboard in Resources */, 971A107F1D022F74007FC62C /* ImportBookLearnMore.html in Resources */, 971A107E1D022F74007FC62C /* DownloaderLearnMore.html in Resources */, ); @@ -1582,7 +1576,6 @@ 975B912F1CEB9B0F00D13906 /* Preference.swift in Sources */, 971187941CEB541A00B9909D /* Article.swift in Sources */, 9752279D1D020C00001D1DDE /* pathTools.cpp in Sources */, - 975227A91D020C2E001D1DDE /* myhtmlparse.cc in Sources */, 975227B01D021539001D1DDE /* IndexerController.swift in Sources */, 975334D01CEB6AE3007ED50B /* PreferenceGeneralController.swift in Sources */, 979CB6C81D05CF37005E1BA1 /* SearchResultController.swift in Sources */, @@ -1596,7 +1589,6 @@ 975334D21CEB6B01007ED50B /* LibraryController.swift in Sources */, 975227AC1D020D83001D1DDE /* ZimIndexer.mm in Sources */, 975227A11D020C00001D1DDE /* resourceTools.cpp in Sources */, - 975227A81D020C2E001D1DDE /* htmlparse.cc in Sources */, 971187971CEB542500B9909D /* Article+CoreDataProperties.swift in Sources */, 975227A31D020C00001D1DDE /* stringTools.cpp in Sources */, 979C518D1CECAE4C001707F2 /* PreferenceWindowController.swift in Sources */, @@ -1656,6 +1648,7 @@ 971A103F1D022C42007FC62C /* LibraryAutoRefreshTBVC.swift in Sources */, 970E68B61D37E224001E8514 /* SettingSearchHistoryTBVC.swift in Sources */, 971A10581D022DAD007FC62C /* LibraryDownloadTBVC.swift in Sources */, + 97C005D81D64B99E004352E8 /* LibrarySplitViewController.swift in Sources */, 973DD4231D3443A3009D45DB /* ExtensionAndTypealias.swift in Sources */, 97A7017F1D2C59CA00AAE2D8 /* GetStartedController.swift in Sources */, 979C51521CECA9AF001707F2 /* StringTools.swift in Sources */, @@ -1676,6 +1669,7 @@ 971A10701D022E62007FC62C /* Network.swift in Sources */, 974F42821D47E19A00F8074C /* SettingWidgetBookmarksTBVC.swift in Sources */, 970E68B21D37E1DD001E8514 /* SettingSearchTuneController.swift in Sources */, + 97C005DC1D64BEFE004352E8 /* CloudBooksController.swift in Sources */, 971A104A1D022CBE007FC62C /* SearchResultTBVC.swift in Sources */, 971A105B1D022DAD007FC62C /* LibraryOnlineTBVC.swift in Sources */, 9779A1CB1D34225E0071EFAB /* RefreshLibraryOperation.swift in Sources */, @@ -1685,7 +1679,6 @@ 970C3DCA1CBD79450026A240 /* MigrationPolicy.swift in Sources */, 97E891691CA976E90001CA32 /* FileManager.swift in Sources */, 97E60A061D10504000EBCB9D /* LibraryBackupTBVC.swift in Sources */, - 9779A1CA1D34225E0071EFAB /* NetworkObserver.swift in Sources */, 971A105C1D022DAD007FC62C /* LibraryTabBarController.swift in Sources */, 971A10461D022CB2007FC62C /* SearchController.swift in Sources */, 9779987B1C1E1C9600B1DD5E /* Extensions.swift in Sources */, @@ -1704,7 +1697,6 @@ 971A102F1D022AD5007FC62C /* Logo.swift in Sources */, 97D55EF61D2075180081B523 /* TableOfContentsController.swift in Sources */, 9722122B1D3FCCE200C0DCF2 /* MainControllerShowHide.swift in Sources */, - 9779A1C81D34225E0071EFAB /* AlertOperation.swift in Sources */, 971A104B1D022CBE007FC62C /* SearchBooksVC.swift in Sources */, 977998771C1E0B7900B1DD5E /* Article+CoreDataProperties.swift in Sources */, 971C4F0E1D400F010027B7D2 /* UpdateWidgetDataSourceOperation.swift in Sources */, @@ -1719,13 +1711,13 @@ 975227A01D020C00001D1DDE /* resourceTools.cpp in Sources */, 971A10601D022DF2007FC62C /* LanguageTBVC.swift in Sources */, 971A106C1D022E50007FC62C /* Utilities.swift in Sources */, + 9763275E1D64FE0F0034F120 /* BookDetailController.swift in Sources */, 973DD4281D36E3E4009D45DB /* SettingSingleSwitchTBVC.swift in Sources */, 971A10591D022DAD007FC62C /* LibraryLocalBookDetailTBVC.swift in Sources */, 971A10431D022C54007FC62C /* SettingTBVC.swift in Sources */, 970E68BB1D3809A3001E8514 /* MainControllerDelegates.swift in Sources */, 973DD4211D34434C009D45DB /* SearchResult.swift in Sources */, 9779A1C91D34225E0071EFAB /* GlobalOperationQueue.swift in Sources */, - 970C61991D3429E400087758 /* ReachabilityCondition.swift in Sources */, 978C589C1C1CD86E0077AE47 /* Article.swift in Sources */, 973DD41E1D34428F009D45DB /* ZimMultiReader.swift in Sources */, ); @@ -1743,8 +1735,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 973BCD1E1CEB403700F10B44 /* SnapshotAutomation.swift in Sources */, - 97587A961D1061C0006EE1AA /* SnapshotHelper.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1803,6 +1793,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 6DCB0E958A1083CA248C5A12 /* Pods-Kiwix-OSX.debug.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; @@ -1834,6 +1825,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 69E75DFE2EF83272AC5B02BA /* Pods-Kiwix-OSX.release.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; @@ -1933,12 +1925,14 @@ CODE_SIGN_ENTITLEMENTS = "Kiwix-iOSWidgets/Bookmarks/Bookmarks.entitlements"; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + DEVELOPMENT_TEAM = L7HWM3SP3L; INFOPLIST_FILE = "Kiwix-iOSWidgets/Bookmarks/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = self.Kiwix.Bookmarks; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; + SWIFT_VERSION = 2.3; }; name = Debug; }; @@ -1949,12 +1943,14 @@ CODE_SIGN_ENTITLEMENTS = "Kiwix-iOSWidgets/Bookmarks/Bookmarks.entitlements"; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + DEVELOPMENT_TEAM = L7HWM3SP3L; INFOPLIST_FILE = "Kiwix-iOSWidgets/Bookmarks/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = self.Kiwix.Bookmarks; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; + SWIFT_VERSION = 2.3; }; name = Release; }; @@ -1971,8 +1967,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -1994,7 +1992,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -2016,8 +2014,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -2033,9 +2033,10 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -2045,6 +2046,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = DA0AB5D61F19BE37BD0AFA0A /* Pods-Kiwix-iOS.debug.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)"; ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; @@ -2053,7 +2055,7 @@ CODE_SIGN_ENTITLEMENTS = "Kiwix-iOS/Kiwix.entitlements"; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; + DEVELOPMENT_TEAM = L7HWM3SP3L; ENABLE_BITCODE = YES; HEADER_SEARCH_PATHS = ( "$(inherited)", @@ -2068,11 +2070,13 @@ "$(inherited)", "$(PROJECT_DIR)/Kiwix/libkiwix/iOS", ); + OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)"; PRODUCT_BUNDLE_IDENTIFIER = self.Kiwix; PRODUCT_NAME = Kiwix; PROVISIONING_PROFILE = ""; SWIFT_OBJC_BRIDGING_HEADER = "Kiwix/Kiwix-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 2.3; }; name = Debug; }; @@ -2080,6 +2084,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 5B9300794E7F4EFE5B3E8F19 /* Pods-Kiwix-iOS.release.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)"; ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; @@ -2088,7 +2093,7 @@ CODE_SIGN_ENTITLEMENTS = "Kiwix-iOS/Kiwix.entitlements"; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; + DEVELOPMENT_TEAM = L7HWM3SP3L; ENABLE_BITCODE = YES; HEADER_SEARCH_PATHS = ( "$(inherited)", @@ -2103,11 +2108,13 @@ "$(inherited)", "$(PROJECT_DIR)/Kiwix/libkiwix/iOS", ); + OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)"; PRODUCT_BUNDLE_IDENTIFIER = self.Kiwix; PRODUCT_NAME = Kiwix; PROVISIONING_PROFILE = ""; SWIFT_OBJC_BRIDGING_HEADER = "Kiwix/Kiwix-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 2.3; }; name = Release; }; @@ -2121,6 +2128,7 @@ PRODUCT_BUNDLE_IDENTIFIER = self.KiwixTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 2.3; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Kiwix.app/Kiwix"; }; name = Debug; @@ -2134,6 +2142,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = self.KiwixTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 2.3; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Kiwix.app/Kiwix"; }; name = Release; @@ -2148,6 +2157,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 2.3; TEST_TARGET_NAME = "Kiwix-iOS"; USES_XCTRUNNER = YES; }; @@ -2162,6 +2172,7 @@ PRODUCT_BUNDLE_IDENTIFIER = self.KiwixUITests; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; + SWIFT_VERSION = 2.3; TEST_TARGET_NAME = "Kiwix-iOS"; USES_XCTRUNNER = YES; }; diff --git a/Kiwix.xcodeproj/xcuserdata/Chrisli.xcuserdatad/xcschemes/Bookmarks.xcscheme b/Kiwix.xcodeproj/xcuserdata/Chrisli.xcuserdatad/xcschemes/Bookmarks.xcscheme index 6d1b1e46b..ec826d86c 100644 --- a/Kiwix.xcodeproj/xcuserdata/Chrisli.xcuserdatad/xcschemes/Bookmarks.xcscheme +++ b/Kiwix.xcodeproj/xcuserdata/Chrisli.xcuserdatad/xcschemes/Bookmarks.xcscheme @@ -1,6 +1,6 @@ @@ -47,7 +47,7 @@ diff --git a/Kiwix.xcodeproj/xcuserdata/Chrisli.xcuserdatad/xcschemes/Kiwix-OSX.xcscheme b/Kiwix.xcodeproj/xcuserdata/Chrisli.xcuserdatad/xcschemes/Kiwix-OSX.xcscheme index 9090c03b2..e43eec5ec 100644 --- a/Kiwix.xcodeproj/xcuserdata/Chrisli.xcuserdatad/xcschemes/Kiwix-OSX.xcscheme +++ b/Kiwix.xcodeproj/xcuserdata/Chrisli.xcuserdatad/xcschemes/Kiwix-OSX.xcscheme @@ -1,6 +1,6 @@ + + + + + + + + + + diff --git a/Kiwix/CoreData/Article.swift b/Kiwix/CoreData/Article.swift index f139a50b4..3bcfdc23a 100644 --- a/Kiwix/CoreData/Article.swift +++ b/Kiwix/CoreData/Article.swift @@ -14,7 +14,7 @@ class Article: NSManagedObject { class func addOrUpdate(title: String? = nil, url: NSURL, book: Book, context: NSManagedObjectContext) -> Article? { let fetchRequest = NSFetchRequest(entityName: "Article") - fetchRequest.predicate = NSPredicate(format: "urlString = %@", url.absoluteString) + fetchRequest.predicate = NSPredicate(format: "urlString = %@", url.absoluteString!) let article = Article.fetch(fetchRequest, type: Article.self, context: context)?.first ?? insert(Article.self, context: context) article?.title = title @@ -58,7 +58,7 @@ class Article: NSManagedObject { return [ "title": title, "thumbImageData": data, - "url": url.absoluteString, + "url": url.absoluteString!, "isMainPage": NSNumber(bool: isMainPage) ] } diff --git a/Kiwix/CoreData/Book.swift b/Kiwix/CoreData/Book.swift index 7c504517f..ff2b1b666 100644 --- a/Kiwix/CoreData/Book.swift +++ b/Kiwix/CoreData/Book.swift @@ -181,18 +181,14 @@ class Book: NSManagedObject { // MARK: - States var spaceState: BookSpaceState { - #if os(iOS) || os(watchOS) || os(tvOS) - let freeSpaceInBytes = UIDevice.availableDiskSpace ?? INT64_MAX - if (0.8 * Double(freeSpaceInBytes)) > Double(fileSize) { - return .Enough - } else if freeSpaceInBytes < fileSize{ - return .NotEnough - } else { - return .Caution - } - #elseif os(OSX) + guard let freeSpaceInBytes = UIDevice.availableDiskSpace?.freeSize else {return .Enough} + if (0.8 * Double(freeSpaceInBytes)) > Double(fileSize) { return .Enough - #endif + } else if freeSpaceInBytes < fileSize{ + return .NotEnough + } else { + return .Caution + } } } diff --git a/Kiwix/Extensions.swift b/Kiwix/Extensions.swift index c2cddf48f..c8ce39a2f 100644 --- a/Kiwix/Extensions.swift +++ b/Kiwix/Extensions.swift @@ -30,8 +30,6 @@ import Foundation } #endif -// MARK: - Model - extension NSLocale { class var preferredLangCodes: [String] { let preferredLangNames = self.preferredLanguages() @@ -54,4 +52,31 @@ extension NSBundle { } } +extension NSFileManager { + class var docDirURL: NSURL { + let url = try? NSFileManager.defaultManager().URLForDirectory(.DocumentDirectory, inDomain: .UserDomainMask, appropriateForURL: nil, create: false) + return url! + } + + class var libDirURL: NSURL { + let url = try? NSFileManager.defaultManager().URLForDirectory(.LibraryDirectory, inDomain: .UserDomainMask, appropriateForURL: nil, create: false) + return url! + } + + class func getContents(dir dir: NSURL) -> [NSURL] { + let options: NSDirectoryEnumerationOptions = [.SkipsHiddenFiles, .SkipsPackageDescendants, .SkipsSubdirectoryDescendants] + let urls = try? NSFileManager.defaultManager().contentsOfDirectoryAtURL(NSFileManager.docDirURL, includingPropertiesForKeys: nil, options: options) + return urls ?? [NSURL]() + } +} + +extension UIDevice { + class var availableDiskSpace: (freeSize: Int64, totalSize: Int64)? { + let docDirPath = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true).first! + guard let systemAttributes = try? NSFileManager.defaultManager().attributesOfFileSystemForPath(docDirPath), + let freeSize = (systemAttributes[NSFileSystemFreeSize] as? NSNumber)?.longLongValue, + let totalSize = (systemAttributes[NSFileSystemSize] as? NSNumber)?.longLongValue else {return nil} + return (freeSize, totalSize) + } +} diff --git a/Kiwix/FileManager.swift b/Kiwix/FileManager.swift index 0e9a77497..4bb16d1ec 100644 --- a/Kiwix/FileManager.swift +++ b/Kiwix/FileManager.swift @@ -8,26 +8,6 @@ class FileManager { - // MARK: - Path Utilities - - class var docDirPath: String { - let paths = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true) - return paths.first! - } - - class var docDirURL: NSURL { - return NSURL(fileURLWithPath: docDirPath, isDirectory: true) - } - - class var libDirPath: String { - let paths = NSSearchPathForDirectoriesInDomains(.LibraryDirectory, .UserDomainMask, true) - return paths.first! - } - - class var libDirURL: NSURL { - return NSURL(fileURLWithPath: libDirPath, isDirectory: true) - } - // MARK: - Move Book class func move(book: Book, fromURL: NSURL, suggestedFileName: String?) { @@ -36,24 +16,24 @@ class FileManager { if let id = book.id {return "\(id).zim"} return NSDate().description + ".zim" }() - let directory = docDirURL + let directory = NSFileManager.docDirURL createDirectory(directory, includeInICloudBackup: false) let destination = directory.URLByAppendingPathComponent(fileName) - moveOrReplaceFile(from: fromURL, to: destination) + moveOrReplaceFile(from: fromURL, to: destination!) } // MARK: - Book Resume Data private class func resumeDataURL(book: Book) -> NSURL { - let tempDownloadLocation = NSURL(fileURLWithPath: libDirPath).URLByAppendingPathComponent("DownloadTemp", isDirectory: true) - return tempDownloadLocation.URLByAppendingPathComponent(book.id ?? NSDate().description, isDirectory: false) + let tempDownloadLocation = NSURL(fileURLWithPath: NSFileManager.libDirURL.path!).URLByAppendingPathComponent("DownloadTemp", isDirectory: true) + return tempDownloadLocation!.URLByAppendingPathComponent(book.id ?? NSDate().description, isDirectory: false)! } class func saveResumeData(data: NSData, book: Book) { - let tempDownloadLocation = NSURL(fileURLWithPath: libDirPath).URLByAppendingPathComponent("DownloadTemp", isDirectory: true) - if !NSFileManager.defaultManager().fileExistsAtPath(tempDownloadLocation.path!) { + let tempDownloadLocation = NSURL(fileURLWithPath: NSFileManager.libDirURL.path!).URLByAppendingPathComponent("DownloadTemp", isDirectory: true) + if !NSFileManager.defaultManager().fileExistsAtPath(tempDownloadLocation!.path!) { do { - try NSFileManager.defaultManager().createDirectoryAtURL(tempDownloadLocation, withIntermediateDirectories: true, attributes: [NSURLIsExcludedFromBackupKey: true]) + try NSFileManager.defaultManager().createDirectoryAtURL(tempDownloadLocation!, withIntermediateDirectories: true, attributes: [NSURLIsExcludedFromBackupKey: true]) } catch let error as NSError { print("Create temp download folder failed: \(error.localizedDescription)") } diff --git a/Kiwix/Operations/AlertOperation.swift b/Kiwix/Operations/AlertOperation.swift deleted file mode 100644 index 31ba58b68..000000000 --- a/Kiwix/Operations/AlertOperation.swift +++ /dev/null @@ -1,83 +0,0 @@ -/* -Copyright (C) 2015 Apple Inc. All Rights Reserved. -See LICENSE.txt for this sample’s licensing information - -Abstract: -This file shows how to present an alert as part of an operation. -*/ - -import UIKit -import PSOperations - -class AlertOperation: Operation { - // MARK: Properties - - private let alertController = UIAlertController(title: nil, message: nil, preferredStyle: .Alert) - private let presentationContext: UIViewController? - - var title: String? { - get { - return alertController.title - } - - set { - alertController.title = newValue - name = newValue - } - } - - var message: String? { - get { - return alertController.message - } - - set { - alertController.message = newValue - } - } - - // MARK: Initialization - - init(presentationContext: UIViewController? = nil) { - self.presentationContext = presentationContext ?? UIApplication.sharedApplication().keyWindow?.rootViewController - - super.init() - - addCondition(AlertPresentation()) - - /* - This operation modifies the view controller hierarchy. - Doing this while other such operations are executing can lead to - inconsistencies in UIKit. So, let's make them mutally exclusive. - */ - addCondition(MutuallyExclusive()) - } - - func addAction(title: String, style: UIAlertActionStyle = .Default, handler: AlertOperation -> Void = { _ in }) { - let action = UIAlertAction(title: title, style: style) { [weak self] _ in - if let strongSelf = self { - handler(strongSelf) - } - - self?.finish() - } - - alertController.addAction(action) - } - - override func execute() { - guard let presentationContext = presentationContext else { - finish() - - return - } - - dispatch_async(dispatch_get_main_queue()) { - if self.alertController.actions.isEmpty { - self.addAction("OK") - } - - presentationContext.presentViewController(self.alertController, animated: true, completion: nil) - } - } -} diff --git a/Kiwix/Operations/GlobalOperationQueue.swift b/Kiwix/Operations/GlobalOperationQueue.swift index fe6729629..81659cd67 100644 --- a/Kiwix/Operations/GlobalOperationQueue.swift +++ b/Kiwix/Operations/GlobalOperationQueue.swift @@ -6,7 +6,7 @@ // Copyright © 2016 Chris. All rights reserved. // -import PSOperations +import Operations class GlobalOperationQueue: OperationQueue { static let sharedInstance = GlobalOperationQueue() diff --git a/Kiwix/Operations/NetworkObserver.swift b/Kiwix/Operations/NetworkObserver.swift deleted file mode 100644 index 60084e34e..000000000 --- a/Kiwix/Operations/NetworkObserver.swift +++ /dev/null @@ -1,120 +0,0 @@ -/* -Copyright (C) 2015 Apple Inc. All Rights Reserved. -See LICENSE.txt for this sample’s licensing information - -Abstract: -Contains the code to manage the visibility of the network activity indicator -*/ - -import UIKit -import PSOperations - -/** - An `OperationObserver` that will cause the network activity indicator to appear - as long as the `Operation` to which it is attached is executing. -*/ -struct NetworkObserver: OperationObserver { - // MARK: Initilization - - init() { } - - func operationDidStart(operation: Operation) { - print("NetworkObserver: \(operation.name ?? "Unknown") operation did start") - dispatch_async(dispatch_get_main_queue()) { - // Increment the network indicator's "reference count" - NetworkIndicatorController.sharedIndicatorController.networkActivityDidStart() - } - } - - func operation(operation: Operation, didProduceOperation newOperation: NSOperation) { } - - func operationDidFinish(operation: Operation, errors: [NSError]) { - print("NetworkObserver: \(operation.name ?? "Unknown") operation did finish") - dispatch_async(dispatch_get_main_queue()) { - // Decrement the network indicator's "reference count". - NetworkIndicatorController.sharedIndicatorController.networkActivityDidEnd() - } - } - - func operationDidCancel(operation: Operation) { } -} - -/// A singleton to manage a visual "reference count" on the network activity indicator. -private class NetworkIndicatorController { - // MARK: Properties - - static let sharedIndicatorController = NetworkIndicatorController() - - private var activityCount = 0 - - private var visibilityTimer: Timer? - - // MARK: Methods - - func networkActivityDidStart() { - assert(NSThread.isMainThread(), "Altering network activity indicator state can only be done on the main thread.") - - activityCount += 1 - - updateIndicatorVisibility() - } - - func networkActivityDidEnd() { - assert(NSThread.isMainThread(), "Altering network activity indicator state can only be done on the main thread.") - - activityCount -= 1 - - updateIndicatorVisibility() - } - - private func updateIndicatorVisibility() { - if activityCount > 0 { - showIndicator() - } - else { - /* - To prevent the indicator from flickering on and off, we delay the - hiding of the indicator by one second. This provides the chance - to come in and invalidate the timer before it fires. - */ - visibilityTimer = Timer(interval: 1.0) { - self.hideIndicator() - } - } - } - - private func showIndicator() { - visibilityTimer?.cancel() - visibilityTimer = nil - UIApplication.sharedApplication().networkActivityIndicatorVisible = true - } - - private func hideIndicator() { - visibilityTimer?.cancel() - visibilityTimer = nil - UIApplication.sharedApplication().networkActivityIndicatorVisible = false - } -} - -/// Essentially a cancellable `dispatch_after`. -class Timer { - // MARK: Properties - - private var isCancelled = false - - // MARK: Initialization - - init(interval: NSTimeInterval, handler: dispatch_block_t) { - let when = dispatch_time(DISPATCH_TIME_NOW, Int64(interval * Double(NSEC_PER_SEC))) - - dispatch_after(when, dispatch_get_main_queue()) { [weak self] in - if self?.isCancelled == false { - handler() - } - } - } - - func cancel() { - isCancelled = true - } -} \ No newline at end of file diff --git a/Kiwix/Operations/RefreshLibraryOperation.swift b/Kiwix/Operations/RefreshLibraryOperation.swift index 27dc49844..8dfde0a0c 100644 --- a/Kiwix/Operations/RefreshLibraryOperation.swift +++ b/Kiwix/Operations/RefreshLibraryOperation.swift @@ -7,7 +7,7 @@ // import CoreData -import PSOperations +import Operations class RefreshLibraryOperation: GroupOperation { @@ -23,9 +23,9 @@ class RefreshLibraryOperation: GroupOperation { let parseOperation = ParseLibraryOperation() // 0.Download library - let url = NSURL(string: "http://www.kiwix.org/library.xml")! + let url = NSURL(string: "https://download.kiwix.org/library/library.xml")! let task = NSURLSession.sharedSession().dataTaskWithURL(url) { [unowned parseOperation] (data, response, error) -> Void in - if let error = error {self.aggregateError(error)} + if let error = error {self.addFatalError(error)} parseOperation.xmlData = data } let fetchOperation = URLSessionTaskOperation(task: task) @@ -34,7 +34,8 @@ class RefreshLibraryOperation: GroupOperation { #if os(iOS) || os(watchOS) || os(tvOS) fetchOperation.addObserver(NetworkObserver()) #endif - fetchOperation.addCondition(ReachabilityCondition(host: url, allowCellular: Preference.libraryRefreshAllowCellularData)) + let reachibility = ReachabilityCondition(url: url, connectivity: Preference.libraryRefreshAllowCellularData ? .AnyConnectionKind : .ViaWiFi) + fetchOperation.addCondition(reachibility) if invokedAutomatically { addCondition(AllowAutoRefreshCondition()) @@ -45,8 +46,8 @@ class RefreshLibraryOperation: GroupOperation { parseOperation.addDependency(fetchOperation) } - override func finished(errors: [NSError]) { - completionHandler?(errors: errors) + override func operationDidFinish(errors: [ErrorType]) { + completionHandler?(errors: [NSError]()) } } @@ -129,23 +130,23 @@ class ParseLibraryOperation: Operation, NSXMLParserDelegate { } private struct AllowAutoRefreshCondition: OperationCondition { - static let name = "LibraryAllowAutoRefresh" - static let isMutuallyExclusive = false + let name = "LibraryAllowAutoRefresh" + let isMutuallyExclusive = false init() {} - func dependencyForOperation(operation: Operation) -> NSOperation? { + private func dependencyForOperation(operation: Operation) -> NSOperation? { return nil } - func evaluateForOperation(operation: Operation, completion: OperationConditionResult -> Void) { + private func evaluateForOperation(operation: Operation, completion: OperationConditionResult -> Void) { let allowAutoRefresh = !Preference.libraryAutoRefreshDisabled if allowAutoRefresh { completion(.Satisfied) } else { - let error = NSError(code: .ConditionFailed, userInfo: [OperationConditionKey: self.dynamicType.name]) + let error = NSError(domain: "", code: 1, userInfo: nil) completion(.Failed(error)) } } -} \ No newline at end of file +} diff --git a/Kiwix/Operations/ScanLocalBookOperation.swift b/Kiwix/Operations/ScanLocalBookOperation.swift index a1f4678b5..f0cffc285 100644 --- a/Kiwix/Operations/ScanLocalBookOperation.swift +++ b/Kiwix/Operations/ScanLocalBookOperation.swift @@ -7,7 +7,7 @@ // import CoreData -import PSOperations +import Operations class ScanLocalBookOperation: Operation { private let context: NSManagedObjectContext @@ -54,10 +54,10 @@ class ScanLocalBookOperation: Operation { updateCoreData() } - override func finished(errors: [NSError]) { + override func operationDidFinish(errors: [ErrorType]) { context.performBlockAndWait {self.context.saveIfNeeded()} NSManagedObjectContext.mainQueueContext.performBlockAndWait {NSManagedObjectContext.mainQueueContext.saveIfNeeded()} - NSOperationQueue.mainQueue().addOperationWithBlock { + NSOperationQueue.mainQueue().addOperationWithBlock { self.completionHandler(currentZimFileURLSnapshot: self.currentZimFileURLSnapshot, currentIndexFolderURLSnapshot: self.currentIndexFolderURLSnapshot, firstBookAdded: self.firstBookAdded) } @@ -95,7 +95,7 @@ class ScanLocalBookOperation: Operation { }() book?.isLocal = true book?.hasIndex = reader.hasIndex() - book?.hasPic = !reader.fileURL.absoluteString.containsString("nopic") + book?.hasPic = !reader.fileURL.absoluteString!.containsString("nopic") } for (id, book) in localBooks { @@ -112,45 +112,27 @@ class ScanLocalBookOperation: Operation { // MARK: - Helper private class func getCurrentZimFileURLsInDocDir() -> Set { - let fileURLs = FileManager.contentsOfDirectory(FileManager.docDirURL) ?? [NSURL]() - var zimURLs = Set() - for url in fileURLs { - do { - var isDirectory: AnyObject? = nil - try url.getResourceValue(&isDirectory, forKey: NSURLIsDirectoryKey) - if let isDirectory = (isDirectory as? NSNumber)?.boolValue { - if !isDirectory { - guard let pathExtension = url.pathExtension?.lowercaseString else {continue} - guard pathExtension.containsString("zim") else {continue} - zimURLs.insert(url) - } - } - } catch { - continue - } + var urls = NSFileManager.getContents(dir: NSFileManager.docDirURL) + let keys = [NSURLIsDirectoryKey] + urls = urls.filter { (url) -> Bool in + guard let values = try? url.resourceValuesForKeys(keys), + let isDirectory = (values[NSURLIsDirectoryKey] as? NSNumber)?.boolValue where isDirectory == false else {return false} + guard let pathExtension = url.pathExtension?.lowercaseString where pathExtension.containsString("zim") else {return false} + return true } - return zimURLs + return Set(urls) } private class func getCurrentIndexFolderURLsInDocDir() -> Set { - let fileURLs = FileManager.contentsOfDirectory(FileManager.docDirURL) ?? [NSURL]() - var folderURLs = Set() - for url in fileURLs { - do { - var isDirectory: AnyObject? = nil - try url.getResourceValue(&isDirectory, forKey: NSURLIsDirectoryKey) - if let isDirectory = (isDirectory as? NSNumber)?.boolValue { - if isDirectory { - guard let pathExtension = url.pathExtension?.lowercaseString else {continue} - guard pathExtension == "idx" else {continue} - folderURLs.insert(url) - } - } - } catch { - continue - } + var urls = NSFileManager.getContents(dir: NSFileManager.docDirURL) + let keys = [NSURLIsDirectoryKey] + urls = urls.filter { (url) -> Bool in + guard let values = try? url.resourceValuesForKeys(keys), + let isDirectory = (values[NSURLIsDirectoryKey] as? NSNumber)?.boolValue where isDirectory == true else {return false} + guard let pathExtension = url.pathExtension?.lowercaseString where pathExtension == "idx" else {return false} + return true } - return folderURLs + return Set(urls) } } diff --git a/Kiwix/Operations/SearchOperation.swift b/Kiwix/Operations/SearchOperation.swift index fd83c9baf..cb12e6dbd 100644 --- a/Kiwix/Operations/SearchOperation.swift +++ b/Kiwix/Operations/SearchOperation.swift @@ -7,7 +7,7 @@ // import UIKit -import PSOperations +import Operations class SearchOperation: GroupOperation { let completionHandler: ([SearchResult]?) -> Void @@ -41,8 +41,7 @@ class SearchOperation: GroupOperation { addCondition(MutuallyExclusive()) } - override func finished(errors: [NSError]) { - //print("Search Operation finished, status \(cancelled ? "Canceled" : "Not Canceled"), \(NSDate().timeIntervalSinceDate(startTime))") + override func operationDidFinish(errors: [ErrorType]) { NSOperationQueue.mainQueue().addOperationWithBlock { self.completionHandler(self.cancelled ? nil : self.results) } @@ -58,6 +57,7 @@ private class SingleBookSearchOperation: Operation { self.zimReader = zimReader self.lowerCaseSearchTerm = lowerCaseSearchTerm self.completionHandler = completionHandler + super.init() } override private func execute() { @@ -80,6 +80,7 @@ private class SortSearchResultsOperation: Operation { init(completionHandler: ([SearchResult]) -> Void) { self.completionHandler = completionHandler + super.init() } override private func execute() { diff --git a/Kiwix/Operations/UIOperations.swift b/Kiwix/Operations/UIOperations.swift index bfc734302..a19aacf74 100644 --- a/Kiwix/Operations/UIOperations.swift +++ b/Kiwix/Operations/UIOperations.swift @@ -7,41 +7,40 @@ // import UIKit -import PSOperations +import Operations // MARK: - Alerts -class SpaceCautionAlert: AlertOperation { - init(book: Book, presentationContext: UIViewController?) { - super.init(presentationContext: presentationContext) - - let comment = "Library: Download Space Caution Alert" +class SpaceCautionAlert: AlertOperation { + let comment = "Library: Download Space Caution Alert" + init(book: Book, presentationContext: LibraryOnlineTBVC) { + super.init(presentAlertFrom: presentationContext) title = NSLocalizedString("Space Caution", comment: comment) message = NSLocalizedString("This book takes up more than 80% of the remaining space on your device. Are you sure you want to download it?", comment: comment) - addAction(NSLocalizedString("Download Anyway", comment: comment), style: .Default) { (action) -> Void in + addActionWithTitle(NSLocalizedString("Download Anyway", comment: comment), style: .Default) { (alert) in Network.sharedInstance.download(book) } - addAction(LocalizedStrings.cancel) + addActionWithTitle(LocalizedStrings.cancel) } } -class SpaceNotEnoughAlert: AlertOperation { - init(book: Book, presentationContext: UIViewController?) { - super.init(presentationContext: presentationContext) - - let comment = "Library: Download Space Not Enough Alert" +class SpaceNotEnoughAlert: AlertOperation { + let comment = "Library: Download Space Not Enough Alert" + init(book: Book, presentationContext: LibraryOnlineTBVC) { + super.init(presentAlertFrom: presentationContext) title = NSLocalizedString("Space Not Enough", comment: comment) message = NSLocalizedString("You don't have enough remaining space to download this book.", comment: comment) - addAction(LocalizedStrings.ok) + addActionWithTitle(LocalizedStrings.ok) } } -class RefreshLibraryLanguageFilterAlert: AlertOperation { +class RefreshLibraryLanguageFilterAlert: AlertOperation { + let comment = "Library: Language Filter Alert" let context = UIApplication.appDelegate.managedObjectContext - init(libraryOnlineTBVC: LibraryOnlineTBVC?) { - super.init(presentationContext: libraryOnlineTBVC) + init(presentationContext libraryOnlineTBVC: LibraryOnlineTBVC) { + super.init(presentAlertFrom: libraryOnlineTBVC) var preferredLanguageCodes = [String]() var preferredLanguageNames = [String]() @@ -69,60 +68,56 @@ class RefreshLibraryLanguageFilterAlert: AlertOperation { } }() - let comment = "Library: Language Filter Alert" - title = NSLocalizedString("Only Show Preferred Language?", comment: comment) message = NSLocalizedString("We have found you may know \(languageString), would you like to filter the library by these languages?", comment: comment) - addAction(LocalizedStrings.ok, style: .Default) { (action) in + addActionWithTitle(LocalizedStrings.ok, style: .Default) { (action) in self.context.performBlock({ let languages = Language.fetchAll(self.context) for language in languages { guard let code = language.code else {continue} language.isDisplayed = preferredLanguageCodes.contains(code) } - libraryOnlineTBVC?.refreshFetchedResultController() + libraryOnlineTBVC.refreshFetchedResultController() }) } - addAction(LocalizedStrings.cancel) + addActionWithTitle(LocalizedStrings.cancel) } - override func finished(errors: [NSError]) { + override func operationDidFinish(errors: [ErrorType]) { Preference.libraryHasShownPreferredLanguagePrompt = true } - func andJoinedString(a: String, b: String) -> String { + private func andJoinedString(a: String, b: String) -> String { return a + " " + LocalizedStrings.and + " " + b } } -class RefreshLibraryInternetRequiredAlert: AlertOperation { - override init(presentationContext: UIViewController?) { - super.init(presentationContext: presentationContext) - - let comment = "Library: Internet Required Alert" +class RefreshLibraryInternetRequiredAlert: AlertOperation { + let comment = "Library: Internet Required Alert" + init(presentationContext: LibraryOnlineTBVC) { + super.init(presentAlertFrom: presentationContext) title = NSLocalizedString("Internet Connection Required", comment: comment) message = NSLocalizedString("You need to connect to the Internet to refresh the library.", comment: comment) - addAction(LocalizedStrings.ok) + addActionWithTitle(LocalizedStrings.ok) } } -class GetStartedAlert: AlertOperation { - init(mainController: MainController?) { - super.init(presentationContext: mainController) - - let comment = "First Time Launch Message" +class GetStartedAlert: AlertOperation { + let comment = "First Time Launch Message" + init(presentationContext mainController: MainController) { + super.init(presentAlertFrom: mainController) title = NSLocalizedString("Welcome to Kiwix", comment: comment) message = NSLocalizedString("Add a Book to Get Started", comment: comment) - addAction(NSLocalizedString("Download", comment: comment), style: .Default) { (alert) in - mainController?.showLibraryButtonTapped() + addActionWithTitle(NSLocalizedString("Download", comment: comment), style: .Default) { (alert) in + mainController.showLibraryButtonTapped() } - addAction(NSLocalizedString("Import", comment: comment), style: .Default) { (alert) in + addActionWithTitle(NSLocalizedString("Import", comment: comment), style: .Default) { (alert) in let operation = ShowHelpPageOperation(type: .ImportBookLearnMore, presentationContext: mainController) GlobalOperationQueue.sharedInstance.addOperation(operation) } - addAction(NSLocalizedString("Dismiss", comment: comment)) + addActionWithTitle(NSLocalizedString("Dismiss", comment: comment)) } } @@ -130,19 +125,23 @@ class GetStartedAlert: AlertOperation { class ShowHelpPageOperation: Operation { private let type: WebViewControllerContentType - private weak var presentationContext: UIViewController? + private let presentationContext: UIViewController - init(type: WebViewControllerContentType, presentationContext: UIViewController?) { + init(type: WebViewControllerContentType, presentationContext: UIViewController) { self.type = type self.presentationContext = presentationContext + super.init() } override func execute() { - NSOperationQueue.mainQueue().addOperationWithBlock { - guard let controller = UIStoryboard.setting.instantiateViewControllerWithIdentifier("WebViewController") as? WebViewController else {return} - controller.page = self.type - let navController = UINavigationController(rootViewController: controller) - self.presentationContext?.presentViewController(navController, animated: true, completion: nil) - } + defer { finish() } + guard let controller = UIStoryboard.setting.instantiateViewControllerWithIdentifier("WebViewController") as? WebViewController else {return} + controller.page = self.type + + let operation = UIOperation(controller: UIViewController(), + displayControllerFrom: .Present(presentationContext), + inNavigationController: true, + sender: nil) + produceOperation(operation) } } diff --git a/Kiwix/Operations/URLSessionDownloadTaskOperation.swift b/Kiwix/Operations/URLSessionDownloadTaskOperation.swift index e3fec0b6b..e462d321e 100644 --- a/Kiwix/Operations/URLSessionDownloadTaskOperation.swift +++ b/Kiwix/Operations/URLSessionDownloadTaskOperation.swift @@ -6,7 +6,7 @@ // Copyright © 2016 Chris. All rights reserved. // -import PSOperations +import Operations private var URLSessionTaskOperationKVOContext = 0 @@ -20,14 +20,15 @@ public class URLSessionDownloadTaskOperation: Operation { self.task = downloadTask super.init() - addObserver(BlockObserver(cancelHandler: { _ in + addObserver(DidCancelObserver { _ in if self.produceResumeData { downloadTask.cancelByProducingResumeData({ (data) in }) } else { downloadTask.cancel() } - })) + } + ) } public func cancel(produceResumeData produceResumeData: Bool) { diff --git a/Kiwix/Operations/UpdateWidgetDataSourceOperation.swift b/Kiwix/Operations/UpdateWidgetDataSourceOperation.swift index dd426aba3..ad3bf85f5 100644 --- a/Kiwix/Operations/UpdateWidgetDataSourceOperation.swift +++ b/Kiwix/Operations/UpdateWidgetDataSourceOperation.swift @@ -7,7 +7,7 @@ // import CoreData -import PSOperations +import Operations import NotificationCenter class UpdateWidgetDataSourceOperation: Operation { diff --git a/Kiwix/ReachabilityCondition.swift b/Kiwix/ReachabilityCondition.swift deleted file mode 100644 index 91ebbcef1..000000000 --- a/Kiwix/ReachabilityCondition.swift +++ /dev/null @@ -1,115 +0,0 @@ -/* -Copyright (C) 2015 Apple Inc. All Rights Reserved. -See LICENSE.txt for this sample’s licensing information - -Abstract: -This file shows an example of implementing the OperationCondition protocol. -*/ - -import Foundation -import SystemConfiguration -import PSOperations - -/** - This is a condition that performs a very high-level reachability check. - It does *not* perform a long-running reachability check, nor does it respond to changes in reachability. - Reachability is evaluated once when the operation to which this is attached is asked about its readiness. -*/ -struct ReachabilityCondition: OperationCondition { - static let hostKey = "Host" - static let name = "Reachability" - static let isMutuallyExclusive = false - - let host: NSURL - let allowCellular: Bool - - init(host: NSURL, allowCellular: Bool = true) { - self.host = host - self.allowCellular = allowCellular - } - - func dependencyForOperation(operation: Operation) -> NSOperation? { - return nil - } - - func evaluateForOperation(operation: Operation, completion: OperationConditionResult -> Void) { - ReachabilityController.requestReachability(host, allowCellular: allowCellular) { reachable in - if reachable { - completion(.Satisfied) - } - else { - let userInfo = ["title": "Network Error", - "message": "Unable connecting to the internet. Please check your connection."] - let error = NSError(code: .ConditionFailed, userInfo: userInfo) - completion(.Failed(error)) - } - } - } - -} - -/// A private singleton that maintains a basic cache of `SCNetworkReachability` objects. -private class ReachabilityController { - static var reachabilityRefs = [String: SCNetworkReachability]() - - static let reachabilityQueue = dispatch_queue_create("Operations.Reachability", DISPATCH_QUEUE_SERIAL) - - static func requestReachability(url: NSURL?, allowCellular: Bool, completionHandler: (Bool) -> Void) { - if let host = url?.host { - dispatch_async(reachabilityQueue) { - var ref = self.reachabilityRefs[host] - - if ref == nil { - let hostString = host as NSString - ref = SCNetworkReachabilityCreateWithName(nil, hostString.UTF8String) - } - - if let ref = ref { - self.reachabilityRefs[host] = ref - - let reachable = getReachibility(ref, allowCellular: allowCellular) - completionHandler(reachable) - } else { - completionHandler(false) - } - } - } else { - // Test for general internet connectibility - dispatch_async(reachabilityQueue) { - var zeroAddress = sockaddr_in() - zeroAddress.sin_len = UInt8(sizeofValue(zeroAddress)) - zeroAddress.sin_family = sa_family_t(AF_INET) - - guard let ref = withUnsafePointer(&zeroAddress, { - SCNetworkReachabilityCreateWithAddress(nil, UnsafePointer($0)) - }) else {completionHandler(false); return} - - let reachable = getReachibility(ref, allowCellular: allowCellular) - completionHandler(reachable) - } - } - } - - static func getReachibility(ref: SCNetworkReachability, allowCellular: Bool) -> Bool { - var reachable = false - var flags: SCNetworkReachabilityFlags = [] - if SCNetworkReachabilityGetFlags(ref, &flags) != false { - /* - Here to check forother considerations, - such as whether or not the connection would require - VPN, a cellular connection, etc. - */ - #if os(iOS) || os(watchOS) || os(tvOS) - if allowCellular { - reachable = flags.contains(.Reachable) - } else { - reachable = flags.contains(.Reachable) && !flags.contains(.IsWWAN) - } - #elseif os(OSX) - return flags.contains(.Reachable) - #endif - - } - return reachable - } -} diff --git a/Kiwix/URLProtocol/KiwixURLProtocol.swift b/Kiwix/URLProtocol/KiwixURLProtocol.swift index 93f5d9878..5f8db0412 100644 --- a/Kiwix/URLProtocol/KiwixURLProtocol.swift +++ b/Kiwix/URLProtocol/KiwixURLProtocol.swift @@ -8,7 +8,7 @@ class KiwixURLProtocol: NSURLProtocol { override class func canInitWithRequest(request: NSURLRequest) -> Bool { - return request.URL?.scheme.caseInsensitiveCompare("Kiwix") == .OrderedSame ? true : false + return request.URL?.scheme!.caseInsensitiveCompare("Kiwix") == .OrderedSame ? true : false } override class func canonicalRequestForRequest(request: NSURLRequest) -> NSURLRequest { diff --git a/Kiwix/ZimMultiReader/DirectoryMonitor.swift b/Kiwix/ZimMultiReader/DirectoryMonitor.swift index 9f1c166b3..8477342ee 100644 --- a/Kiwix/ZimMultiReader/DirectoryMonitor.swift +++ b/Kiwix/ZimMultiReader/DirectoryMonitor.swift @@ -157,7 +157,7 @@ class DirectoryMonitor { } private func fileSize(fileName: String) -> Int64? { - if let path = self.URL.URLByAppendingPathComponent(fileName).path { + if let path = self.URL.URLByAppendingPathComponent(fileName)!.path { if NSFileManager.defaultManager().fileExistsAtPath(path) { do { let attributes = try NSFileManager.defaultManager().attributesOfItemAtPath(path) @@ -171,4 +171,4 @@ class DirectoryMonitor { } return nil } -} \ No newline at end of file +} diff --git a/Kiwix/ZimMultiReader/ZimMultiReader.swift b/Kiwix/ZimMultiReader/ZimMultiReader.swift index 259acf361..175d7a154 100644 --- a/Kiwix/ZimMultiReader/ZimMultiReader.swift +++ b/Kiwix/ZimMultiReader/ZimMultiReader.swift @@ -7,7 +7,7 @@ // import CoreData -import PSOperations +import Operations class ZimMultiReader: NSObject, DirectoryMonitorDelegate { static let sharedInstance = ZimMultiReader() @@ -19,7 +19,7 @@ class ZimMultiReader: NSObject, DirectoryMonitorDelegate { private let searchQueue = OperationQueue() private(set) var isScanning = false private(set) var readers = [ZimID: ZimReader]() - private let monitor = DirectoryMonitor(URL: FileManager.docDirURL) + private let monitor = DirectoryMonitor(URL: NSFileManager.docDirURL) private var lastZimFileURLSnapshot = Set() private var lastIndexFolderURLSnapshot = Set() diff --git a/Kiwix/libkiwix/ZimReader.mm b/Kiwix/libkiwix/ZimReader.mm index 8ffdcdd6b..8ac820ecf 100755 --- a/Kiwix/libkiwix/ZimReader.mm +++ b/Kiwix/libkiwix/ZimReader.mm @@ -32,11 +32,24 @@ - (instancetype)initWithZIMFileURL:(NSURL *)url { } try { - NSString *zimPath = [url absoluteString]; - zimPath = [zimPath stringByReplacingOccurrencesOfString:@".zimaa" withString:@".zim"]; - NSURL *xapianURl = [[NSURL fileURLWithPath:zimPath] URLByAppendingPathExtension:@"idx"]; - _db = new Xapian::Database([xapianURl fileSystemRepresentation]); - } catch (const Xapian::DatabaseOpeningError &e) {} + zim::File zimFileHandle = *_reader->getZimFileHandler(); + zim::Article xapianArticle = zimFileHandle.getArticle('Z', "/Z/fulltextIndex/xapian"); + if (xapianArticle.good()) { + zim::offset_type dbOffset = xapianArticle.getOffset(); + int databasefd = open([url fileSystemRepresentation], O_RDONLY); + lseek(databasefd, dbOffset, SEEK_SET); + _db = new Xapian::Database(databasefd); + } else { + throw "xapian db not in zim"; + } + } catch (...) { + try { + NSString *zimPath = [url absoluteString]; + zimPath = [zimPath stringByReplacingOccurrencesOfString:@".zimaa" withString:@".zim"]; + NSURL *xapianURl = [[NSURL fileURLWithPath:zimPath] URLByAppendingPathExtension:@"idx"]; + _db = new Xapian::Database([xapianURl fileSystemRepresentation]); + } catch (const Xapian::DatabaseOpeningError &e) {} + } self.fileURL = url; } diff --git a/Kiwix/libkiwix/build/build-xapian.sh b/Kiwix/libkiwix/build/build-xapian.sh index 1764fb6db..0cd6b58af 100755 --- a/Kiwix/libkiwix/build/build-xapian.sh +++ b/Kiwix/libkiwix/build/build-xapian.sh @@ -1,12 +1,12 @@ #!/bin/bash +# regarding export MACOSX_DEPLOYMENT_TARGET="10.4" in build_iOS, see reason why do it like this +# http://stackoverflow.com/questions/32622284/building-c-static-libraries-using-configure-make-with-fembed-bitcode-fails + ROOT=$(pwd) ######################## XAPIAN ######################## -XAPIANPATH=$ROOT/xapian-core-1.4.0 -cd $XAPIANPATH - build_iOS() { ARCH=$1 @@ -18,19 +18,24 @@ build_iOS() SDKROOT="$(xcodebuild -version -sdk iphoneos | grep -E '^Path' | sed 's/Path: //')" fi - export CC="$(xcrun -sdk iphoneos -find clang)" + export MACOSX_DEPLOYMENT_TARGET="10.4" + + export CC="$(xcrun -find clang)" export CFLAGS="-fembed-bitcode -isysroot $SDKROOT -arch ${ARCH} -miphoneos-version-min=9.0" export CPP="$CC -E" export CPPFLAGS="$CFLAGS" + export CXX="$(xcrun -find clang++)" + export CXXFLAGS="$CFLAGS -stdlib=libc++ -std=c++11" + export LDFLAGS="-arch ${ARCH} -isysroot $SDKROOT" if [ $ARCH == "i386" ] || [ $ARCH == "x86_64" ]; then - ./configure --prefix=$(pwd)/build/iOS/$ARCH --host=i686-apple-darwin11 --enable-static --disable-shared + ./configure --prefix=$(pwd)/build/iOS/$ARCH --host=i686-apple-darwin11 --enable-static --enable-shared else - ./configure --prefix=$(pwd)/build/iOS/$ARCH --host=arm-apple-darwin --enable-static --disable-shared + ./configure --prefix=$(pwd)/build/iOS/$ARCH --host=arm-apple-darwin --enable-static --enable-shared fi make && make install && make clean @@ -44,10 +49,13 @@ build_OSX() export MACOSX_DEPLOYMENT_TARGET="10.10" - export CC="$(xcrun -sdk macosx10.11 -find clang)" + export CC="$(xcrun -find clang)" export CFLAGS="-fembed-bitcode -isysroot $SDKROOT -arch ${ARCH} -mmacosx-version-min=10.10" - export CXX="$(xcrun -sdk macosx10.11 -find clang++)" + export CPP="$CC -E" + export CPPFLAGS="$CFLAGS" + + export CXX="$(xcrun -find clang++)" export CXXFLAGS="$CFLAGS -stdlib=libc++ -std=c++11" export LDFLAGS="-arch ${ARCH} -isysroot $SDKROOT" @@ -57,6 +65,28 @@ build_OSX() make && make install && make clean } +distribute_iOS() { + iOSBUILDDir=$(pwd)/build/iOS + cd $iOSBUILDDir + mkdir -p universal/lib + + cd armv7/lib + for file in *.a + do + cd $iOSBUILDDir + lipo -create armv7/lib/$file armv7s/lib/$file arm64/lib/$file x86_64/lib/$file i386/lib/$file -output universal/lib/$file + done + + cd armv7/lib + for file in *.dylib + do + cd $iOSBUILDDir + lipo -create armv7/lib/$file armv7s/lib/$file arm64/lib/$file x86_64/lib/$file i386/lib/$file -output universal/lib/$file + done + + cp -r armv7/include universal +} + distribute() { cd $XAPIANPATH/build mkdir -p Universal/iOS/lib @@ -86,9 +116,10 @@ distribute() { # build_iOS armv7 # build_iOS armv7s # build_iOS arm64 +distribute_iOS # build_OSX i386 # build_OSX x86_64 -distribute +# distribute diff --git a/Kiwix/libkiwix/build/build-zim.sh b/Kiwix/libkiwix/build/build-zim.sh index e61f6aa07..84118155e 100755 --- a/Kiwix/libkiwix/build/build-zim.sh +++ b/Kiwix/libkiwix/build/build-zim.sh @@ -1,5 +1,8 @@ #!/bin/bash +# regarding export MACOSX_DEPLOYMENT_TARGET="10.4" in build_iOS, see reason why do it like this +# http://stackoverflow.com/questions/32622284/building-c-static-libraries-using-configure-make-with-fembed-bitcode-fails + ROOT=$(pwd) ########################## ZIM ########################## @@ -7,11 +10,7 @@ ROOT=$(pwd) # git clone https://gerrit.wikimedia.org/r/p/openzim.git # modify ffstream.cpp, replace stat64 with stat -LZMAHEADERPATH="/Volumes/Data/Developer/build/xz-5.2.2/build/Universal/include" -ZIMREADERPATH=$ROOT/openzim/zimlib -cd $ZIMREADERPATH - -# ./autogen.sh +LZMAHEADERPATH="/Volumes/Data/Developer/Kiwix/Kiwix/libkiwix/include" build_iOS() { @@ -24,12 +23,17 @@ build_iOS() SDKROOT="$(xcodebuild -version -sdk iphoneos | grep -E '^Path' | sed 's/Path: //')" fi - export CC="$(xcrun -sdk iphoneos -find clang)" + export MACOSX_DEPLOYMENT_TARGET="10.4" + + export CC="$(xcrun -find clang)" export CFLAGS="-fembed-bitcode -isysroot $SDKROOT -arch ${ARCH} -miphoneos-version-min=9.0 -I$LZMAHEADERPATH" export CPP="$CC -E" export CPPFLAGS="$CFLAGS" + export CXX="$(xcrun -find clang++)" + export CXXFLAGS="$CFLAGS -stdlib=libc++ -std=c++11" + export LDFLAGS="-arch ${ARCH} -isysroot $SDKROOT" if [ $ARCH == "i386" ] || [ $ARCH == "x86_64" ]; @@ -63,6 +67,28 @@ build_OSX() make && make install && make clean } +distribute_iOS() { + iOSBUILDDir=$(pwd)/build/iOS + cd $iOSBUILDDir + mkdir -p universal/lib + + cd armv7/lib + for file in *.a + do + cd $iOSBUILDDir + lipo -create armv7/lib/$file armv7s/lib/$file arm64/lib/$file x86_64/lib/$file i386/lib/$file -output universal/lib/$file + done + + # cd armv7/lib + # for file in *.dylib + # do + # cd $iOSBUILDDir + # lipo -create armv7/lib/$file armv7s/lib/$file arm64/lib/$file x86_64/lib/$file i386/lib/$file -output universal/lib/$file + # done + + cp -r armv7/include universal +} + distribute() { cd $ZIMREADERPATH/build mkdir -p Universal/iOS/lib @@ -92,9 +118,10 @@ distribute() { # build_iOS armv7 # build_iOS armv7s # build_iOS arm64 +distribute_iOS # build_OSX i386 # build_OSX x86_64 -distribute +# distribute diff --git a/Podfile b/Podfile index 5ff94190a..3b66ed567 100644 --- a/Podfile +++ b/Podfile @@ -8,7 +8,7 @@ platform :ios, '9.0' pod 'DateTools' pod 'DZNEmptyDataSet' pod 'SwiftyUserDefaults' -pod 'PSOperations/Core', '~> 2.3' +pod 'Operations', :git => 'https://github.com/ProcedureKit/ProcedureKit.git', :branch => 'swift/2.3' end @@ -17,6 +17,6 @@ target 'Kiwix-OSX' do platform :osx, '10.10' pod 'DateTools' -pod 'SwiftyUserDefaults' +pod 'Operations', :git => 'https://github.com/ProcedureKit/ProcedureKit.git', :branch => 'swift/2.3' end diff --git a/Podfile.lock b/Podfile.lock index ce5b9c836..f7b455cdf 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,21 +1,33 @@ PODS: - DateTools (1.7.0) - - DZNEmptyDataSet (1.8) - - PSOperations/Core (2.3.0) + - DZNEmptyDataSet (1.8.1) + - Operations (3.3.1): + - Operations/Standard (= 3.3.1) + - Operations/Standard (3.3.1) - SwiftyUserDefaults (2.2.0) DEPENDENCIES: - DateTools - DZNEmptyDataSet - - PSOperations/Core (~> 2.3) + - Operations (from `https://github.com/ProcedureKit/ProcedureKit.git`, branch `swift/2.3`) - SwiftyUserDefaults +EXTERNAL SOURCES: + Operations: + :branch: swift/2.3 + :git: https://github.com/ProcedureKit/ProcedureKit.git + +CHECKOUT OPTIONS: + Operations: + :commit: e79d22bc32e2e4faad6cdcde31c71187357b1154 + :git: https://github.com/ProcedureKit/ProcedureKit.git + SPEC CHECKSUMS: DateTools: 53288ee8b905fdc75897a1e6b5cc0144b14cba60 - DZNEmptyDataSet: d2351b2e8daefa40433ef292e246e21f6be31a7b - PSOperations: 81a4d50a4efe96f6d090dc0e7eb45d9fef79ff45 + DZNEmptyDataSet: 9525833b9e68ac21c30253e1d3d7076cc828eaa7 + Operations: 6a33d325dae88de21b8edc69b9884fce01aea22b SwiftyUserDefaults: e7c8197a9d4068702e7f2406a968cae413b8de27 -PODFILE CHECKSUM: b9d1499b8e98a823777c72ddb35e782d499bac14 +PODFILE CHECKSUM: dafe7442de9229d78c81ec09646e9230caf12c71 COCOAPODS: 1.0.1