Skip to content

Commit a2a899f

Browse files
committed
fixed example code
1 parent 0cd4936 commit a2a899f

File tree

5 files changed

+23
-135
lines changed

5 files changed

+23
-135
lines changed

DIContainerExample/DIContainerExample.xcodeproj/project.pbxproj

Lines changed: 11 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 56;
6+
objectVersion = 60;
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
CB27EC282D5138C4004AD45F /* DIContainer in Frameworks */ = {isa = PBXBuildFile; productRef = CB27EC272D5138C4004AD45F /* DIContainer */; };
1011
CB2948202C0C4C2400F408B2 /* DIContainerExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB29481F2C0C4C2400F408B2 /* DIContainerExampleTests.swift */; };
1112
CB5D7F7A2C0C48E300AA61C0 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB5D7F792C0C48E300AA61C0 /* AppDelegate.swift */; };
1213
CB5D7F7C2C0C48E300AA61C0 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB5D7F7B2C0C48E300AA61C0 /* SceneDelegate.swift */; };
1314
CB5D7F7E2C0C48E300AA61C0 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB5D7F7D2C0C48E300AA61C0 /* ViewController.swift */; };
1415
CB5D7F812C0C48E300AA61C0 /* Base in Resources */ = {isa = PBXBuildFile; fileRef = CB5D7F802C0C48E300AA61C0 /* Base */; };
1516
CB5D7F832C0C48E400AA61C0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CB5D7F822C0C48E400AA61C0 /* Assets.xcassets */; };
1617
CB5D7F862C0C48E400AA61C0 /* Base in Resources */ = {isa = PBXBuildFile; fileRef = CB5D7F852C0C48E400AA61C0 /* Base */; };
17-
CB5D7F8F2C0C490800AA61C0 /* DIContainer in Frameworks */ = {isa = PBXBuildFile; productRef = CB5D7F8E2C0C490800AA61C0 /* DIContainer */; };
1818
CB5D7F952C0C495D00AA61C0 /* FooModuleFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB5D7F942C0C495D00AA61C0 /* FooModuleFactory.swift */; };
1919
CB5D7F9B2C0C4A3700AA61C0 /* FooService.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB5D7F9A2C0C4A3700AA61C0 /* FooService.swift */; };
2020
CB5D7F9D2C0C4A5100AA61C0 /* FooServiceImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB5D7F9C2C0C4A5100AA61C0 /* FooServiceImpl.swift */; };
@@ -58,7 +58,6 @@
5858
CB5D7FA22C0C4A7500AA61C0 /* BazService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BazService.swift; sourceTree = "<group>"; };
5959
CB5D7FA32C0C4A7500AA61C0 /* BazModuleFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BazModuleFactory.swift; sourceTree = "<group>"; };
6060
CB5D7FAA2C0C4B9B00AA61C0 /* RegisterContainer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RegisterContainer.swift; sourceTree = "<group>"; };
61-
CB5D7FB02C0C4BE700AA61C0 /* _.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = _.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
6261
/* End PBXFileReference section */
6362

