Skip to content

Commit 37a5eea

Browse files
committed
Merge branch 'develop' of https://github.com/Async-Swift/AsyncSwift into develop
2 parents 824aa40 + 3e53e92 commit 37a5eea

File tree

6 files changed

+38
-11
lines changed

6 files changed

+38
-11
lines changed

AsyncSwift.xcodeproj/project.pbxproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@
5656
E94F92C728D2505100D9E759 /* Ticketing.swift in Sources */ = {isa = PBXBuildFile; fileRef = E94F92C628D2505100D9E759 /* Ticketing.swift */; };
5757
E9E2A4D828CEC5680016AEFF /* WebView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9E2A4D728CEC5680016AEFF /* WebView.swift */; };
5858
FBCCC4F32ACAB5BD00FFF26B /* SDWebImageSwiftUI in Frameworks */ = {isa = PBXBuildFile; productRef = FBCCC4F22ACAB5BD00FFF26B /* SDWebImageSwiftUI */; };
59+
FBDEF9A32AD2A66600FF7028 /* GitHubStorageURL.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBDEF9A22AD2A66600FF7028 /* GitHubStorageURL.swift */; };
60+
FBDEF9A42AD2A66600FF7028 /* GitHubStorageURL.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBDEF9A22AD2A66600FF7028 /* GitHubStorageURL.swift */; };
5961
FBF437072AC9562B00B22B05 /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FBF437062AC9562B00B22B05 /* WidgetKit.framework */; };
6062
FBF437092AC9562B00B22B05 /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FBF437082AC9562B00B22B05 /* SwiftUI.framework */; };
6163
FBF4370C2AC9562B00B22B05 /* AsyncSwiftWidgetBundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBF4370B2AC9562B00B22B05 /* AsyncSwiftWidgetBundle.swift */; };
@@ -138,6 +140,7 @@
138140
E9171EFF28D15426002FAF52 /* TicketingView+Observed.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "TicketingView+Observed.swift"; sourceTree = "<group>"; };
139141
E94F92C628D2505100D9E759 /* Ticketing.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Ticketing.swift; sourceTree = "<group>"; };
140142
E9E2A4D728CEC5680016AEFF /* WebView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WebView.swift; sourceTree = "<group>"; };
143+
FBDEF9A22AD2A66600FF7028 /* GitHubStorageURL.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GitHubStorageURL.swift; sourceTree = "<group>"; };
141144
FBF437052AC9562B00B22B05 /* AsyncSwiftWidgetExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = AsyncSwiftWidgetExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
142145
FBF437062AC9562B00B22B05 /* WidgetKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WidgetKit.framework; path = System/Library/Frameworks/WidgetKit.framework; sourceTree = SDKROOT; };
143146
FBF437082AC9562B00B22B05 /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; };
@@ -255,6 +258,7 @@
255258
children = (
256259
C63D444B291BDCDC005D5AE6 /* KeyChainManager.swift */,
257260
C69C13BE2913EC9400D9B47F /* FirebaseManager.swift */,
261+
FBDEF9A22AD2A66600FF7028 /* GitHubStorageURL.swift */,
258262
);
259263
path = Managers;
260264
sourceTree = "<group>";
@@ -457,6 +461,7 @@
457461
C6AA71E828FC65680091A868 /* Text+.swift in Sources */,
458462
C68DE94C28C76F3200CA4CC8 /* AppDelegate.swift in Sources */,
459463
E94F92C728D2505100D9E759 /* Ticketing.swift in Sources */,
464+
FBDEF9A32AD2A66600FF7028 /* GitHubStorageURL.swift in Sources */,
460465
C69C13C1291418A000D9B47F /* ProfileEditView.swift in Sources */,
461466
C63D4450291BDD2B005D5AE6 /* String+.swift in Sources */,
462467
C63D444C291BDCDC005D5AE6 /* KeyChainManager.swift in Sources */,
@@ -504,6 +509,7 @@
504509
FBF4370E2AC9562B00B22B05 /* AsyncSwiftWidget.swift in Sources */,
505510
FBF4370C2AC9562B00B22B05 /* AsyncSwiftWidgetBundle.swift in Sources */,
506511
FBF4371B2AC9588800B22B05 /* AsyncSwiftWidgetEntryView.swift in Sources */,
512+
FBDEF9A42AD2A66600FF7028 /* GitHubStorageURL.swift in Sources */,
507513
);
508514
runOnlyForDeploymentPostprocessing = 0;
509515
};
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//
2+
// GitHubStorageURL.swift
3+
// AsyncSwift
4+
//
5+
// Created by 김인섭 on 10/8/23.
6+
//
7+
8+
import Foundation
9+
10+
enum GitHubStorageURL {
11+
12+
static let baseUrl = "https://async-swift.github.io/jsonstorage"
13+
static let customDomain = "https://asyncswift.info/"
14+
15+
static let widgetLargeImage = customDomain + "/Images/widget-large.svg"
16+
static let eventData = GitHubStorageURL.baseUrl + "/asyncswift.json"
17+
static var stampImage: (String) -> String {{ event in
18+
GitHubStorageURL.baseUrl + "/Images/Stamp/" + event + "/stamp.png"
19+
}}
20+
static let ticketingData = GitHubStorageURL.baseUrl + "/ticketing.json"
21+
}

