Skip to content

Commit ace5b0b

Browse files
committed
fix: refixing swift lint
- added LogManager - fix workspace in project
1 parent 27e5976 commit ace5b0b

112 files changed

Lines changed: 534 additions & 366 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.swiftformat

Lines changed: 0 additions & 31 deletions
This file was deleted.

.swiftlint.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

Example.xcworkspace/contents.xcworkspacedata

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Examples/SingleNavigator/01-SingleBasic/01-SingleBasic.xcodeproj/project.pbxproj

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
29141E112B44E13900D3ABE7 /* SingleBasicApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29141E102B44E13900D3ABE7 /* SingleBasicApp.swift */; };
1111
29141E152B44E13A00D3ABE7 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 29141E142B44E13A00D3ABE7 /* Assets.xcassets */; };
1212
29141E192B44E13A00D3ABE7 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 29141E182B44E13A00D3ABE7 /* Preview Assets.xcassets */; };
13+
292248012B6B1207006CCA00 /* Logging in Frameworks */ = {isa = PBXBuildFile; productRef = 292248002B6B1207006CCA00 /* Logging */; };
14+
292248032B6B1233006CCA00 /* LogManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 292248022B6B1233006CCA00 /* LogManager.swift */; };
1315
29704ACD2B450B5800418967 /* HomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29704ABF2B450B5800418967 /* HomeView.swift */; };
1416
29704ACE2B450B5800418967 /* HomeRouteBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29704AC02B450B5800418967 /* HomeRouteBuilder.swift */; };
1517
29704ACF2B450B5800418967 /* Page2View.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29704AC22B450B5800418967 /* Page2View.swift */; };
@@ -33,6 +35,7 @@
3335
29141E142B44E13A00D3ABE7 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
3436
29141E162B44E13A00D3ABE7 /* SingleBasic.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = SingleBasic.entitlements; sourceTree = "<group>"; };
3537
29141E182B44E13A00D3ABE7 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
38+
292248022B6B1233006CCA00 /* LogManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LogManager.swift; sourceTree = "<group>"; };
3639
29704ABF2B450B5800418967 /* HomeView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HomeView.swift; sourceTree = "<group>"; };
3740
29704AC02B450B5800418967 /* HomeRouteBuilder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HomeRouteBuilder.swift; sourceTree = "<group>"; };
3841
29704AC22B450B5800418967 /* Page2View.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Page2View.swift; sourceTree = "<group>"; };
@@ -53,6 +56,7 @@
5356
isa = PBXFrameworksBuildPhase;
5457
buildActionMask = 2147483647;
5558
files = (
59+
292248012B6B1207006CCA00 /* Logging in Frameworks */,
5660
933012962B45634400893C91 /* LinkNavigator in Frameworks */,
5761
933012992B45634F00893C91 /* PageTemplate in Frameworks */,
5862
);
@@ -85,6 +89,7 @@
8589
29141E102B44E13900D3ABE7 /* SingleBasicApp.swift */,
8690
9328462A2B450372000243AC /* AppDependency.swift */,
8791
9328462C2B45037F000243AC /* AppRouterGroup.swift */,
92+
292248022B6B1233006CCA00 /* LogManager.swift */,
8893
29141E142B44E13A00D3ABE7 /* Assets.xcassets */,
8994
29141E162B44E13A00D3ABE7 /* SingleBasic.entitlements */,
9095
29141E172B44E13A00D3ABE7 /* Preview Content */,
@@ -184,6 +189,7 @@
184189
packageProductDependencies = (
185190
933012952B45634400893C91 /* LinkNavigator */,
186191
933012982B45634F00893C91 /* PageTemplate */,
192+
292248002B6B1207006CCA00 /* Logging */,
187193
);
188194
productName = SingleBasic;
189195
productReference = 29141E0D2B44E13900D3ABE7 /* SingleBasic.app */;
@@ -216,6 +222,7 @@
216222
packageReferences = (
217223
933012942B45634400893C91 /* XCLocalSwiftPackageReference "../../.." */,
218224
933012972B45634F00893C91 /* XCLocalSwiftPackageReference "../../Shared/PageTemplate" */,
225+
292247FF2B6B1207006CCA00 /* XCRemoteSwiftPackageReference "swift-log" */,
219226
);
220227
productRefGroup = 29141E0E2B44E13900D3ABE7 /* Products */;
221228
projectDirPath = "";
@@ -253,6 +260,7 @@
253260
29704ACF2B450B5800418967 /* Page2View.swift in Sources */,
254261
9328462D2B45037F000243AC /* AppRouterGroup.swift in Sources */,
255262
29704AD22B450B5800418967 /* Page3View.swift in Sources */,
263+
292248032B6B1233006CCA00 /* LogManager.swift in Sources */,
256264
29704AD42B450B5800418967 /* Page4RouteBuilder.swift in Sources */,
257265
29141E112B44E13900D3ABE7 /* SingleBasicApp.swift in Sources */,
258266
29704AD52B450B5800418967 /* Page1RouteBuilder.swift in Sources */,
@@ -489,7 +497,23 @@
489497
};
490498
/* End XCLocalSwiftPackageReference section */
491499

