diff --git a/HowToUse.md b/HowToUse.md new file mode 100644 index 0000000..8b11610 --- /dev/null +++ b/HowToUse.md @@ -0,0 +1,40 @@ +# ๐Ÿ”Ž How To Use + +### Folder Edit + +|ํด๋” ๊ด€๋ฆฌ| +|:---:| +|image| +|Manage folders| +|image| + +### Share Extension + +|์•ฑ ์™ธ๋ถ€์—์„œ ๊ฐ€์ ธ์˜ค๊ธฐ| +|:---:| +|image| +|Importing from the other App| +|image| + +### Refresh Controller + +|๋‚ด๋ถ€์—์„œ ๋ถ๋งˆํฌ ์ถ”๊ฐ€ํ•˜๊ธฐ| +|:---:| +|image| +|Internal Add Bookmark| +|image| + +### Shortcuts for bookmark lists + +|๋ถ๋งˆํฌ๋ฆฌ์ŠคํŠธ๋“ค์˜ ์ƒํ˜ธ์ž‘์šฉ| +|:---:| +|image| +|Preview, Context menu| +|image| + +### Settings menu +|ํ…Œ๋งˆ ๋ฐ ์„ค์ •| +|:---:| +|image| +|Theme and Settings| +|image| diff --git a/Project.swift b/Project.swift index 3fbb9ed..cdb974f 100644 --- a/Project.swift +++ b/Project.swift @@ -9,6 +9,14 @@ protocol ProjectFactory { func generateTarget() -> [Target] } +// MARK: - Plist.Value Extension +extension Plist.Value { + static var displayName: Plist.Value = "42Box" + static var displayShareExtensionName: Plist.Value = "42Box.Share" + static var appVersion: Plist.Value = "1.0.1" + +} + // MARK: - iBox Factory class iBoxFactory: ProjectFactory { @@ -29,9 +37,9 @@ class iBoxFactory: ProjectFactory { private let appInfoPlist: [String: Plist.Value] = [ "ITSAppUsesNonExemptEncryption": false, - "CFBundleDisplayName": "42Box", + "CFBundleDisplayName": Plist.Value.displayName, "CFBundleName": "iBox", - "CFBundleShortVersionString": "1.0.0", + "CFBundleShortVersionString": Plist.Value.appVersion, "CFBundleVersion": "1", "UILaunchStoryboardName": "LaunchScreen", "UIApplicationSceneManifest": [ @@ -58,8 +66,8 @@ class iBoxFactory: ProjectFactory { ] private let shareExtensionInfoPlist: [String: Plist.Value] = [ - "CFBundleDisplayName": "42Box.Share", - "CFBundleShortVersionString": "1.0.0", + "CFBundleDisplayName": Plist.Value.displayShareExtensionName, + "CFBundleShortVersionString": Plist.Value.appVersion, "CFBundleVersion": "1", "NSExtension": [ "NSExtensionAttributes": [ diff --git a/README.md b/README.md index 4628625..658b48f 100644 --- a/README.md +++ b/README.md @@ -98,3 +98,47 @@ + +
+
+ +# ๐Ÿ”Ž How To Use + +### Folder Edit + +|ํด๋” ๊ด€๋ฆฌ| +|:---:| +|image| +|Manage folders| +|image| + +### Share Extension + +|์•ฑ ์™ธ๋ถ€์—์„œ ๊ฐ€์ ธ์˜ค๊ธฐ| +|:---:| +|image| +|Importing from the other App| +|image| + +### Refresh Controller + +|๋‚ด๋ถ€์—์„œ ๋ถ๋งˆํฌ ์ถ”๊ฐ€ํ•˜๊ธฐ| +|:---:| +|image| +|Internal Add Bookmark| +|image| + +### Shortcuts for bookmark lists + +|๋ถ๋งˆํฌ๋ฆฌ์ŠคํŠธ๋“ค์˜ ์ƒํ˜ธ์ž‘์šฉ| +|:---:| +|image| +|Preview, Context menu| +|image| + +### Settings menu +|ํ…Œ๋งˆ ๋ฐ ์„ค์ •| +|:---:| +|image| +|Theme and Settings| +|image| diff --git a/iBox/Sources/CustomLaunchScreen/CustomLaunchScreenViewController.swift b/iBox/Sources/CustomLaunchScreen/CustomLaunchScreenViewController.swift index 4110b61..9ddb17a 100644 --- a/iBox/Sources/CustomLaunchScreen/CustomLaunchScreenViewController.swift +++ b/iBox/Sources/CustomLaunchScreen/CustomLaunchScreenViewController.swift @@ -44,7 +44,9 @@ class CustomLaunchScreenViewController: UIViewController { switch result { case .success, .maxRetryReached, .later: DefaultData.insertDefaultDataIfNeeded() { - self?.transitionToNextScreen() + DispatchQueue.main.async { + self?.transitionToNextScreen() + } } print("App ์ •์ƒ ์‹คํ–‰") case .urlError: diff --git a/iBox/Sources/Extension/UIView+Extension.swift b/iBox/Sources/Extension/UIView+Extension.swift index e7f584c..67979d5 100644 --- a/iBox/Sources/Extension/UIView+Extension.swift +++ b/iBox/Sources/Extension/UIView+Extension.swift @@ -40,15 +40,4 @@ extension UIView { } } - // MARK: - ๋ทฐ ๊ณ„์ธต ๊ตฌ์กฐ log - func printViewHierarchy(level: Int = 0) { - let padding = String(repeating: " ", count: level * 2) - let viewInfo = "\(padding)\(type(of: self)) - Frame: \(self.frame)" - print(viewInfo) - - for subview in self.subviews { - subview.printViewHierarchy(level: level + 1) - } - } - } diff --git a/iBox/Sources/Initializer/DefaultData.swift b/iBox/Sources/Initializer/DefaultData.swift index b33ea54..ad076da 100644 --- a/iBox/Sources/Initializer/DefaultData.swift +++ b/iBox/Sources/Initializer/DefaultData.swift @@ -28,7 +28,7 @@ class DefaultData { static func fetchDefaultData(completion: @escaping ([Folder]) -> Void) { let localDic: [String : String] = ["Seoul" : "default-kr", "default" : "default"] - let cityName = "Seoul" // ์ถ”ํ›„ global ์˜ˆ์ • + let cityName = "Seoul" let local = localDic[cityName] ?? "default" let url = URL(string: "https://raw.githubusercontent.com/42Box/versioning/main/\(local).json")! @@ -42,6 +42,9 @@ class DefaultData { do { let folderData = try JSONDecoder().decode(FolderData.self, from: data) let folders = [Folder(id: UUID(), name: "42 \(cityName)", bookmarks: folderData.list.map { Bookmark(id: UUID(), name: $0.name, url: URL(string: $0.url)!) })] + if let defaultURLData = URL(string: folderData.favorite) { + DefaultDataLoader.defaultURL = defaultURLData + } completion(folders) } catch { print("Error decoding JSON: \(error)") diff --git a/iBox/Sources/Initializer/DefaultDataModel.swift b/iBox/Sources/Initializer/DefaultDataModel.swift index 7a3bb89..eb26ada 100644 --- a/iBox/Sources/Initializer/DefaultDataModel.swift +++ b/iBox/Sources/Initializer/DefaultDataModel.swift @@ -9,6 +9,7 @@ import Foundation struct FolderData: Codable { + var favorite: String var list: [BookmarkData] } @@ -18,14 +19,16 @@ struct BookmarkData: Codable { } struct DefaultDataLoader { + static var defaultURL = URL(string: "https://github.com/42Box/iOS/blob/main/HowToUse.md#-how-to-use")! static let defaultData = [ - Folder(id: UUID(), name: "42 ํด๋”", bookmarks: [ - Bookmark(id: UUID(), name: "42 Intra", url: URL(string: "https://profile.intra.42.fr/")!), - Bookmark(id: UUID(), name: "42Where", url: URL(string: "https://www.where42.kr/")! ), - Bookmark(id: UUID(), name: "42Stat", url: URL(string: "https://stat.42seoul.kr/")!), - Bookmark(id: UUID(), name: "์ง‘ํ˜„์ „", url: URL(string: "https://42library.kr/")!), - Bookmark(id: UUID(), name: "42gg", url: URL(string: "https://gg.42seoul.kr/")!), - Bookmark(id: UUID(), name: "24HANE", url: URL(string: "https://24hoursarenotenough.42seoul.kr/")!) + Folder(id: UUID(), name: "42Box", bookmarks: [ + Bookmark(id: UUID(), name: "How to use 42Box", url: URL(string: "https://github.com/42Box/iOS/blob/main/HowToUse.md#-how-to-use")!), +// Bookmark(id: UUID(), name: "42 Intra", url: URL(string: "https://profile.intra.42.fr/")!), +// Bookmark(id: UUID(), name: "42Where", url: URL(string: "https://www.where42.kr/")! ), +// Bookmark(id: UUID(), name: "42Stat", url: URL(string: "https://stat.42seoul.kr/")!), +// Bookmark(id: UUID(), name: "์ง‘ํ˜„์ „", url: URL(string: "https://42library.kr/")!), +// Bookmark(id: UUID(), name: "42gg", url: URL(string: "https://gg.42seoul.kr/")!), +// Bookmark(id: UUID(), name: "24HANE", url: URL(string: "https://24hoursarenotenough.42seoul.kr/")!) ]) ] } diff --git a/iBox/Sources/Shared/WebViewPreloader.swift b/iBox/Sources/Shared/WebViewPreloader.swift index 734c0df..5e38112 100644 --- a/iBox/Sources/Shared/WebViewPreloader.swift +++ b/iBox/Sources/Shared/WebViewPreloader.swift @@ -11,7 +11,7 @@ import WebKit class WebViewPreloader { static let shared = WebViewPreloader() private var favoriteView: (url: URL, webView: WebView)? - private var defaultUrl = URL(string: "https://profile.intra.42.fr/")! + private var defaultUrl = DefaultDataLoader.defaultURL private init() {}