Skip to content

Commit

Permalink
Format and small refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
aromanov91 committed Dec 25, 2024
1 parent b2648c4 commit 93e668e
Show file tree
Hide file tree
Showing 68 changed files with 3,089 additions and 2,843 deletions.
5 changes: 3 additions & 2 deletions .swiftformat
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
--swiftversion 5.8
--disable preferKeyPath
--swiftversion 6.0
--disable preferKeyPath
--ifdef no-indent
12 changes: 6 additions & 6 deletions AppExample/Example/Router/Alerts.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,30 @@ enum RootAlert: Identifiable {
var id: String {
switch self {
case .dismiss:
return "dismiss"
"dismiss"
case .delete:
return "delete"
"delete"
case .appError:
return "appError"
"appError"
}
}

var alert: Alert {
switch self {
case let .dismiss(action):
return Alert(
Alert(
title: Text("Are you sure you want to dismiss?"),
primaryButton: .destructive(Text("Dismiss"), action: action),
secondaryButton: .cancel()
)
case let .delete(action):
return Alert(
Alert(
title: Text("Are you sure you want to delete?"),
primaryButton: .destructive(Text("\(L10n.Button.delete)"), action: action),
secondaryButton: .cancel()
)
case let .appError(error: error):
return Alert(
Alert(
title: Text(error.title),
message: Text(error.subtitle.valueOrEmpty),
dismissButton: .cancel()
Expand Down
4 changes: 2 additions & 2 deletions AppExample/Example/Router/Router.swift
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ extension Router {
extension Screen: Hashable, Equatable {
static func == (lhs: Screen, rhs: Screen) -> Bool {
if lhs.id == rhs.id {
return true
true
} else {
return false
false
}
}

Expand Down
4 changes: 2 additions & 2 deletions AppExample/Example/Router/Screens.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ extension Screen: Identifiable {
var id: String {
switch self {
case .settings:
return "settings"
"settings"
case .premium:
return "premium"
"premium"
}
}
}
Expand Down
30 changes: 15 additions & 15 deletions AppExample/Example/Router/Tabs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,45 +15,45 @@ public enum RootTab: String {
var id: String {
switch self {
case .main:
return "home"
"home"
case .secondary:
return "secondary"
"secondary"
case .tertiary:
return "tertiary"
"tertiary"
case .quaternary:
return "quaternary"
"quaternary"
case .settings:
return "settings"
"settings"
}
}

var title: String {
switch self {
case .main:
return "Home"
"Home"
case .secondary:
return "Secondary"
"Secondary"
case .tertiary:
return "Tertiary"
"Tertiary"
case .quaternary:
return "Quaternary"
"Quaternary"
case .settings:
return "Settings"
"Settings"
}
}

var image: Image {
switch self {
case .main:
return Image(systemName: "")
Image(systemName: "")
case .secondary:
return Image(systemName: "")
Image(systemName: "")
case .tertiary:
return Image(systemName: "")
Image(systemName: "")
case .quaternary:
return Image(systemName: "")
Image(systemName: "")
case .settings:
return Image(systemName: "")
Image(systemName: "")
}
}
}
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ let developmentDependencies: [PackageDescription.Package.Dependency] = [
.package(url: "https://github.com/hmlongco/Factory.git", .upToNextMajor(from: "2.1.3")),
]

var dependencies: [PackageDescription.Package.Dependency] = remoteDependencies
var dependencies: [PackageDescription.Package.Dependency] = developmentDependencies

if ProcessInfo.processInfo.environment["BUILD_MODE"] == "DEV" {
dependencies = developmentDependencies
Expand Down
Loading

0 comments on commit 93e668e

Please sign in to comment.