Skip to content

Commit c23fc5e

Browse files
committed
removed unnecessary code
1 parent 351b88d commit c23fc5e

40 files changed

+161
-809
lines changed

.DS_Store

0 Bytes
Binary file not shown.

MixLibraryOne/MixLibOne.xcconfig

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// Product module name should be same inside modulemap file to map the respective headers
1414
PRODUCT_MODULE_NAME = MixLibraryOne
1515

16-
// allow modularisation to that static library
16+
// generates Module as an output of that static library
1717
DEFINES_MODULE = YES
1818

1919
// refer the modulemap file from this place
@@ -34,3 +34,8 @@ SWIFT_OBJC_INTERFACE_HEADER_NAME = MixLibOne-Swift.h
3434
// One important error handling: <unknown>:0: error: underlying Objective-C module 'MixLibraryOne' not found
3535
// project level configuration overrides the target level configuration and you will get the above error. Delete the project level configuration and it will work fine. See, it will be shown in bold in build settings, delete those bold configuration ( here MODULEMAP_FILE & USER_HEADER_SEARCH_PATHS specifically)
3636
OTHER_SWIFT_FLAGS = $(inherited) -import-underlying-module
37+
38+
39+
// Getting an error:
40+
// Command CompileSwiftSources failed with a nonzero exit code
41+
SWIFT_ENABLE_BATCH_MODE = NO

MixLibraryOne/MixLibOneObjcFileA.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
NS_ASSUME_NONNULL_BEGIN
1212

13+
/// MixLibOneObjcFileA
14+
/// This objective c file belongs of Mix Language Libary.
1315
@interface MixLibOneObjcFileA : NSObject
1416
-(void) test;
1517
@end

MixLibraryOne/MixLibOneObjcFileB.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//
2+
// MixLibOneObjcFileB.h
3+
// MixLibraryOne
4+
//
5+
// Created by Ashis Laha on 11/01/20.
6+
// Copyright © 2020 Ashis Laha. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
11+
NS_ASSUME_NONNULL_BEGIN
12+
13+
@interface MixLibOneObjcFileB : NSObject
14+
15+
-(void) testMethod;
16+
17+
@end
18+
19+
NS_ASSUME_NONNULL_END

MixLibraryOne/MixLibOneObjcFileB.m

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
//
2+
// MixLibOneObjcFileB.m
3+
// MixLibraryOne
4+
//
5+
// Created by Ashis Laha on 11/01/20.
6+
// Copyright © 2020 Ashis Laha. All rights reserved.
7+
//
8+
9+
#import "MixLibOneObjcFileB.h"
10+
11+
/*
12+
import the MixLibOneObjcFileA through header file inclusion
13+
*/
14+
#import "MixLibOneObjcFileA.h"
15+
16+
/*
17+
import SWIFT_OBJC_INTERFACE_HEADER_NAME to include swift functionlity
18+
*/
19+
#import "MixLibOne-Swift.h"
20+
21+
@implementation MixLibOneObjcFileB
22+
23+
-(void) testMethod {
24+
MixLibOneObjcFileA *obj = [[MixLibOneObjcFileA alloc] init];
25+
[obj test];
26+
27+
MixLibOneSwiftOne *swiftObj = [[MixLibOneSwiftOne alloc] init];
28+
[swiftObj test];
29+
}
30+
31+
@end

MixLibraryOne/MixLibOneSwiftOne.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ import Foundation
1414
*/
1515
// import MixLibraryOne
1616

17+
/// MixLibOneSwiftOne
18+
/// It just contains a test() function which actually accessing Objective C file belonging to same library.
19+
1720
@objc open class MixLibOneSwiftOne: NSObject {
1821

1922
@objc open func test() {
@@ -22,5 +25,8 @@ import Foundation
2225

2326
let fileA = MixLibOneObjcFileA()
2427
fileA.test()
28+
29+
let fileB = MixLibOneObjcFileB()
30+
fileB.testMethod()
2531
}
2632
}

MixLibraryOne/MixLibraryOne.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//
2+
// MixLibraryOne.h
3+
// MixLibraryOne
4+
//
5+
// Created by Ashis Laha on 20/01/20.
6+
// Copyright © 2020 Ashis Laha. All rights reserved.
7+
//
8+
9+
10+
/*
11+
This is an umbrella header which includes all the other public headers in the static libraries.
12+
*/
13+
14+
#import "MixLibOneObjcFileA.h"
15+
#import "MixLibOneObjcFileB.h"
16+
17+