6463
/* Begin PBXFrameworksBuildPhase section */
@@ -73,14 +72,7 @@
7372
isa = PBXFrameworksBuildPhase;
7473
buildActionMask = 2147483647;
7574
files = (
76-
CB5D7F8F2C0C490800AA61C0 /* DIContainer in Frameworks */,
77-
);
78-
runOnlyForDeploymentPostprocessing = 0;
79-
};
80-
CB5D7FAD2C0C4BE700AA61C0 /* Frameworks */ = {
81-
isa = PBXFrameworksBuildPhase;
82-
buildActionMask = 2147483647;
83-
files = (
75+
CB27EC282D5138C4004AD45F /* DIContainer in Frameworks */,
8476
);
8577
runOnlyForDeploymentPostprocessing = 0;
8678
};
@@ -108,7 +100,6 @@
108100
isa = PBXGroup;
109101
children = (
110102
CB5D7F762C0C48E300AA61C0 /* DIContainerExample.app */,
111-
CB5D7FB02C0C4BE700AA61C0 /* _.xctest */,
112103
CB29481D2C0C4C2400F408B2 /* DIContainerExampleTests.xctest */,
113104
);
114105
name = Products;
@@ -205,29 +196,12 @@
205196
);
206197
name = DIContainerExample;
207198
packageProductDependencies = (
208-
CB5D7F8E2C0C490800AA61C0 /* DIContainer */,
199+
CB27EC272D5138C4004AD45F /* DIContainer */,
209200
);
210201
productName = DIContainerExample;
211202
productReference = CB5D7F762C0C48E300AA61C0 /* DIContainerExample.app */;
212203
productType = "com.apple.product-type.application";
213204
};
214-
CB5D7FAF2C0C4BE700AA61C0 /* _ */ = {
215-
isa = PBXNativeTarget;
216-
buildConfigurationList = CB5D7FB62C0C4BE700AA61C0 /* Build configuration list for PBXNativeTarget "_" */;
217-
buildPhases = (
218-
CB5D7FAC2C0C4BE700AA61C0 /* Sources */,
219-
CB5D7FAD2C0C4BE700AA61C0 /* Frameworks */,
220-
CB5D7FAE2C0C4BE700AA61C0 /* Resources */,
221-
);
222-
buildRules = (
223-
);
224-
dependencies = (
225-
);
226-
name = _;
227-
productName = JSInterfacePluginContainerExampleTests;
228-
productReference = CB5D7FB02C0C4BE700AA61C0 /* _.xctest */;
229-
productType = "com.apple.product-type.bundle.unit-test";
230-
};
231205
/* End PBXNativeTarget section */
232206

233207
/* Begin PBXProject section */
@@ -245,9 +219,6 @@
245219
CB5D7F752C0C48E300AA61C0 = {
246220
CreatedOnToolsVersion = 15.3;
247221
};
248-
CB5D7FAF2C0C4BE700AA61C0 = {
249-
CreatedOnToolsVersion = 15.3;
250-
};
251222
};
252223
};
253224
buildConfigurationList = CB5D7F712C0C48E300AA61C0 /* Build configuration list for PBXProject "DIContainerExample" */;
@@ -260,15 +231,14 @@
260231
);
261232
mainGroup = CB5D7F6D2C0C48E300AA61C0;
262233
packageReferences = (
263-
CB5D7F8D2C0C490800AA61C0 /* XCRemoteSwiftPackageReference "DIContainer" */,
234+
CB27EC262D5138C4004AD45F /* XCLocalSwiftPackageReference "../../DIContainer" */,
264235
);
265236
productRefGroup = CB5D7F772C0C48E300AA61C0 /* Products */;
266237
projectDirPath = "";
267238
projectRoot = "";
268239
targets = (
269240
CB5D7F752C0C48E300AA61C0 /* DIContainerExample */,
270241
CB29481C2C0C4C2400F408B2 /* DIContainerExampleTests */,
271-
CB5D7FAF2C0C4BE700AA61C0 /* _ */,
272242
);
273243
};
274244
/* End PBXProject section */
@@ -291,13 +261,6 @@
291261
);
292262
runOnlyForDeploymentPostprocessing = 0;
293263
};
294-
CB5D7FAE2C0C4BE700AA61C0 /* Resources */ = {
295-
isa = PBXResourcesBuildPhase;
296-
buildActionMask = 2147483647;
297-
files = (
298-
);
299-
runOnlyForDeploymentPostprocessing = 0;
300-
};
301264
/* End PBXResourcesBuildPhase section */
302265

303266
/* Begin PBXSourcesBuildPhase section */
@@ -329,13 +292,6 @@
329292
);
330293
runOnlyForDeploymentPostprocessing = 0;
331294
};
332-
CB5D7FAC2C0C4BE700AA61C0 /* Sources */ = {
333-
isa = PBXSourcesBuildPhase;
334-
buildActionMask = 2147483647;
335-
files = (
336-
);
337-
runOnlyForDeploymentPostprocessing = 0;
338-
};
339295
/* End PBXSourcesBuildPhase section */
340296

