Skip to content

Commit 71531a5

Browse files
committed
renamed swift InstanceHelper to InstanceCreator
1 parent ec21a1e commit 71531a5

File tree

6 files changed

+27
-17
lines changed

6 files changed

+27
-17
lines changed

InstanceHelper.xcodeproj/project.pbxproj

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
A73FEEB827EC7B6500B56ED8 /* InstanceHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = A73FEEB727EC7B6500B56ED8 /* InstanceHelper.h */; settings = {ATTRIBUTES = (Public, ); }; };
1111
A73FEEC127EC7BAB00B56ED8 /* OBInstanceHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = A73FEEBF27EC7BAB00B56ED8 /* OBInstanceHelper.h */; settings = {ATTRIBUTES = (Public, ); }; };
1212
A73FEEC227EC7BAB00B56ED8 /* OBInstanceHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = A73FEEC027EC7BAB00B56ED8 /* OBInstanceHelper.m */; };
13-
A73FEEC427EC7BBF00B56ED8 /* InstanceHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = A73FEEC327EC7BBF00B56ED8 /* InstanceHelper.swift */; };
14-
A73FEECD27EC7C4D00B56ED8 /* InstanceHelperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A73FEECC27EC7C4D00B56ED8 /* InstanceHelperTests.swift */; };
13+
A73FEEC427EC7BBF00B56ED8 /* InstanceCreator.swift in Sources */ = {isa = PBXBuildFile; fileRef = A73FEEC327EC7BBF00B56ED8 /* InstanceCreator.swift */; };
14+
A73FEECD27EC7C4D00B56ED8 /* InstanceCreatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A73FEECC27EC7C4D00B56ED8 /* InstanceCreatorTests.swift */; };
1515
A73FEECE27EC7C4D00B56ED8 /* InstanceHelper.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A73FEEB427EC7B6500B56ED8 /* InstanceHelper.framework */; };
1616
A73FEED527EC7D0B00B56ED8 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A73FEED427EC7D0B00B56ED8 /* SceneDelegate.swift */; };
1717
/* End PBXBuildFile section */
@@ -31,9 +31,9 @@
3131
A73FEEB727EC7B6500B56ED8 /* InstanceHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InstanceHelper.h; sourceTree = "<group>"; };
3232
A73FEEBF27EC7BAB00B56ED8 /* OBInstanceHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OBInstanceHelper.h; sourceTree = "<group>"; };
3333
A73FEEC027EC7BAB00B56ED8 /* OBInstanceHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OBInstanceHelper.m; sourceTree = "<group>"; };
34-
A73FEEC327EC7BBF00B56ED8 /* InstanceHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InstanceHelper.swift; sourceTree = "<group>"; };
34+
A73FEEC327EC7BBF00B56ED8 /* InstanceCreator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InstanceCreator.swift; sourceTree = "<group>"; };
3535
A73FEECA27EC7C4D00B56ED8 /* InstanceHelperTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = InstanceHelperTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
36-
A73FEECC27EC7C4D00B56ED8 /* InstanceHelperTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InstanceHelperTests.swift; sourceTree = "<group>"; };
36+
A73FEECC27EC7C4D00B56ED8 /* InstanceCreatorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InstanceCreatorTests.swift; sourceTree = "<group>"; };
3737
A73FEED427EC7D0B00B56ED8 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
3838
/* End PBXFileReference section */
3939

