Skip to content

Commit 9aeccfb

Browse files
authored
Main Version 1.0.1 (#270)
fix: default url logic (#269)
1 parent 678bdc7 commit 9aeccfb

8 files changed

Lines changed: 115 additions & 26 deletions

File tree

HowToUse.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# 🔎 How To Use
2+
3+
### Folder Edit
4+
5+
|폴더 관리|
6+
|:---:|
7+
|<img alt="image" src="https://github.com/42Box/iOS/assets/85754295/f5164646-5ba0-4193-b9b6-eb1c4e01163e">|
8+
|Manage folders|
9+
|<img alt="image" src="https://github.com/42Box/iOS/assets/116494364/e07a8b51-97f6-4c45-a857-63bfb0e42564">|
10+
11+
### Share Extension
12+
13+
|앱 외부에서 가져오기|
14+
|:---:|
15+
|<img alt="image" src="https://github.com/42Box/iOS/assets/85754295/cb1f0768-3fe6-40b1-9ca3-ff50f53119f4">|
16+
|Importing from the other App|
17+
|<img alt="image" src="https://github.com/42Box/iOS/assets/116494364/448b6272-8b2e-4127-99f1-4a504ed1441a">|
18+
19+
### Refresh Controller
20+
21+
|내부에서 북마크 추가하기|
22+
|:---:|
23+
|<img alt="image" src="https://github.com/42Box/iOS/assets/85754295/7e83aeb6-8518-4183-8084-48e70087a304">|
24+
|Internal Add Bookmark|
25+
|<img alt="image" src="https://github.com/42Box/iOS/assets/116494364/9c8dfdaf-d1da-4e7a-bca9-221017dc1e5d">|
26+
27+
### Shortcuts for bookmark lists
28+
29+
|북마크리스트들의 상호작용|
30+
|:---:|
31+
|<img alt="image" src="https://github.com/42Box/iOS/assets/85754295/82a5941c-e7d1-43f4-96bd-649ecfcc312e">|
32+
|Preview, Context menu|
33+
|<img alt="image" src="https://github.com/42Box/iOS/assets/116494364/0d1a1e51-f9d5-4c65-9883-538c95a977ed">|
34+
35+
### Settings menu
36+
|테마 및 설정|
37+
|:---:|
38+
|<img alt="image" src="https://github.com/42Box/iOS/assets/85754295/73f09320-2d85-4ba3-a3b8-067a49a33c55">|
39+
|Theme and Settings|
40+
|<img alt="image" src="https://github.com/42Box/iOS/assets/116494364/edda41cb-e6f9-4113-9b98-7851efe24a58">|

Project.swift

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ protocol ProjectFactory {
99
func generateTarget() -> [Target]
1010
}
1111

12+
// MARK: - Plist.Value Extension
13+
extension Plist.Value {
14+
static var displayName: Plist.Value = "42Box"
15+
static var displayShareExtensionName: Plist.Value = "42Box.Share"
16+
static var appVersion: Plist.Value = "1.0.1"
17+
18+
}
19+
1220
// MARK: - iBox Factory
1321

1422
class iBoxFactory: ProjectFactory {
@@ -29,9 +37,9 @@ class iBoxFactory: ProjectFactory {
2937

3038
private let appInfoPlist: [String: Plist.Value] = [
3139
"ITSAppUsesNonExemptEncryption": false,
32-
"CFBundleDisplayName": "42Box",
40+
"CFBundleDisplayName": Plist.Value.displayName,
3341
"CFBundleName": "iBox",
34-
"CFBundleShortVersionString": "1.0.0",
42+
"CFBundleShortVersionString": Plist.Value.appVersion,
3543
"CFBundleVersion": "1",
3644
"UILaunchStoryboardName": "LaunchScreen",
3745
"UIApplicationSceneManifest": [
@@ -58,8 +66,8 @@ class iBoxFactory: ProjectFactory {
5866
]
5967

6068
private let shareExtensionInfoPlist: [String: Plist.Value] = [
61-
"CFBundleDisplayName": "42Box.Share",
62-
"CFBundleShortVersionString": "1.0.0",
69+
"CFBundleDisplayName": Plist.Value.displayShareExtensionName,
70+
"CFBundleShortVersionString": Plist.Value.appVersion,
6371
"CFBundleVersion": "1",
6472
"NSExtension": [
6573
"NSExtensionAttributes": [

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,47 @@
9898
</tr>
9999

100100
</table>
101+
102+
<br/>
103+
<br/>
104+
105+
# 🔎 How To Use
106+
107+
### Folder Edit
108+
109+
|폴더 관리|
110+
|:---:|
111+
|<img alt="image" src="https://github.com/42Box/iOS/assets/85754295/f5164646-5ba0-4193-b9b6-eb1c4e01163e">|
112+
|Manage folders|
113+
|<img alt="image" src="https://github.com/42Box/iOS/assets/116494364/e07a8b51-97f6-4c45-a857-63bfb0e42564">|
114+
115+
### Share Extension
116+
117+
|앱 외부에서 가져오기|
118+
|:---:|
119+
|<img alt="image" src="https://github.com/42Box/iOS/assets/85754295/cb1f0768-3fe6-40b1-9ca3-ff50f53119f4">|
120+
|Importing from the other App|
121+
|<img alt="image" src="https://github.com/42Box/iOS/assets/116494364/448b6272-8b2e-4127-99f1-4a504ed1441a">|
122+
123+
### Refresh Controller
124+
125+
|내부에서 북마크 추가하기|
126+
|:---:|
127+
|<img alt="image" src="https://github.com/42Box/iOS/assets/85754295/7e83aeb6-8518-4183-8084-48e70087a304">|
128+
|Internal Add Bookmark|
129+
|<img alt="image" src="https://github.com/42Box/iOS/assets/116494364/9c8dfdaf-d1da-4e7a-bca9-221017dc1e5d">|
130+
131+
### Shortcuts for bookmark lists
132+
133+
|북마크리스트들의 상호작용|
134+
|:---:|
135+
|<img alt="image" src="https://github.com/42Box/iOS/assets/85754295/82a5941c-e7d1-43f4-96bd-649ecfcc312e">|
136+
|Preview, Context menu|
137+
|<img alt="image" src="https://github.com/42Box/iOS/assets/116494364/0d1a1e51-f9d5-4c65-9883-538c95a977ed">|
138+
139+
### Settings menu
140+
|테마 및 설정|
141+
|:---:|
142+
|<img alt="image" src="https://github.com/42Box/iOS/assets/85754295/73f09320-2d85-4ba3-a3b8-067a49a33c55">|
143+
|Theme and Settings|
144+
|<img alt="image" src="https://github.com/42Box/iOS/assets/116494364/edda41cb-e6f9-4113-9b98-7851efe24a58">|

iBox/Sources/CustomLaunchScreen/CustomLaunchScreenViewController.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ class CustomLaunchScreenViewController: UIViewController {
4444
switch result {
4545
case .success, .maxRetryReached, .later:
4646
DefaultData.insertDefaultDataIfNeeded() {
47-
self?.transitionToNextScreen()
47+
DispatchQueue.main.async {
48+
self?.transitionToNextScreen()
49+
}
4850
}
4951
print("App 정상 실행")
5052
case .urlError:

iBox/Sources/Extension/UIView+Extension.swift

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,5 @@ extension UIView {
3939
self.layer.mask = mask
4040
}
4141
}
42-
43-
// MARK: - 뷰 계층 구조 log
44-
func printViewHierarchy(level: Int = 0) {
45-
let padding = String(repeating: " ", count: level * 2)
46-
let viewInfo = "\(padding)\(type(of: self)) - Frame: \(self.frame)"
47-
print(viewInfo)
48-
49-
for subview in self.subviews {
50-
subview.printViewHierarchy(level: level + 1)
51-
}
52-
}
53-
42+
5443
}

iBox/Sources/Initializer/DefaultData.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class DefaultData {
2828

2929
static func fetchDefaultData(completion: @escaping ([Folder]) -> Void) {
3030
let localDic: [String : String] = ["Seoul" : "default-kr", "default" : "default"]
31-
let cityName = "Seoul" // 추후 global 예정
31+
let cityName = "Seoul"
3232
let local = localDic[cityName] ?? "default"
3333

3434
let url = URL(string: "https://raw.githubusercontent.com/42Box/versioning/main/\(local).json")!
@@ -42,6 +42,9 @@ class DefaultData {
4242
do {
4343
let folderData = try JSONDecoder().decode(FolderData.self, from: data)
4444
let folders = [Folder(id: UUID(), name: "42 \(cityName)", bookmarks: folderData.list.map { Bookmark(id: UUID(), name: $0.name, url: URL(string: $0.url)!) })]
45+
if let defaultURLData = URL(string: folderData.favorite) {
46+
DefaultDataLoader.defaultURL = defaultURLData
47+
}
4548
completion(folders)
4649
} catch {
4750
print("Error decoding JSON: \(error)")

iBox/Sources/Initializer/DefaultDataModel.swift

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import Foundation
99

1010

1111
struct FolderData: Codable {
12+
var favorite: String
1213
var list: [BookmarkData]
1314
}
1415

@@ -18,14 +19,16 @@ struct BookmarkData: Codable {
1819
}
1920

2021
struct DefaultDataLoader {
22+
static var defaultURL = URL(string: "https://github.com/42Box/iOS/blob/main/HowToUse.md#-how-to-use")!
2123
static let defaultData = [
22-
Folder(id: UUID(), name: "42 폴더", bookmarks: [
23-
Bookmark(id: UUID(), name: "42 Intra", url: URL(string: "https://profile.intra.42.fr/")!),
24-
Bookmark(id: UUID(), name: "42Where", url: URL(string: "https://www.where42.kr/")! ),
25-
Bookmark(id: UUID(), name: "42Stat", url: URL(string: "https://stat.42seoul.kr/")!),
26-
Bookmark(id: UUID(), name: "집현전", url: URL(string: "https://42library.kr/")!),
27-
Bookmark(id: UUID(), name: "42gg", url: URL(string: "https://gg.42seoul.kr/")!),
28-
Bookmark(id: UUID(), name: "24HANE", url: URL(string: "https://24hoursarenotenough.42seoul.kr/")!)
24+
Folder(id: UUID(), name: "42Box", bookmarks: [
25+
Bookmark(id: UUID(), name: "How to use 42Box", url: URL(string: "https://github.com/42Box/iOS/blob/main/HowToUse.md#-how-to-use")!),
26+
// Bookmark(id: UUID(), name: "42 Intra", url: URL(string: "https://profile.intra.42.fr/")!),
27+
// Bookmark(id: UUID(), name: "42Where", url: URL(string: "https://www.where42.kr/")! ),
28+
// Bookmark(id: UUID(), name: "42Stat", url: URL(string: "https://stat.42seoul.kr/")!),
29+
// Bookmark(id: UUID(), name: "집현전", url: URL(string: "https://42library.kr/")!),
30+
// Bookmark(id: UUID(), name: "42gg", url: URL(string: "https://gg.42seoul.kr/")!),
31+
// Bookmark(id: UUID(), name: "24HANE", url: URL(string: "https://24hoursarenotenough.42seoul.kr/")!)
2932
])
3033
]
3134
}

iBox/Sources/Shared/WebViewPreloader.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import WebKit
1111
class WebViewPreloader {
1212
static let shared = WebViewPreloader()
1313
private var favoriteView: (url: URL, webView: WebView)?
14-
private var defaultUrl = URL(string: "https://profile.intra.42.fr/")!
14+
private var defaultUrl = DefaultDataLoader.defaultURL
1515

1616
private init() {}
1717

0 commit comments

Comments
 (0)