341297
/* Begin PBXTargetDependency section */
@@ -579,40 +535,6 @@
579535
};
580536
name = Release;
581537
};
582-
CB5D7FB72C0C4BE700AA61C0 /* Debug */ = {
583-
isa = XCBuildConfiguration;
584-
buildSettings = {
585-
CODE_SIGN_STYLE = Automatic;
586-
CURRENT_PROJECT_VERSION = 1;
587-
DEVELOPMENT_TEAM = 6794ZU679A;
588-
GENERATE_INFOPLIST_FILE = YES;
589-
IPHONEOS_DEPLOYMENT_TARGET = 17.4;
590-
MARKETING_VERSION = 1.0;
591-
PRODUCT_BUNDLE_IDENTIFIER = kr.minsone.JSInterfacePluginContainerExampleTests;
592-
PRODUCT_NAME = "$(TARGET_NAME)";
593-
SWIFT_EMIT_LOC_STRINGS = NO;
594-
SWIFT_VERSION = 5.0;
595-
TARGETED_DEVICE_FAMILY = "1,2";
596-
};
597-
name = Debug;
598-
};
599-
CB5D7FB82C0C4BE700AA61C0 /* Release */ = {
600-
isa = XCBuildConfiguration;
601-
buildSettings = {
602-
CODE_SIGN_STYLE = Automatic;
603-
CURRENT_PROJECT_VERSION = 1;
604-
DEVELOPMENT_TEAM = 6794ZU679A;
605-
GENERATE_INFOPLIST_FILE = YES;
606-
IPHONEOS_DEPLOYMENT_TARGET = 17.4;
607-
MARKETING_VERSION = 1.0;
608-
PRODUCT_BUNDLE_IDENTIFIER = kr.minsone.JSInterfacePluginContainerExampleTests;
609-
PRODUCT_NAME = "$(TARGET_NAME)";
610-
SWIFT_EMIT_LOC_STRINGS = NO;
611-
SWIFT_VERSION = 5.0;
612-
TARGETED_DEVICE_FAMILY = "1,2";
613-
};
614-
name = Release;
615-
};
616538
/* End XCBuildConfiguration section */
617539

618540
/* Begin XCConfigurationList section */
@@ -643,32 +565,18 @@
643565
defaultConfigurationIsVisible = 0;
644566
defaultConfigurationName = Release;
645567
};
646-
CB5D7FB62C0C4BE700AA61C0 /* Build configuration list for PBXNativeTarget "_" */ = {
647-
isa = XCConfigurationList;
648-
buildConfigurations = (
649-
CB5D7FB72C0C4BE700AA61C0 /* Debug */,
650-
CB5D7FB82C0C4BE700AA61C0 /* Release */,
651-
);
652-
defaultConfigurationIsVisible = 0;
653-
defaultConfigurationName = Release;
654-
};
655568
/* End XCConfigurationList section */
656569

657-
/* Begin XCRemoteSwiftPackageReference section */
658-
CB5D7F8D2C0C490800AA61C0 /* XCRemoteSwiftPackageReference "DIContainer" */ = {
659-
isa = XCRemoteSwiftPackageReference;
660-
repositoryURL = "https://github.com/minsOne/DIContainer";
661-
requirement = {
662-
kind = upToNextMajorVersion;
663-
minimumVersion = 1.3.3;
664-
};
570+
/* Begin XCLocalSwiftPackageReference section */
571+
CB27EC262D5138C4004AD45F /* XCLocalSwiftPackageReference "../../DIContainer" */ = {
572+
isa = XCLocalSwiftPackageReference;
573+
relativePath = ../../DIContainer;
665574
};
666-
/* End XCRemoteSwiftPackageReference section */
575+
/* End XCLocalSwiftPackageReference section */
667576

668577
/* Begin XCSwiftPackageProductDependency section */
669-
CB5D7F8E2C0C490800AA61C0 /* DIContainer */ = {
578+
CB27EC272D5138C4004AD45F /* DIContainer */ = {
670579
isa = XCSwiftPackageProductDependency;
671-
package = CB5D7F8D2C0C490800AA61C0 /* XCRemoteSwiftPackageReference "DIContainer" */;
672580
productName = DIContainer;
673581
};
674582
/* End XCSwiftPackageProductDependency section */

DIContainerExample/DIContainerExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

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

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
}

DIContainerExample/DIContainerExampleTests/DIContainerExampleTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import XCTest
1111
@testable import DIContainerExample
1212

1313
final class DIContainerExampleTests: XCTestCase {
14+
@MainActor
1415
func testContainer() {
1516
let scanner = ModuleScanner()
1617
RegisterContainer().setup()

0 commit comments

Comments
 (0)