Skip to content

Commit e0d13f5

Browse files
committed
set nib according to sdk installation type
1 parent 93fcec0 commit e0d13f5

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

swift-sdk.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2644,6 +2644,7 @@
26442644
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
26452645
MTL_ENABLE_DEBUG_INFO = YES;
26462646
ONLY_ACTIVE_ARCH = YES;
2647+
"OTHER_SWIFT_FLAGS[arch=*]" = "-DCOCOAPODS -DSPM";
26472648
PRODUCT_NAME = IterableSDK;
26482649
SDKROOT = iphoneos;
26492650
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
@@ -2704,6 +2705,7 @@
27042705
GCC_WARN_UNUSED_VARIABLE = YES;
27052706
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
27062707
MTL_ENABLE_DEBUG_INFO = NO;
2708+
"OTHER_SWIFT_FLAGS[arch=*]" = "-DSPM -DCOCOAPODS";
27072709
PRODUCT_NAME = IterableSDK;
27082710
SDKROOT = iphoneos;
27092711
SWIFT_COMPILATION_MODE = wholemodule;

swift-sdk/uicomponents/IterableEmbeddedView.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,13 @@ public class IterableEmbeddedView:UIView {
135135
}
136136

137137
func loadViewFromNib() -> UIView? {
138-
let nib = UINib(nibName: "IterableEmbeddedView", bundle: Bundle.module)
138+
var nib: UINib
139+
#if COCOAPODS
140+
nib = UINib(nibName: "IterableEmbeddedView", bundle: Bundle.main)
141+
#else
142+
nib = UINib(nibName: "IterableEmbeddedView", bundle: Bundle.module)
143+
#endif
144+
139145
let view = nib.instantiate(withOwner: self, options: nil).first as? UIView
140146
view?.backgroundColor = UIColor.clear
141147
self.clipsToBounds = false

0 commit comments

Comments
 (0)