Skip to content

Commit ef3a11f

Browse files
committed
Loader remove UIKIt
1 parent 1ca539f commit ef3a11f

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

Package.swift

+1-5
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,7 @@ let package = Package(
4848
),
4949
.target(
5050
name: "_XUILoader",
51-
path: "Source/_XUILoader",
52-
cSettings: [
53-
.headerSearchPath("Source/_XUILoader"),
54-
.define("ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES", to: "YES")
55-
]
51+
path: "Source/_XUILoader"
5652
)
5753
],
5854
swiftLanguageVersions: [.v5]

Source/_XUILoader/Loader.m

+5-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
#import "Loader.h"
99
#import <objc/runtime.h>
10-
@import UIKit;
1110

1211
@implementation Loader
1312

@@ -26,7 +25,7 @@ + (void)load_uiviewController_viewstate {
2625
SEL sel = @selector(XUI_load_uiviewController_viewstate);
2726
#pragma clang diagnostic pop
2827

29-
Class cls = UIViewController.class;
28+
Class cls = NSClassFromString(@"UIViewController");
3029
Method method = class_getClassMethod(cls, sel);
3130
if (method != NULL) {
3231
IMP imp = method_getImplementation(method);
@@ -41,7 +40,7 @@ + (void)load_uiviewController_viewsizetransition {
4140
SEL sel = @selector(XUI_load_uiviewController_viewsizetransition);
4241
#pragma clang diagnostic pop
4342

44-
Class cls = UIViewController.class;
43+
Class cls = NSClassFromString(@"UIViewController");
4544
Method method = class_getClassMethod(cls, sel);
4645
if (method != NULL) {
4746
IMP imp = method_getImplementation(method);
@@ -57,7 +56,7 @@ + (void)load_uicontrol_selectable {
5756
SEL sel = @selector(XUI_load_uicontrol_selectable);
5857
#pragma clang diagnostic pop
5958

60-
Class cls = UIControl.class;
59+
Class cls = NSClassFromString(@"UIControl");
6160
Method method = class_getClassMethod(cls, sel);
6261
if (method != NULL) {
6362
IMP imp = method_getImplementation(method);
@@ -72,7 +71,7 @@ + (void)load_uibaritem_viewhook {
7271
SEL sel = @selector(XUI_load_uibaritem_viewhook);
7372
#pragma clang diagnostic pop
7473

75-
Class cls = UIBarItem.class;
74+
Class cls = NSClassFromString(@"UIBarItem");
7675
Method method = class_getClassMethod(cls, sel);
7776
if (method != NULL) {
7877
IMP imp = method_getImplementation(method);
@@ -87,7 +86,7 @@ + (void)load_uiview_safeareainsetspublisher {
8786
SEL sel = @selector(XUI_load_uiview_safeareainsetspublisher);
8887
#pragma clang diagnostic pop
8988

90-
Class cls = UIView.class;
89+
Class cls = NSClassFromString(@"UIView");
9190
Method method = class_getClassMethod(cls, sel);
9291
if (method != NULL) {
9392
IMP imp = method_getImplementation(method);

0 commit comments

Comments
 (0)