AsyncSwift/Observed/EventView+Observed.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ final class EventViewObserved: ObservableObject {
1717
var cancellable = Set<AnyCancellable>()
1818

1919
func getEventData() {
20-
let urlString = "https://async-swift.github.io/jsonstorage/asyncswift.json"
21-
let url = URL(string: urlString)!
20+
let url = URL(string: GitHubStorageURL.eventData)!
2221
URLSession.shared.dataTaskPublisher(for: url)
2322
.map(\.data)
2423
.decode(type: Event.self, decoder: JSONDecoder())

AsyncSwift/Observed/StampView+Observed.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ extension StampView {
4141
guard let self else { return }
4242
let event = $0.element
4343
let index = $0.offset
44-
45-
let urlString = "https://raw.githubusercontent.com/Async-Swift/jsonstorage/main/Images/Stamp/" + event + "/stamp.png"
46-
let url = URL(string: urlString)!
44+
let url = URL(string: GitHubStorageURL.stampImage(event))!
4745

4846
URLSession.shared.dataTaskPublisher(for: url)
4947
.map(\.data)

AsyncSwift/Observed/TicketingView+Observed.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ extension TicketingView {
2424
}
2525

2626
func getTicketingData() {
27-
let urlString = "https://raw.githubusercontent.com/Async-Swift/jsonstorage/main/ticketing.json"
28-
let url = URL(string: urlString)!
27+
let url = URL(string: GitHubStorageURL.ticketingData)!
2928
URLSession.shared.dataTaskPublisher(for: url)
3029
.map(\.data)
3130
.decode(type: Ticketing.self, decoder: JSONDecoder())

AsyncSwiftWidget/AsyncSwiftWidget.swift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ struct Provider: TimelineProvider {
2727
}
2828

2929
func getRemoteImage() -> Data? {
30-
let urlString = "https://raw.githubusercontent.com/Async-Swift/jsonstorage/a94eb982e9b9db90543de1d574a6dc5f0c637f5b/Images/widget-large.svg"
31-
return try? Data(contentsOf: URL(string: urlString)!)
30+
try? Data(contentsOf: URL(string: GitHubStorageURL.widgetLargeImage)!)
3231
}
3332
}
3433

@@ -54,7 +53,12 @@ struct AsyncSwiftWidget: Widget {
5453

5554
struct AsyncSwiftWidget_Previews: PreviewProvider {
5655
static var previews: some View {
57-
AsyncSwiftWidgetEntryView(entry: SimpleEntry(date: Date(), imageData: nil))
58-
.previewContext(WidgetPreviewContext(family: .systemSmall))
56+
AsyncSwiftWidgetEntryView(
57+
entry: SimpleEntry(
58+
date: Date(),
59+
imageData: try? Data(contentsOf: URL(string: GitHubStorageURL.widgetLargeImage)!)
60+
)
61+
)
62+
.previewContext(WidgetPreviewContext(family: .systemSmall))
5963
}
6064
}

0 commit comments

Comments
 (0)