MixLibraryThree/MixLibThree.xcconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ PRODUCT_MODULE_NAME = MixLibThree
1818
// we can skip "copy files" step in "build phases" by providing the proper location of dependent (if both target belongs to same project) of user header search path
1919
USER_HEADER_SEARCH_PATHS = $(inherited) $(SRCROOT)/Modules $(SRCROOT)/include
2020

21-
// allow modularisation to that static library
21+
// generates module as an output of that static library
2222
DEFINES_MODULE = YES
2323

2424
// refer the modulemap file from Mix LibraryOne - // TODO: we can separate this out from MixLibraryOne

MixLibraryThree/MixLibraryThree.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ @implementation MixLibraryThree
1717
-(void) testMixLibThree {
1818
MixLibOneObjcFileA *obj = [[MixLibOneObjcFileA alloc] init];
1919
[obj test];
20+
21+
MixLibOneObjcFileB *bObjct = [[MixLibOneObjcFileB alloc] init];
22+
[bObjct testMethod];
2023
}
2124

2225
-(void) exposedMethod {

MixLibraryTwo/MixLibraryTwo.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import MixLibThree
2424
*/
2525
import MixLibraryOne
2626

27-
2827
class MixLibraryTwo {
2928

3029
public func test() {

MixLibraryTwo/MixLibraryTwoObjCFileA.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88

99
#import "MixLibraryTwoObjCFileA.h"
1010

11-
/*
12-
import MixLibraryOne - access objective c files through module.modulemap
13-
*/
14-
@import MixLibraryOne;
15-
1611
/*
1712
import objective c header file - access swift classes
1813
*/
1914
#import "MixLibOne-Swift.h"
2015

16+
/*
17+
import MixLibraryOne - access objective c files through module.modulemap
18+
*/
19+
@import MixLibraryOne;
20+
2121
/*
2222
access MixLibThree methods (through modulemap)
2323
*/

Modules/module.modulemap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
module ObjectiveLibraryOne {
22
umbrella header "../ObjectiveLibraryOne/ObjectiveLibraryOne.h"
3+
requires ios
34
export *
4-
5-
// Define a Model module, which include an example model object class.
6-
explicit module Model {
7-
header "../ObjectiveLibraryOne/ObjCOneFileA.h"
8-
}
95
}
106

117
module MixLibraryOne {
12-
header "../MixLibraryOne/MixLibOneObjcFileA.h"
8+
umbrella header "../MixLibraryOne/MixLibraryOne.h"
9+
//header "../MixLibraryOne/MixLibOneObjcFileA.h"
10+
//header "../MixLibraryOne/MixLibOneObjcFileB.h"
1311
requires ios
12+
export *
1413
}
1514

1615
module MixLibThree {
1716
header "../MixLibraryThree/MixLibraryThree.h"
1817
requires ios
18+
export *
1919
}

ObjCLibraryFour/ObjCLibraryFour.h

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

ObjCLibraryFour/ObjCLibraryFour.m

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

ObjCLibraryTwo/ObjCLibraryTwo.h

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

ObjCLibraryTwo/ObjCLibraryTwo.m

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

ObjectiveLibraryOne/ObjCTwoFile.m

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,4 @@ -(void) testFileB {
1818
[obj testObjective];
1919
}
2020

21-
//-(void) testDependencySwiftLibrary {
22-
// SwiftStaticLibraryTwoFileA *obj = [[SwiftStaticLibraryTwoFileA alloc] init];
23-
// [obj test];
24-
//}
25-
2621
@end

ObjectiveLibraryOne/ObjectiveCLibraryOne.xcconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
// Configuration settings file format documentation can be found at:
1010
// https://help.apple.com/xcode/#/dev745c5c974
1111

12+
PRODUCT_MODULE_NAME = ObjectiveLibraryOne
1213
DEFINE_MODULES = YES
1314
MODULEMAP_FILE = $(SRCROOT)/Modules/module.modulemap

ObjectiveLibraryOne/ObjectiveLibraryOne.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@
99
// this is umbrella header of Objective C Library
1010

1111
#import "ObjCOneFileA.h"
12+
#import "ObjCTwoFile.h"
1213

0 commit comments

Comments
 (0)