@@ -94,7 +94,7 @@
9494
A73FEECB27EC7C4D00B56ED8 /* Test */ = {
9595
isa = PBXGroup;
9696
children = (
97-
A73FEECC27EC7C4D00B56ED8 /* InstanceHelperTests.swift */,
97+
A73FEECC27EC7C4D00B56ED8 /* InstanceCreatorTests.swift */,
9898
A73FEED427EC7D0B00B56ED8 /* SceneDelegate.swift */,
9999
);
100100
path = Test;
@@ -113,7 +113,7 @@
113113
A73FEEF527EC8D3500B56ED8 /* Swift */ = {
114114
isa = PBXGroup;
115115
children = (
116-
A73FEEC327EC7BBF00B56ED8 /* InstanceHelper.swift */,
116+
A73FEEC327EC7BBF00B56ED8 /* InstanceCreator.swift */,
117117
);
118118
path = Swift;
119119
sourceTree = "<group>";
@@ -177,7 +177,7 @@
177177
attributes = {
178178
BuildIndependentTargetsInParallel = 1;
179179
LastSwiftUpdateCheck = 1320;
180-
LastUpgradeCheck = 1320;
180+
LastUpgradeCheck = 1630;
181181
TargetAttributes = {
182182
A73FEEB327EC7B6500B56ED8 = {
183183
CreatedOnToolsVersion = 13.2.1;
@@ -229,7 +229,7 @@
229229
isa = PBXSourcesBuildPhase;
230230
buildActionMask = 2147483647;
231231
files = (
232-
A73FEEC427EC7BBF00B56ED8 /* InstanceHelper.swift in Sources */,
232+
A73FEEC427EC7BBF00B56ED8 /* InstanceCreator.swift in Sources */,
233233
A73FEEC227EC7BAB00B56ED8 /* OBInstanceHelper.m in Sources */,
234234
);
235235
runOnlyForDeploymentPostprocessing = 0;
@@ -238,7 +238,7 @@
238238
isa = PBXSourcesBuildPhase;
239239
buildActionMask = 2147483647;
240240
files = (
241-
A73FEECD27EC7C4D00B56ED8 /* InstanceHelperTests.swift in Sources */,
241+
A73FEECD27EC7C4D00B56ED8 /* InstanceCreatorTests.swift in Sources */,
242242
A73FEED527EC7D0B00B56ED8 /* SceneDelegate.swift in Sources */,
243243
);
244244
runOnlyForDeploymentPostprocessing = 0;
@@ -292,6 +292,7 @@
292292
DEBUG_INFORMATION_FORMAT = dwarf;
293293
ENABLE_STRICT_OBJC_MSGSEND = YES;
294294
ENABLE_TESTABILITY = YES;
295+
ENABLE_USER_SCRIPT_SANDBOXING = YES;
295296
GCC_C_LANGUAGE_STANDARD = gnu11;
296297
GCC_DYNAMIC_NO_PIC = NO;
297298
GCC_NO_COMMON_BLOCKS = YES;
@@ -356,6 +357,7 @@
356357
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
357358
ENABLE_NS_ASSERTIONS = NO;
358359
ENABLE_STRICT_OBJC_MSGSEND = YES;
360+
ENABLE_USER_SCRIPT_SANDBOXING = YES;
359361
GCC_C_LANGUAGE_STANDARD = gnu11;
360362
GCC_NO_COMMON_BLOCKS = YES;
361363
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
@@ -381,12 +383,14 @@
381383
buildSettings = {
382384
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
383385
CLANG_ENABLE_MODULES = YES;
386+
CODE_SIGN_IDENTITY = "";
384387
CODE_SIGN_STYLE = Automatic;
385388
CURRENT_PROJECT_VERSION = 1;
386389
DEFINES_MODULE = YES;
387390
DYLIB_COMPATIBILITY_VERSION = 1;
388391
DYLIB_CURRENT_VERSION = 1;
389392
DYLIB_INSTALL_NAME_BASE = "@rpath";
393+
ENABLE_MODULE_VERIFIER = YES;
390394
GENERATE_INFOPLIST_FILE = YES;
391395
INFOPLIST_KEY_NSHumanReadableCopyright = "";
392396
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
@@ -396,6 +400,7 @@
396400
"@loader_path/Frameworks",
397401
);
398402
MARKETING_VERSION = 1.0;
403+
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++17";
399404
PRODUCT_BUNDLE_IDENTIFIER = org.openbakery.InstanceHelper;
400405
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
401406
SKIP_INSTALL = YES;
@@ -411,12 +416,14 @@
411416
buildSettings = {
412417
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
413418
CLANG_ENABLE_MODULES = YES;
419+
CODE_SIGN_IDENTITY = "";
414420
CODE_SIGN_STYLE = Automatic;
415421
CURRENT_PROJECT_VERSION = 1;
416422
DEFINES_MODULE = YES;
417423
DYLIB_COMPATIBILITY_VERSION = 1;
418424
DYLIB_CURRENT_VERSION = 1;
419425
DYLIB_INSTALL_NAME_BASE = "@rpath";
426+
ENABLE_MODULE_VERIFIER = YES;
420427
GENERATE_INFOPLIST_FILE = YES;
421428
INFOPLIST_KEY_NSHumanReadableCopyright = "";
422429
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
@@ -426,6 +433,7 @@
426433
"@loader_path/Frameworks",
427434
);
428435
MARKETING_VERSION = 1.0;
436+
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++17";
429437
PRODUCT_BUNDLE_IDENTIFIER = org.openbakery.InstanceHelper;
430438
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
431439
SKIP_INSTALL = YES;

InstanceHelper.xcodeproj/xcshareddata/xcschemes/InstanceHelper.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1320"
3+
LastUpgradeVersion = "1630"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Source/Main/ObjectiveC/OBInstanceHelper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/// User this helper class to create instance of classes where the init method is unavailable
88
/// e.g. I use it for example to test the UIWindowSceneDelegate callback methods like 'func sceneDidBecomeActive(_ scene: UIScene)'
99
/// And I create the UISceneSession object for the UIScene
10-
NS_SWIFT_NAME(InstanceHelper)
10+
NS_SWIFT_NAME(InstanceCreator)
1111
@interface OBInstanceHelper : NSObject
1212

1313
+(id)createInstance:(Class)clazz;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
import Foundation
66

7-
public extension InstanceHelper {
7+
public extension InstanceCreator {
88

99
static func create<T:AnyObject>(_ clazz: T.Type, properties: [String: Any] = [:]) throws -> T {
10-
if let instance = InstanceHelper.createInstance(clazz, properties: properties) as? T {
10+
if let instance = InstanceCreator.createInstance(clazz, properties: properties) as? T {
1111
return instance
1212
}
1313
throw NSError(domain: "InstanceHelper", code: 1, userInfo: [NSLocalizedDescriptionKey:"Cannot create instance of \(clazz)"])
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
import XCTest
99
@testable import InstanceHelper
1010

11-
class InstanceHelperTests: XCTestCase {
11+
class InstanceCreatorTests: XCTestCase {
1212

1313

1414

1515
func createScene() throws -> UIWindowScene {
16-
let session = try InstanceHelper.create(UISceneSession.self)
17-
let scene = try InstanceHelper.create(UIWindowScene.self, properties: [
16+
let session = try InstanceCreator.create(UISceneSession.self)
17+
let scene = try InstanceCreator.create(UIWindowScene.self, properties: [
1818
"session": session
1919
])
2020
return scene
@@ -24,7 +24,7 @@ class InstanceHelperTests: XCTestCase {
2424
// given
2525
let sceneDelegate = SceneDelegate()
2626
let scene = try createScene()
27-
let options = try InstanceHelper.create(UIScene.ConnectionOptions.self)
27+
let options = try InstanceCreator.create(UIScene.ConnectionOptions.self)
2828
// when
2929
sceneDelegate.scene(scene, willConnectTo: scene.session, options: options)
3030
// then

Source/Test/SceneDelegate.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
import Foundation
99
import UIKit
1010

11+
12+
1113
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
1214
var window: UIWindow?
1315

0 commit comments

Comments
 (0)