500+
/* Begin XCRemoteSwiftPackageReference section */
501+
292247FF2B6B1207006CCA00 /* XCRemoteSwiftPackageReference "swift-log" */ = {
502+
isa = XCRemoteSwiftPackageReference;
503+
repositoryURL = "https://github.com/apple/swift-log";
504+
requirement = {
505+
kind = upToNextMajorVersion;
506+
minimumVersion = 1.5.4;
507+
};
508+
};
509+
/* End XCRemoteSwiftPackageReference section */
510+
492511
/* Begin XCSwiftPackageProductDependency section */
512+
292248002B6B1207006CCA00 /* Logging */ = {
513+
isa = XCSwiftPackageProductDependency;
514+
package = 292247FF2B6B1207006CCA00 /* XCRemoteSwiftPackageReference "swift-log" */;
515+
productName = Logging;
516+
};
493517
933012952B45634400893C91 /* LinkNavigator */ = {
494518
isa = XCSwiftPackageProductDependency;
495519
productName = LinkNavigator;

Examples/SingleNavigator/01-SingleBasic/SingleBasic/AppRouterGroup.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import LinkNavigator
22

3-
public typealias RootNavigatorType = LinkNavigatorProtocol & LinkNavigatorFindLocationUsable
3+
public typealias RootNavigatorType = LinkNavigatorFindLocationUsable & LinkNavigatorProtocol
4+
5+
// MARK: - AppRouterGroup
46

57
struct AppRouterGroup<RootNavigator: RootNavigatorType> {
68
init() { }
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import Foundation
2+
import Logging
3+
4+
// MARK: - LogManager
5+
6+
struct LogManager {
7+
private let log = Logger(label: "io.forxifless.linknavigator.SingleBasic")
8+
9+
static let `default` = LogManager()
10+
}
11+
12+
extension LogManager {
13+
func debug(_ message: Logger.Message) {
14+
log.info(message)
15+
}
16+
}

Examples/SingleNavigator/01-SingleBasic/SingleBasic/Page/Home/HomeRouteBuilder.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ struct HomeRouteBuilder<RootNavigator: RootNavigatorType> {
55

66
static func generate() -> RouteBuilderOf<RootNavigator> {
77
var matchPath: String { "home" }
8-
return .init(matchPath: matchPath) { navigator, items, diContainer -> RouteViewController? in
9-
return WrappingController(matchPath: matchPath) {
8+
return .init(matchPath: matchPath) { navigator, _, _ -> RouteViewController? in
9+
WrappingController(matchPath: matchPath) {
1010
HomeView(navigator: navigator)
1111
}
1212
}

Examples/SingleNavigator/01-SingleBasic/SingleBasic/Page/Home/HomeView.swift

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
import SwiftUI
21
import LinkNavigator
2+
import SwiftUI
33

44
struct HomeView: View {
55

6+
// MARK: Internal
7+
68
let navigator: RootNavigatorType
7-
@State private var paths: [String] = []
89

910
var body: some View {
1011
VStack(spacing: 30) {
1112
PathIndicator(currentPath: paths.joined(separator: " -> "))
1213
.padding(.top, 32)
13-
14+
1415
Button(action: {
1516
navigator.backOrNext(linkItem: .init(path: "page1"), isAnimated: true)
1617
}) {
@@ -27,7 +28,7 @@ struct HomeView: View {
2728
let alertModel = Alert(
2829
title: "Title",
2930
message: "message",
30-
buttons: [.init(title: "OK", style: .default, action: { print("OK tapped") })],
31+
buttons: [.init(title: "OK", style: .default, action: { LogManager.default.debug("OK Tapped") })],
3132
flagType: .default)
3233
navigator.alert(target: .default, model: alertModel)
3334
}) {
@@ -56,4 +57,9 @@ struct HomeView: View {
5657
paths = navigator.getCurrentPaths()
5758
}
5859
}
60+
61+
// MARK: Private
62+
63+
@State private var paths: [String] = []
64+
5965
}

Examples/SingleNavigator/01-SingleBasic/SingleBasic/Page/Page1/Page1RouteBuilder.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ struct Page1RouteBuilder<RootNavigator: RootNavigatorType> {
55

66
static func generate() -> RouteBuilderOf<RootNavigator> {
77
var matchPath: String { "page1" }
8-
return .init(matchPath: matchPath) { navigator, items, diContainer -> RouteViewController? in
9-
return WrappingController(matchPath: matchPath) {
8+
return .init(matchPath: matchPath) { navigator, _, _ -> RouteViewController? in
9+
WrappingController(matchPath: matchPath) {
1010
Page1View(navigator: navigator)
1111
}
1212
}

0 commit comments

Comments
 (0)