Skip to content

Commit

Permalink
add objc and try use objc code
Browse files Browse the repository at this point in the history
  • Loading branch information
Willianlike committed Jun 30, 2022
1 parent 63f2abe commit b4cbb38
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
25795C72286DD0B700AB1C29 /* ModuleB.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 25795C71286DD0B700AB1C29 /* ModuleB.framework */; };
25795C73286DD0B700AB1C29 /* ModuleB.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 25795C71286DD0B700AB1C29 /* ModuleB.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
25795C75286DD0DD00AB1C29 /* ModuleA in Embed Frameworks */ = {isa = PBXBuildFile; productRef = 25795C6F286DD0B400AB1C29 /* ModuleA */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
25795C7B286DD4D000AB1C29 /* Test.m in Sources */ = {isa = PBXBuildFile; fileRef = 25795C7A286DD4D000AB1C29 /* Test.m */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
Expand Down Expand Up @@ -44,6 +45,9 @@
25795C4F286DD01900AB1C29 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
25795C51286DD01900AB1C29 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
25795C71286DD0B700AB1C29 /* ModuleB.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = ModuleB.framework; sourceTree = BUILT_PRODUCTS_DIR; };
25795C78286DD4BE00AB1C29 /* Test.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Test.h; sourceTree = "<group>"; };
25795C79286DD4D000AB1C29 /* RoadToSPMModuleNotFound-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RoadToSPMModuleNotFound-Bridging-Header.h"; sourceTree = "<group>"; };
25795C7A286DD4D000AB1C29 /* Test.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Test.m; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -82,10 +86,13 @@
25795C43286DD01600AB1C29 /* AppDelegate.swift */,
25795C45286DD01600AB1C29 /* SceneDelegate.swift */,
25795C47286DD01600AB1C29 /* ViewController.swift */,
25795C78286DD4BE00AB1C29 /* Test.h */,
25795C7A286DD4D000AB1C29 /* Test.m */,
25795C49286DD01600AB1C29 /* Main.storyboard */,
25795C4C286DD01900AB1C29 /* Assets.xcassets */,
25795C4E286DD01900AB1C29 /* LaunchScreen.storyboard */,
25795C51286DD01900AB1C29 /* Info.plist */,
25795C79286DD4D000AB1C29 /* RoadToSPMModuleNotFound-Bridging-Header.h */,
);
path = RoadToSPMModuleNotFound;
sourceTree = "<group>";
Expand Down Expand Up @@ -134,6 +141,7 @@
TargetAttributes = {
25795C3F286DD01600AB1C29 = {
CreatedOnToolsVersion = 13.2.1;
LastSwiftMigration = 1320;
};
};
};
Expand Down Expand Up @@ -174,6 +182,7 @@
buildActionMask = 2147483647;
files = (
25795C48286DD01600AB1C29 /* ViewController.swift in Sources */,
25795C7B286DD4D000AB1C29 /* Test.m in Sources */,
25795C44286DD01600AB1C29 /* AppDelegate.swift in Sources */,
25795C46286DD01600AB1C29 /* SceneDelegate.swift in Sources */,
);
Expand Down Expand Up @@ -322,6 +331,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -339,6 +349,8 @@
PRODUCT_BUNDLE_IDENTIFIER = ru.roadToSPM.RoadToSPMModuleNotFound;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OBJC_BRIDGING_HEADER = "RoadToSPMModuleNotFound/RoadToSPMModuleNotFound-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
Expand All @@ -349,6 +361,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -366,6 +379,7 @@
PRODUCT_BUNDLE_IDENTIFIER = ru.roadToSPM.RoadToSPMModuleNotFound;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OBJC_BRIDGING_HEADER = "RoadToSPMModuleNotFound/RoadToSPMModuleNotFound-Bridging-Header.h";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//

#import "Test.h"
16 changes: 16 additions & 0 deletions RoadToSPMModuleNotFound/RoadToSPMModuleNotFound/Test.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// Test.h
// RoadToSPMModuleNotFound
//
// Created by Вильян Яумбаев on 30.06.2022.
//

#import <Foundation/Foundation.h>

@class SwiftClassB;

@interface ObjcClass : NSObject

@property SwiftClassB *swiftclass;

@end
18 changes: 18 additions & 0 deletions RoadToSPMModuleNotFound/RoadToSPMModuleNotFound/Test.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// Test.m
// RoadToSPMModuleNotFound
//
// Created by Вильян Яумбаев on 30.06.2022.
//

#import <Foundation/Foundation.h>
#import "Test.h"
#import <ModuleB/ModuleB-Swift.h>

@implementation ObjcClass

-(void) doStuff {
self.swiftclass.prop = 4;
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ class ViewController: UIViewController {
override func viewDidLoad() {
let test = SwiftClassB()
test.prop = 4

let objc = ObjcClass()
objc.swiftclass.prop = 4
}


Expand Down

0 comments on commit b4cbb38

Please sign in to comment.