Skip to content

Commit 896d26e

Browse files
authored
Update packages and project README (#34)
* Update packages and project README * Remove screenshots
1 parent 9e36fbf commit 896d26e

31 files changed

+191
-968
lines changed

README.md

+1-10
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
- JSON: Network data model JSON files.
2626
- Device: Device data models used in SwiftUI Views and ViewModels. Device models should be created from Network models by using Adapters.
2727
- FileStorage: Local storage functionality.
28-
- Navigation: SwiftUI NavigationPath using an object called CartographyPath and CartographyView. There is also the ability to present toasts, alerts, modals, and action sheets using the CartographyPath.
28+
- Navigation: SwiftUI NavigationPath using OpenBytesNavigation.
2929
- Networking: Networking functionality.
3030
- Notifications: Local Notification functionality.
3131
- Persistence
@@ -41,15 +41,6 @@
4141
- UserRegistration: Tests for register using ViewModels and DI.
4242
- Validation: Tests for different types of data validation.
4343

44-
### Dependency List
45-
46-
- [OpenBytes o](https://github.com/0xOpenBytes/o) <img src="https://img.shields.io/github/v/release/0xOpenBytes/o"/>
47-
- Allows us to get the input and set the output of file, url, the console, and UserNotifications.
48-
- [OpenBytes c](https://github.com/0xOpenBytes/c) <img src="https://img.shields.io/github/v/release/0xOpenBytes/c"/>
49-
- Allows us to transform types from one to another while also providing us the various caching options.
50-
- [Fork](https://github.com/0xLeif/Fork) <img src="https://img.shields.io/github/v/release/0xLeif/Fork"/>
51-
- Fork allows us to run multiple asynchronous tasks at the same time.
52-
5344
## Getting Started
5445

5546
### Installing development dependencies

base/App/RootView.swift

+7-6
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
// RootView.swift
1515
//
1616

17+
import OpenBytesNavigation
1718
import SwiftUI
1819

1920
struct RootView: View {
@@ -27,7 +28,7 @@ struct RootView: View {
2728

2829
var body: some View {
2930
TabView(selection: $navigation.tab) {
30-
CartographyView(path: navigation.home) {
31+
OpenBytesNavigationView(path: navigation.home) {
3132
HomeScreen()
3233
}
3334
.tag(Tab.home)
@@ -36,7 +37,7 @@ struct RootView: View {
3637
Text("Home")
3738
}
3839

39-
CartographyView(path: navigation.search) {
40+
OpenBytesNavigationView(path: navigation.search) {
4041
SearchScreen()
4142
}
4243
.tag(Tab.search)
@@ -45,7 +46,7 @@ struct RootView: View {
4546
Text("Search")
4647
}
4748

48-
CartographyView(path: navigation.profile) {
49+
OpenBytesNavigationView(path: navigation.profile) {
4950
ProfileScreen()
5051
}
5152
.tag(Tab.profile)
@@ -60,9 +61,9 @@ struct RootView: View {
6061
struct RootView_Previews: PreviewProvider {
6162
static var previews: some View {
6263
Navigation.shared.use { navigation -> RootView in
63-
navigation.home = CartographyPath(id: "home.preview")
64-
navigation.search = CartographyPath(id: "search.preview")
65-
navigation.profile = CartographyPath(id: "profile.preview")
64+
navigation.home = OpenBytesNavigationPath(id: "home.preview", isPreview: true)
65+
navigation.search = OpenBytesNavigationPath(id: "search.preview", isPreview: true)
66+
navigation.profile = OpenBytesNavigationPath(id: "profile.preview", isPreview: true)
6667

6768
return RootView(navigation: navigation)
6869
}

base/App/Search/SearchScreen.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
// SearchScreen.swift
1515
//
1616

17+
import OpenBytesNavigation
1718
import SwiftUI
1819

1920
struct SearchScreen: View {
@@ -79,7 +80,7 @@ struct SearchScreen: View {
7980

8081
struct SearchScreen_Previews: PreviewProvider {
8182
static var previews: some View {
82-
CartographyView.preview {
83+
OpenBytesNavigationView.preview {
8384
SearchScreen()
8485
}
8586
}

base/App/Views/AcknowledgmentView.swift

+12-71
Original file line numberDiff line numberDiff line change
@@ -5,88 +5,29 @@
55
// Created by Leif on 1/31/23.
66
//
77

8+
import Disk
9+
import OpenBytesNavigation
810
import SwiftUI
911

10-
struct Acknowledgment: Identifiable {
11-
let id: UUID = UUID()
12+
struct Acknowledgment: Identifiable, Codable, Hashable {
13+
var id: Self { self }
14+
1215
let title: String
1316
let author: String
1417
let url: URL?
1518
let iconURL: URL?
1619
let description: String
1720
}
1821

19-
// swiftlint:disable line_length
2022
extension OBbaseApp {
2123
static var acknowledgments: [Acknowledgment] {
22-
[
23-
Acknowledgment(
24-
title: "Fork",
25-
author: "0xLeif",
26-
url: URL(string: "https://github.com/0xLeif/Fork"),
27-
iconURL: URL(string: "https://avatars.githubusercontent.com/u/8268288?v=4"),
28-
description: "Fork is a Swift library that allows for parallelizing multiple async functions. It provides a Fork struct that takes a single input and splits it into two separate async functions that return different outputs. The two functions can then be merged into one which returns a single output."
29-
),
30-
Acknowledgment(
31-
title: "o",
32-
author: "0xOpenBytes",
33-
url: URL(string: "https://github.com/0xOpenBytes/o"),
34-
iconURL: URL(string: "https://avatars.githubusercontent.com/u/92551192"),
35-
description: "Allows us to get the input and set the output of file, url, the console, and UserNotifications."
36-
),
37-
Acknowledgment(
38-
title: "c",
39-
author: "0xOpenBytes",
40-
url: URL(string: "https://github.com/0xOpenBytes/c"),
41-
iconURL: URL(string: "https://avatars.githubusercontent.com/u/92551192"),
42-
description: "Allows us to transform types from one to another while also providing us the various caching options."
43-
),
44-
Acknowledgment(
45-
title: "Swish",
46-
author: "FullQueueDeveloper",
47-
url: URL(string: "https://github.com/FullQueueDeveloper/Swish"),
48-
iconURL: URL(string: "https://avatars.githubusercontent.com/u/103295874"),
49-
description: "Swish is a Swift script running tool to easily run Swift packages in a supporting relative directory named Swish. Swish pairs nicely with Sh to run shell commands and process shell output from your Swift scripts."
50-
),
51-
Acknowledgment(
52-
title: "Sh",
53-
author: "FullQueueDeveloper",
54-
url: URL(string: "https://github.com/FullQueueDeveloper/Sh"),
55-
iconURL: URL(string: "https://avatars.githubusercontent.com/u/103295874"),
56-
description: "Sh lets you reason about your script in Swift, easily calling shell commands and using their output in your Swift program. Or when orchestrating a build script, simply redirect all output to the terminal, a log file, or /dev/null."
57-
),
58-
Acknowledgment(
59-
title: "ShGit",
60-
author: "FullQueueDeveloper",
61-
url: URL(string: "https://github.com/FullQueueDeveloper/ShGit"),
62-
iconURL: URL(string: "https://avatars.githubusercontent.com/u/103295874"),
63-
description: "Git wrapper for Swift powered by Sh."
64-
),
65-
Acknowledgment(
66-
title: "ShXcrun",
67-
author: "FullQueueDeveloper",
68-
url: URL(string: "https://github.com/FullQueueDeveloper/ShXcrun"),
69-
iconURL: URL(string: "https://avatars.githubusercontent.com/u/103295874"),
70-
description: "A wrapper around xcodebuild, agvtool, and other xcrun tools, built on top of Sh."
71-
),
72-
Acknowledgment(
73-
title: "XcodeGen",
74-
author: "yonaskolb",
75-
url: URL(string: "https://github.com/yonaskolb/XcodeGen"),
76-
iconURL: URL(string: "https://avatars.githubusercontent.com/u/2393781"),
77-
description: "XcodeGen is a command line tool written in Swift that generates your Xcode project using your folder structure and a project spec."
78-
),
79-
Acknowledgment(
80-
title: "xcparse",
81-
author: "ChargePoint",
82-
url: URL(string: "https://github.com/ChargePoint/xcparse"),
83-
iconURL: URL(string: "https://avatars.githubusercontent.com/u/9879654"),
84-
description: "A command line tool to extract code coverage & screenshots from Xcode 11 XCResult files."
85-
)
86-
]
24+
do {
25+
return try Disk.json(named: "oss", type: [Acknowledgment].self) ?? []
26+
} catch {
27+
return []
28+
}
8729
}
8830
}
89-
// swiftlint:enable line_length
9031

9132
struct AcknowledgmentView: View {
9233
let acknowledgments: [Acknowledgment]
@@ -134,7 +75,7 @@ struct AcknowledgmentView: View {
13475
},
13576
label: {
13677
Text(acknowledgment.title)
137-
.font(.title)
78+
.font(.title2)
13879
}
13980
)
14081

@@ -160,7 +101,7 @@ struct AcknowledgmentView: View {
160101

161102
struct OSSAcknowledgmentView_Previews: PreviewProvider {
162103
static var previews: some View {
163-
CartographyView.preview {
104+
OpenBytesNavigationView.preview {
164105
AcknowledgmentView()
165106
}
166107
}

base/App/Views/Components/ImageView.swift

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
// ImageView.swift
1515
//
1616

17+
import Network
1718
import SwiftUI
1819

1920
class ImageViewModel: ObservableObject {

base/Data/JSON/oss.json

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
[
2+
{
3+
"title": "OpenBytesNavigation",
4+
"author": "0xOpenBytes",
5+
"url": "https://github.com/0xOpenBytes/OpenBytesNavigation",
6+
"iconURL": "https://avatars.githubusercontent.com/u/92551192?s=200&v=4",
7+
"description": "SwiftUI library that provides a flexible and easy-to-use navigation system for your SwiftUI apps."
8+
},
9+
{
10+
"title": "Network",
11+
"author": "0xOpenBytes",
12+
"url": "https://github.com/0xOpenBytes/Network",
13+
"iconURL": "https://avatars.githubusercontent.com/u/92551192?s=200&v=4",
14+
"description": "Output and Input for remote URLs using REST."
15+
},
16+
{
17+
"title": "Cache",
18+
"author": "0xOpenBytes",
19+
"url": "https://github.com/0xOpenBytes/Cache",
20+
"iconURL": "https://avatars.githubusercontent.com/u/92551192?s=200&v=4",
21+
"description": "Simple in-memory key-value store."
22+
},
23+
{
24+
"title": "Disk",
25+
"author": "0xOpenBytes",
26+
"url": "https://github.com/0xOpenBytes/Disk",
27+
"iconURL": "https://avatars.githubusercontent.com/u/92551192?s=200&v=4",
28+
"description": "Output and Input for Files."
29+
},
30+
{
31+
"title": "Test",
32+
"author": "0xOpenBytes",
33+
"url": "https://github.com/0xOpenBytes/Test",
34+
"iconURL": "https://avatars.githubusercontent.com/u/92551192?s=200&v=4",
35+
"description": "Test is a simple testing function that allows you to create test suites with multiple steps, expectations, and assertions."
36+
},
37+
{
38+
"title": "Swish",
39+
"author": "FullQueueDeveloper",
40+
"url": "https://github.com/FullQueueDeveloper/Swish",
41+
"iconURL": "https://avatars.githubusercontent.com/u/103295874",
42+
"description": "Swish is a Swift script running tool to easily run Swift packages in a supporting relative directory named Swish. Swish pairs nicely with Sh to run shell commands and process shell output from your Swift scripts."
43+
},
44+
{
45+
"title": "Sh",
46+
"author": "FullQueueDeveloper",
47+
"url": "https://github.com/FullQueueDeveloper/Sh",
48+
"iconURL": "https://avatars.githubusercontent.com/u/103295874",
49+
"description": "Sh lets you reason about your script in Swift, easily calling shell commands and using their output in your Swift program. Or when orchestrating a build script, simply redirect all output to the terminal, a log file, or /dev/null."
50+
},
51+
{
52+
"title": "ShGit",
53+
"author": "FullQueueDeveloper",
54+
"url": "https://github.com/FullQueueDeveloper/ShGit",
55+
"iconURL": "https://avatars.githubusercontent.com/u/103295874",
56+
"description": "Git wrapper for Swift powered by Sh."
57+
},
58+
{
59+
"title": "ShXcrun",
60+
"author": "FullQueueDeveloper",
61+
"url": "https://github.com/FullQueueDeveloper/ShXcrun",
62+
"iconURL": "https://avatars.githubusercontent.com/u/103295874",
63+
"description": "A wrapper around xcodebuild, agvtool, and other xcrun tools, built on top of Sh."
64+
},
65+
{
66+
"title": "Fork",
67+
"author": "0xLeif",
68+
"url": "https://github.com/0xLeif/Fork",
69+
"iconURL": "https://avatars.githubusercontent.com/u/8268288?v=4",
70+
"description": "Fork is a Swift library that allows for parallelizing multiple async functions. It provides a Fork struct that takes a single input and splits it into two separate async functions that return different outputs. The two functions can then be merged into one which returns a single output."
71+
},
72+
{
73+
"title": "Scribe",
74+
"author": "0xLeif",
75+
"url": "https://github.com/0xLeif/Scribe",
76+
"iconURL": "https://avatars.githubusercontent.com/u/8268288?v=4",
77+
"description": "Scribe is a flexible logging library for Swift, designed to make logging easy and efficient."
78+
},
79+
{
80+
"title": "XcodeGen",
81+
"author": "yonaskolb",
82+
"url": "https://github.com/yonaskolb/XcodeGen",
83+
"iconURL": "https://avatars.githubusercontent.com/u/2393781",
84+
"description": "XcodeGen is a command line tool written in Swift that generates your Xcode project using your folder structure and a project spec."
85+
},
86+
{
87+
"title": "xcparse",
88+
"author": "ChargePoint",
89+
"url": "https://github.com/ChargePoint/xcparse",
90+
"iconURL": "https://avatars.githubusercontent.com/u/9879654",
91+
"description": "A command line tool to extract code coverage & screenshots from Xcode 11 XCResult files."
92+
}
93+
]

base/Data/Mock/Mock.swift

+7-6
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,19 @@
1414
// Mock.swift
1515
//
1616

17+
import Disk
1718
import Foundation
1819

1920
enum Mock {
2021
static func json<Value: Codable>(
2122
named: String,
2223
type: Value.Type = Value.self,
2324
using decoder: JSONDecoder = JSONDecoder()
24-
) throws -> Value? {
25-
guard let file = Bundle.main.url(forResource: named, withExtension: "json") else {
26-
return nil
27-
}
28-
29-
return try decoder.decode(Value.self, from: Data(contentsOf: file))
25+
) -> Value? {
26+
try? Disk.json(
27+
named: named,
28+
type: type,
29+
using: decoder
30+
)
3031
}
3132
}

base/FileStorage/DiskCapabilities.swift

+14-3
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,19 @@
1414
// DiskCapabilities.swift
1515
//
1616

17-
import o
17+
import Disk
18+
import Foundation
1819

19-
typealias Disk = o.file
20+
extension Disk: StaticUsable {
21+
static func json<Value: Codable>(
22+
named: String,
23+
type: Value.Type = Value.self,
24+
using decoder: JSONDecoder = JSONDecoder()
25+
) throws -> Value? {
26+
guard let file = Bundle.main.url(forResource: named, withExtension: "json") else {
27+
return nil
28+
}
2029

21-
extension Disk: StaticUsable { }
30+
return try decoder.decode(Value.self, from: Data(contentsOf: file))
31+
}
32+
}

base/Navigation/Implementation/CartographyActionSheet.swift

-25
This file was deleted.

0 commit comments

Comments
 (0)