Skip to content

Commit

Permalink
[ci skip] Run swift-format
Browse files Browse the repository at this point in the history
  • Loading branch information
d-date authored and github-actions[bot] committed Mar 13, 2024
1 parent 46c9353 commit 64b3a80
Show file tree
Hide file tree
Showing 16 changed files with 256 additions and 219 deletions.
7 changes: 4 additions & 3 deletions App/App/App.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import SwiftUI
struct ConfenrenceApp: App {
var body: some Scene {
WindowGroup {
AppView(store: .init(initialState: .init()) {
AppReducer()
})
AppView(
store: .init(initialState: .init()) {
AppReducer()
})
}
}
}
7 changes: 4 additions & 3 deletions App/Clip/ClipApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import SwiftUI
struct AppClipApp: App {
var body: some Scene {
WindowGroup {
AppView(store: .init(initialState: .init()) {
AppReducer()
})
AppView(
store: .init(initialState: .init()) {
AppReducer()
})
}
}
}
14 changes: 7 additions & 7 deletions MyLibrary/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,26 @@ let package = Package(
products: [
.library(
name: "AppFeature",
targets: ["AppFeature"]),
targets: ["AppFeature"])
],
dependencies: [
.package(url: "https://github.com/pointfreeco/swift-composable-architecture", from: "1.9.1"),
.package(url: "https://github.com/zunda-pixel/LicenseProvider", from: "1.1.1")
.package(url: "https://github.com/zunda-pixel/LicenseProvider", from: "1.1.1"),
],
targets: [
.target(
name: "AppFeature",
dependencies: [
"ScheduleFeature",
"SponsorFeature",
"trySwiftFeature"
"trySwiftFeature",
]
),
.target(
name: "DataClient",
dependencies: [
"SharedModels",
.product(name: "ComposableArchitecture", package: "swift-composable-architecture")
.product(name: "ComposableArchitecture", package: "swift-composable-architecture"),
],
resources: [
.process("Resources")
Expand All @@ -45,7 +45,7 @@ let package = Package(
dependencies: [
"DataClient",
"Safari",
.product(name: "ComposableArchitecture", package: "swift-composable-architecture")
.product(name: "ComposableArchitecture", package: "swift-composable-architecture"),
]
),
.target(name: "SharedModels"),
Expand All @@ -54,7 +54,7 @@ let package = Package(
dependencies: [
"DataClient",
"Safari",
.product(name: "ComposableArchitecture", package: "swift-composable-architecture")
.product(name: "ComposableArchitecture", package: "swift-composable-architecture"),
]
),
.target(
Expand All @@ -67,6 +67,6 @@ let package = Package(
plugins: [
.plugin(name: "LicenseProviderPlugin", package: "LicenseProvider")
]
)
),
]
)
9 changes: 6 additions & 3 deletions MyLibrary/Sources/AppFeature/AppView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ public struct AppView: View {
}

#Preview {
AppView(store: .init(initialState: .init(), reducer: {
AppReducer()
}))
AppView(
store: .init(
initialState: .init(),
reducer: {
AppReducer()
}))
}
2 changes: 1 addition & 1 deletion MyLibrary/Sources/Safari/Safari.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ComposableArchitecture
import SwiftUI
import SafariServices
import SwiftUI

