Skip to content

Commit 25cf2a4

Browse files
committed
fixed example code
1 parent 0cd4936 commit 25cf2a4

File tree

3 files changed

+13
-19
lines changed

3 files changed

+13
-19
lines changed

DIContainerExample/DIContainerExample.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,8 +659,8 @@
659659
isa = XCRemoteSwiftPackageReference;
660660
repositoryURL = "https://github.com/minsOne/DIContainer";
661661
requirement = {
662-
kind = upToNextMajorVersion;
663-
minimumVersion = 1.3.3;
662+
branch = main;
663+
kind = branch;
664664
};
665665
};
666666
/* End XCRemoteSwiftPackageReference section */

DIContainerExample/DIContainerExample/AppDelegate.swift

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,17 @@ import UIKit
1010

1111
@main
1212
class AppDelegate: UIResponder, UIApplicationDelegate {
13-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
13+
func application(
14+
_ application: UIApplication,
15+
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool
16+
{
1417
// Override point for customization after application launch.
1518

16-
RegisterContainer().setup()
19+
// RegisterContainer().setup()
1720

18-
return true
19-
}
20-
21-
// MARK: UISceneSession Lifecycle
21+
// If DemoApp is running, use Module Scanner
22+
Container.autoRegisterModules()
2223

23-
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
24-
// Called when a new scene session is being created.
25-
// Use this method to select a configuration to create the new scene with.
26-
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
27-
}
28-
29-
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
30-
// Called when the user discards a scene session.
31-
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
32-
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
24+
return true
3325
}
3426
}

DIContainerExample/DIContainerExample/RegisterContainer.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ import DIContainer
99
import Foundation
1010

1111
struct RegisterContainer {
12+
@MainActor
1213
func setup() {
1314
Container {
1415
FooModuleFactory().makeModule()
1516
BarModuleFactory().makeModule()
1617
BazModuleFactory().makeModule()
17-
}.build()
18+
}
19+
.build()
1820
}
1921
}

0 commit comments

Comments
 (0)