Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions HowToUse.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
# 🔎 How To Use

### Folder Edit

|폴더 관리|
|:---:|
|<img alt="image" src="https://github.com/42Box/iOS/assets/85754295/f5164646-5ba0-4193-b9b6-eb1c4e01163e">|
|Manage folders|
|<img alt="image" src="https://github.com/42Box/iOS/assets/116494364/e07a8b51-97f6-4c45-a857-63bfb0e42564">|

### Share Extension

|앱 외부에서 가져오기|
|:---:|
|<img alt="image" src="https://github.com/42Box/iOS/assets/85754295/cb1f0768-3fe6-40b1-9ca3-ff50f53119f4">|
|Importing from the other App|
|<img alt="image" src="https://github.com/42Box/iOS/assets/116494364/448b6272-8b2e-4127-99f1-4a504ed1441a">|

### Refresh Controller

|내부에서 북마크 추가하기|
|:---:|
|<img alt="image" src="https://github.com/42Box/iOS/assets/85754295/7e83aeb6-8518-4183-8084-48e70087a304">|
|Internal Add Bookmark|
|<img alt="image" src="https://github.com/42Box/iOS/assets/116494364/9c8dfdaf-d1da-4e7a-bca9-221017dc1e5d">|

### Shortcuts for bookmark lists

|북마크리스트들의 상호작용|
|:---:|
|<img alt="image" src="https://github.com/42Box/iOS/assets/85754295/82a5941c-e7d1-43f4-96bd-649ecfcc312e">|
|Preview, Context menu|
|<img alt="image" src="https://github.com/42Box/iOS/assets/116494364/0d1a1e51-f9d5-4c65-9883-538c95a977ed">|

### Settings menu
|테마 및 설정|
|:---:|
|<img alt="image" src="https://github.com/42Box/iOS/assets/85754295/73f09320-2d85-4ba3-a3b8-067a49a33c55">|
|Theme and Settings|
|<img alt="image" src="https://github.com/42Box/iOS/assets/116494364/edda41cb-e6f9-4113-9b98-7851efe24a58">|
16 changes: 12 additions & 4 deletions Project.swift
Original file line numberDiff line numberDiff line change
Expand Up@@ -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 {
Expand All@@ -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": [
Expand All@@ -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": [
Expand Down
44 changes: 44 additions & 0 deletions README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -98,3 +98,47 @@
</tr>

</table>

<br/>
<br/>

# 🔎 How To Use

### Folder Edit

|폴더 관리|
|:---:|
|<img alt="image" src="https://github.com/42Box/iOS/assets/85754295/f5164646-5ba0-4193-b9b6-eb1c4e01163e">|
|Manage folders|
|<img alt="image" src="https://github.com/42Box/iOS/assets/116494364/e07a8b51-97f6-4c45-a857-63bfb0e42564">|

### Share Extension

|앱 외부에서 가져오기|
|:---:|
|<img alt="image" src="https://github.com/42Box/iOS/assets/85754295/cb1f0768-3fe6-40b1-9ca3-ff50f53119f4">|
|Importing from the other App|
|<img alt="image" src="https://github.com/42Box/iOS/assets/116494364/448b6272-8b2e-4127-99f1-4a504ed1441a">|

### Refresh Controller

|내부에서 북마크 추가하기|
|:---:|
|<img alt="image" src="https://github.com/42Box/iOS/assets/85754295/7e83aeb6-8518-4183-8084-48e70087a304">|
|Internal Add Bookmark|
|<img alt="image" src="https://github.com/42Box/iOS/assets/116494364/9c8dfdaf-d1da-4e7a-bca9-221017dc1e5d">|

### Shortcuts for bookmark lists

|북마크리스트들의 상호작용|
|:---:|
|<img alt="image" src="https://github.com/42Box/iOS/assets/85754295/82a5941c-e7d1-43f4-96bd-649ecfcc312e">|
|Preview, Context menu|
|<img alt="image" src="https://github.com/42Box/iOS/assets/116494364/0d1a1e51-f9d5-4c65-9883-538c95a977ed">|

### Settings menu
|테마 및 설정|
|:---:|
|<img alt="image" src="https://github.com/42Box/iOS/assets/85754295/73f09320-2d85-4ba3-a3b8-067a49a33c55">|
|Theme and Settings|
|<img alt="image" src="https://github.com/42Box/iOS/assets/116494364/edda41cb-e6f9-4113-9b98-7851efe24a58">|
Original file line numberDiff line numberDiff line change
Expand Up@@ -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:
Expand Down
11 changes: 0 additions & 11 deletions iBox/Sources/Extension/UIView+Extension.swift
Original file line numberDiff line numberDiff line change
Expand Up@@ -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)
}
}

}
5 changes: 4 additions & 1 deletion iBox/Sources/Initializer/DefaultData.swift
Original file line numberDiff line numberDiff line change
Expand Up@@ -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")!
Expand All@@ -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)")
Expand Down
17 changes: 10 additions & 7 deletions iBox/Sources/Initializer/DefaultDataModel.swift
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,6 +9,7 @@ import Foundation


struct FolderData: Codable {
var favorite: String
var list: [BookmarkData]
}

Expand All@@ -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/")!)
])
]
}
2 changes: 1 addition & 1 deletion iBox/Sources/Shared/WebViewPreloader.swift
Original file line numberDiff line numberDiff line change
Expand Up@@ -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() {}

Expand Down