@Reducer
public struct Safari {
Expand Down
75 changes: 40 additions & 35 deletions MyLibrary/Sources/ScheduleFeature/Detail.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ public struct ScheduleDetail {
var speakers: [Speaker]
@Presents var destination: Destination.State?

public init(title: String, description: String, requirements: String? = nil, speakers: [Speaker]) {
public init(
title: String, description: String, requirements: String? = nil, speakers: [Speaker]
) {
self.title = title
self.description = description
self.requirements = requirements
Expand Down Expand Up @@ -44,13 +46,13 @@ public struct ScheduleDetail {
BindingReducer()
Reduce { state, action in
switch action {
case let .view(.snsTapped(url)):
state.destination = .safari(.init(url: url))
return .none
case .destination:
return .none
case .binding:
return .none
case let .view(.snsTapped(url)):
state.destination = .safari(.init(url: url))
return .none
case .destination:
return .none
case .binding:
return .none
}
}
.ifLet(\.$destination, action: \.destination)
Expand Down Expand Up @@ -93,14 +95,15 @@ public struct ScheduleDetailView: View {
}
.padding(.horizontal)
.padding(.bottom)
.frame(maxWidth: 700) // Readable content width for iPad
.frame(maxWidth: 700) // Readable content width for iPad
speakers
.frame(maxWidth: 700) // Readable content width for iPad
.frame(maxWidth: 700) // Readable content width for iPad
}
Spacer()
}
}
.sheet(item: $store.scope(state: \.destination?.safari, action: \.destination.safari)) { sheetStore in
.sheet(item: $store.scope(state: \.destination?.safari, action: \.destination.safari)) {
sheetStore in
SafariViewRepresentation(url: sheetStore.url)
.ignoresSafeArea()
}
Expand Down Expand Up @@ -151,29 +154,31 @@ public struct ScheduleDetailView: View {
}

#Preview {
ScheduleDetailView(store: .init(
initialState: .init(
title: "What's new in try! Swift",
description: #"""
try! Swift is an international community gathering that focuses on the Swift programming language and its ecosystem. It brings together developers, industry experts, and enthusiasts for a series of talks, learning sessions, and networking opportunities. The event aims to foster collaboration, share the latest advancements and best practices, and inspire innovation within the Swift community.The revival of "try! Swift" signifies a renewed commitment to these goals, potentially after a period of hiatus or reduced activity, possibly due to global challenges like the COVID-19 pandemic. This resurgence would likely involve the organization of new events, either virtually or in-person, reflecting the latest trends and technologies within the Swift ecosystem. The revival indicates a strong, ongoing interest in Swift programming, with the community eager to reconvene, exchange ideas, and continue learning from each other.
"""#,
speakers: [
Speaker(
name: "Natasha Murashev",
imageName: "natasha",
bio: "Natasha is an iOS developer by day and a robot by night. She organizes the try! Swift Conference around the world (including this one!). She's currently living the digital nomad life as her alter identity: @natashatherobot",
links: [
.init(
name: "@natashatherobot",
url: URL(string: "https://x.com/natashatherobot")!
)
]
)
]
),
reducer: {
ScheduleDetail()
}
)
ScheduleDetailView(
store: .init(
initialState: .init(
title: "What's new in try! Swift",
description: #"""
try! Swift is an international community gathering that focuses on the Swift programming language and its ecosystem. It brings together developers, industry experts, and enthusiasts for a series of talks, learning sessions, and networking opportunities. The event aims to foster collaboration, share the latest advancements and best practices, and inspire innovation within the Swift community.The revival of "try! Swift" signifies a renewed commitment to these goals, potentially after a period of hiatus or reduced activity, possibly due to global challenges like the COVID-19 pandemic. This resurgence would likely involve the organization of new events, either virtually or in-person, reflecting the latest trends and technologies within the Swift ecosystem. The revival indicates a strong, ongoing interest in Swift programming, with the community eager to reconvene, exchange ideas, and continue learning from each other.
"""#,
speakers: [
Speaker(
name: "Natasha Murashev",
imageName: "natasha",
bio:
"Natasha is an iOS developer by day and a robot by night. She organizes the try! Swift Conference around the world (including this one!). She's currently living the digital nomad life as her alter identity: @natashatherobot",
links: [
.init(
name: "@natashatherobot",
url: URL(string: "https://x.com/natashatherobot")!
)
]
)
]
),
reducer: {
ScheduleDetail()
}
)
)
}
95 changes: 52 additions & 43 deletions MyLibrary/Sources/ScheduleFeature/Schedule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import ComposableArchitecture
import DataClient
import Foundation
import Safari
import SwiftUI
import SharedModels
import SwiftUI
import TipKit

@Reducer
Expand Down Expand Up @@ -65,29 +65,32 @@ public struct Schedule {
BindingReducer()
Reduce { state, action in
switch action {
case .view(.onAppear):
state.day1 = try! dataClient.fetchDay1()
state.day2 = try! dataClient.fetchDay2()
state.workshop = try! dataClient.fetchWorkshop()
case .view(.onAppear):
state.day1 = try! dataClient.fetchDay1()
state.day2 = try! dataClient.fetchDay2()
state.workshop = try! dataClient.fetchWorkshop()
return .none
case let .view(.disclosureTapped(session)):
guard let description = session.description, let speakers = session.speakers else {
return .none
case let .view(.disclosureTapped(session)):
guard let description = session.description, let speakers = session.speakers else { return .none }
state.path.append(.detail(
}
state.path.append(
.detail(
.init(
title: session.title,
description: description,
requirements: session.requirements,
speakers: speakers
)
)
)
return .none
case .view(.mapItemTapped):
let url = URL(string: String(localized: "Guidance URL", bundle: .module))!
state.destination = .guidance(.init(url: url))
return .none
case .binding, .path, .destination:
return .none
)
return .none
case .view(.mapItemTapped):
let url = URL(string: String(localized: "Guidance URL", bundle: .module))!
state.destination = .guidance(.init(url: url))
return .none
case .binding, .path, .destination:
return .none
}
}
.forEach(\.path, action: \.path)
Expand All @@ -110,13 +113,14 @@ public struct ScheduleView: View {
root
} destination: { store in
switch store.state {
case .detail:
if let store = store.scope(state: \.detail, action: \.detail) {
ScheduleDetailView(store: store)
}
case .detail:
if let store = store.scope(state: \.detail, action: \.detail) {
ScheduleDetailView(store: store)
}
}
}
.sheet(item: $store.scope(state: \.destination?.guidance, action: \.destination.guidance)) { sheetStore in
.sheet(item: $store.scope(state: \.destination?.guidance, action: \.destination.guidance)) {
sheetStore in
SafariViewRepresentation(url: sheetStore.url)
.ignoresSafeArea()
}
Expand All @@ -133,24 +137,24 @@ public struct ScheduleView: View {
.pickerStyle(.segmented)
.padding(.horizontal)
switch store.selectedDay {
case .day1:
if let day1 = store.day1 {
conferenceList(conference: day1)
} else {
Text("")
}
case .day2:
if let day2 = store.day2 {
conferenceList(conference: day2)
} else {
Text("")
}
case .day3:
if let workshop = store.workshop {
conferenceList(conference: workshop)
} else {
Text("")
}
case .day1:
if let day1 = store.day1 {
conferenceList(conference: day1)
} else {
Text("")
}
case .day2:
if let day2 = store.day2 {
conferenceList(conference: day2)
} else {
Text("")
}
case .day3:
if let workshop = store.workshop {
conferenceList(conference: workshop)
} else {
Text("")
}
}
}
.toolbar {
Expand Down Expand Up @@ -283,12 +287,17 @@ public struct ScheduleView: View {

struct MapTip: Tip, Equatable {
var title: Text = Text("Go Shibuya First, NOT Garden", bundle: .module)
var message: Text? = Text("There are two kinds of Bellesalle in Shibuya. Learn how to get from Shibuya Station to \"Bellesalle Shibuya FIRST\". ", bundle: .module)
var message: Text? = Text(
"There are two kinds of Bellesalle in Shibuya. Learn how to get from Shibuya Station to \"Bellesalle Shibuya FIRST\". ",
bundle: .module)
var image: Image? = .init(systemName: "map.circle.fill")
}

#Preview {
ScheduleView(store: .init(initialState: .init(), reducer: {
Schedule()
}))
ScheduleView(
store: .init(
initialState: .init(),
reducer: {
Schedule()
}))
}
3 changes: 1 addition & 2 deletions MyLibrary/Sources/SharedModels/Organizer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public struct Organizer: Codable, Equatable, Hashable, Sendable, Identifiable {
public var bio: String
public var links: [Link]?

public struct Link: Codable,Equatable, Hashable, Sendable {
public struct Link: Codable, Equatable, Hashable, Sendable {
public var name: String
public var url: URL

Expand All @@ -25,4 +25,3 @@ public struct Organizer: Codable, Equatable, Hashable, Sendable, Identifiable {
self.links = links
}
}

4 changes: 2 additions & 2 deletions MyLibrary/Sources/SharedModels/Speaker.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import Foundation

public struct Speaker: Codable,Equatable, Hashable, Sendable {
public struct Speaker: Codable, Equatable, Hashable, Sendable {
public var name: String
public var imageName: String
public var bio: String?
public var links: [Link]?

public struct Link: Codable,Equatable, Hashable, Sendable {
public struct Link: Codable, Equatable, Hashable, Sendable {
public var name: String
public var url: URL

Expand Down
Loading

0 comments on commit 64b3a80

Please sign in to comment.