Skip to content

Commit 8622b27

Browse files
Merge pull request #32 from sendbird/release/swiftui/1.1.1
Release/swiftui/1.1.1 -> main
2 parents 37fb349 + 7085579 commit 8622b27

40 files changed

+1409
-83
lines changed

CHANGELOG.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
### New Interfaces
2-
- Added `func topView<Content: View> (@ViewBuilder content: @escaping (MessageInputViewContent.TopView.ViewConfig) -> Content) -> Self` in `GroupChannelView`
3-
- Added `QuoteMessageInputView`
1+
## Improvements
2+
- Updated the SDK build base to Xcode 16.4.
43

5-
### Improvements
6-
We have fixed warnings caused by the underlying autolayouts.
4+
## ⚠️ Compatibility Notice
5+
6+
**SendbirdSwiftUI v1.1.0 and earlier are not compatible with SendbirdChatSDK v4.28.1 or higher.**
7+
Please use `SendbirdChatSDK ≤ 4.28.0` with SendbirdSwiftUI versions **up to v1.1.0**.
8+
9+
To use `SendbirdChatSDK ≥ 4.28.1`, please upgrade to `SendbirdSwiftUI v1.1.1` or later, which is built with Xcode 16.4.

Package.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@ let package = Package(
1717
.package(
1818
name: "SendbirdChatSDK",
1919
url: "https://github.com/sendbird/sendbird-chat-sdk-ios",
20-
from: "4.26.0"
20+
from: "4.29.0"
2121
),
2222
],
2323
targets: [
2424
.binaryTarget(
2525
name: "SendbirdSwiftUI",
26-
url: "https://github.com/sendbird/sendbird-swiftui-ios/releases/download/1.1.0/SendbirdSwiftUI.xcframework.zip", // SendbirdSwiftUI_URL
27-
checksum: "9e307422893d166726484e0aace0805bb7048810e0e074eddeb1e4b86aa33a6d" // SendbirdSwiftUI_CHECKSUM
26+
url: "https://github.com/sendbird/sendbird-swiftui-ios/releases/download/1.1.1/SendbirdSwiftUI.xcframework.zip", // SendbirdSwiftUI_URL
27+
checksum: "cc2815f523db320c30092e97a48bf0575496742f5a074130d5bf4dbc7f4e4d80" // SendbirdSwiftUI_CHECKSUM
2828

2929
),
3030
.binaryTarget(
3131
name: "SendbirdUIMessageTemplate",
32-
url: "https://github.com/sendbird/sendbird-uikit-ios/releases/download/3.31.0/SendbirdUIMessageTemplate.xcframework.zip", // SendbirdUIMessageTemplate_URL
33-
checksum: "c5943e894d0d5bfc15485614a929d6e630fe3b2f830ea6efe99468d66688c41e" // SendbirdUIMessageTemplate_CHECKSUM
32+
url: "https://github.com/sendbird/sendbird-uikit-ios/releases/download/3.32.2/SendbirdUIMessageTemplate.xcframework.zip", // SendbirdUIMessageTemplate_URL
33+
checksum: "380b1948377c740febd0b324e21b181e2fc3e3717eaf08886eb3d9196c0b9602" // SendbirdUIMessageTemplate_CHECKSUM
3434
),
3535
.target(
3636
name: "SendbirdSwiftUITarget",

Sample/QuickStartSwiftUI.xcodeproj/project.pbxproj

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 54;
6+
objectVersion = 77;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -515,6 +515,7 @@
515515
772E4D392B5550DD3FDAD535 /* InviteUserViewConverter.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA23C8AD569D84167F4DD526 /* InviteUserViewConverter.swift */; };
516516
773421C3BDBEAAA97B75EA80 /* CreateGroupChannelView+SubViewBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2B719C1C7BCA50103B2FD33F /* CreateGroupChannelView+SubViewBuilder.swift */; };
517517
77804AA5E6072297F429A920 /* SBUMessageFormChipView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4295DC2364062B88F929D80E /* SBUMessageFormChipView.swift */; };
518+
7788754D0D288A31CBD190D8 /* SBUUnreadMessageNewLine.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD328583808CC526F8235AF3 /* SBUUnreadMessageNewLine.swift */; };
518519
77AA724DB557C412388E3750 /* CustomGroupChannelRegisterOperator.ViewConverter.Header.rightView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9C266B8A2DF6EB7F1504782 /* CustomGroupChannelRegisterOperator.ViewConverter.Header.rightView.swift */; };
519520
77AA82E38B8808BC31CF1A33 /* SBUMessageThreadModule.Header+SwiftUI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F41FB77D91238CE800D9F43 /* SBUMessageThreadModule.Header+SwiftUI.swift */; };
520521
77F45EB93F523CDDECF16107 /* UIStackView.SBUIKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD34FF666C940B94555A93F5 /* UIStackView.SBUIKit.swift */; };
@@ -1067,6 +1068,7 @@
10671068
F82E518CE6E0946B168BAA18 /* UIScrollView+SBUIKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B75F4EBD4914A4295678613 /* UIScrollView+SBUIKit.swift */; };
10681069
F877982811AC508943632CCE /* SBUSelectablePhotoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A936C2B0F4BEFCCE17689484 /* SBUSelectablePhotoViewController.swift */; };
10691070
F8C970D71462EFD8D116E260 /* CustomOpenChannel.ViewConverter.Header.titleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D5AFF1C0FFAF7FB44385303 /* CustomOpenChannel.ViewConverter.Header.titleView.swift */; };
1071+
F96CCBD1D2F86EBCA1F3782A /* SBUUnreadMessageInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A4E7790BAF5E7CEC138BEF6 /* SBUUnreadMessageInfoView.swift */; };
10701072
F9C2912608CC5EAA33B09C3C /* SBUMessageDateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 744D3897AF413516BB6A02CB /* SBUMessageDateView.swift */; };
10711073
F9CF4B42BDC33490C9BB589C /* CustomTheme.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5251C5F71C7B463C54D6474C /* CustomTheme.swift */; };
10721074
F9E8A5C906219EB9DA3F6453 /* SBUGroupChannelModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = D91401F0CEDB5A733BE00C20 /* SBUGroupChannelModule.swift */; };
@@ -1242,6 +1244,7 @@
12421244
19F7CEEE95BBF13CB214CF41 /* SBUGroupChannelViewController.Deprecated.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SBUGroupChannelViewController.Deprecated.swift; sourceTree = "<group>"; };
12431245
1A01964E8998FC11F82F7F27 /* SBUGroupChannelModule.Deprecated.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SBUGroupChannelModule.Deprecated.swift; sourceTree = "<group>"; };
12441246
1A44E48D1D24AA8A93786370 /* CustomGroupOperatorList.SwiftUI.View.CustomMain.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomGroupOperatorList.SwiftUI.View.CustomMain.swift; sourceTree = "<group>"; };
1247+
1A4E7790BAF5E7CEC138BEF6 /* SBUUnreadMessageInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SBUUnreadMessageInfoView.swift; sourceTree = "<group>"; };
12451248
1A8DD774054C5168961DF04B /* GroupChannelViewConverter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GroupChannelViewConverter.swift; sourceTree = "<group>"; };
12461249
1AE76A1AE751AA26FFB13901 /* GroupChannelSettingsViewConverter.Header.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GroupChannelSettingsViewConverter.Header.swift; sourceTree = "<group>"; };
12471250
1AF8CB593FE2D4951A3ED114 /* UserNotifications.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UserNotifications.framework; path = System/Library/Frameworks/UserNotifications.framework; sourceTree = SDKROOT; };
@@ -2201,6 +2204,7 @@
22012204
FC3E876887601735308273D9 /* SBUVoiceMessageInputView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SBUVoiceMessageInputView.swift; sourceTree = "<group>"; };
22022205
FCB7E275124DF45ADB981B0E /* SBUTheme.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SBUTheme.swift; sourceTree = "<group>"; };
22032206
FD18A49461FC8A53036E3A08 /* SBUToastType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SBUToastType.swift; sourceTree = "<group>"; };
2207+
FD328583808CC526F8235AF3 /* SBUUnreadMessageNewLine.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SBUUnreadMessageNewLine.swift; sourceTree = "<group>"; };
22042208
FD34FF666C940B94555A93F5 /* UIStackView.SBUIKit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIStackView.SBUIKit.swift; sourceTree = "<group>"; };
22052209
FD8219759D395864DBC89499 /* SBURegisterOperatorModule.List.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SBURegisterOperatorModule.List.swift; sourceTree = "<group>"; };
22062210
FDA3D3D02D5E297D699CD2C2 /* SBUBaseSelectUserViewController.Deprecated.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SBUBaseSelectUserViewController.Deprecated.swift; sourceTree = "<group>"; };
@@ -4385,6 +4389,7 @@
43854389
2E9AABB7CE646ADCDF873887 /* SBUNotificationTimelineView.swift */,
43864390
6B424207542E1A82DAC82A0D /* SBUOpenChannelMessageWebView.swift */,
43874391
B07065B5EEFA8858ADAD76CA /* SBUSelectableStackView.swift */,
4392+
FD328583808CC526F8235AF3 /* SBUUnreadMessageNewLine.swift */,
43884393
608274ACB42DDAE6A5976FC6 /* SBUUserMessageTextView.swift */,
43894394
08C31448CE461810A569DE1E /* SBUUserNameView.swift */,
43904395
);
@@ -5948,6 +5953,7 @@
59485953
children = (
59495954
EF67B852DBB45B4929297E29 /* SBUNewMessageInfo.swift */,
59505955
058F7755FCA9CC99DBB5B468 /* SBUNewNotificationInfo.swift */,
5956+
1A4E7790BAF5E7CEC138BEF6 /* SBUUnreadMessageInfoView.swift */,
59515957
);
59525958
path = NewMessageInfo;
59535959
sourceTree = "<group>";
@@ -6494,7 +6500,7 @@
64946500
4F892C552F42D67B95791C9C /* XCRemoteSwiftPackageReference "sendbird-chat-sdk-ios" */,
64956501
BA2412B4C520C201A8099145 /* XCRemoteSwiftPackageReference "sendbird-uikit-ios-spm" */,
64966502
);
6497-
preferredProjectObjectVersion = 54;
6503+
preferredProjectObjectVersion = 77;
64986504
projectDirPath = "";
64996505
projectRoot = "";
65006506
targets = (
@@ -7537,6 +7543,8 @@
75377543
E1AE7A7067D6B8B6970F08DA /* SBUUnderLineTextField.swift in Sources */,
75387544
544EEA8C932F1096A5F2C3B4 /* SBUUnknownMessageCell.swift in Sources */,
75397545
AEF0C3B8FA3F9DFB7A4D7D98 /* SBUUnknownMessageCellParams.swift in Sources */,
7546+
F96CCBD1D2F86EBCA1F3782A /* SBUUnreadMessageInfoView.swift in Sources */,
7547+
7788754D0D288A31CBD190D8 /* SBUUnreadMessageNewLine.swift in Sources */,
75407548
9CEE3F03D7428180C46396FF /* SBUUser.swift in Sources */,
75417549
749F372DA7755F9B0CD00F9F /* SBUUserCell.swift in Sources */,
75427550
A813DE7327B146C9A9A5676C /* SBUUserListModule.Deprecated.swift in Sources */,
@@ -7639,7 +7647,7 @@
76397647
"@executable_path/Frameworks",
76407648
"@loader_path/Frameworks",
76417649
);
7642-
MARKETING_VERSION = 1.1.0;
7650+
MARKETING_VERSION = 1.1.1;
76437651
PRODUCT_BUNDLE_IDENTIFIER = com.sendbird.swiftui.sample;
76447652
PRODUCT_NAME = "$(TARGET_NAME)";
76457653
SDKROOT = iphoneos;
@@ -7671,7 +7679,7 @@
76717679
"@executable_path/Frameworks",
76727680
"@loader_path/Frameworks",
76737681
);
7674-
MARKETING_VERSION = 1.1.0;
7682+
MARKETING_VERSION = 1.1.1;
76757683
PRODUCT_BUNDLE_IDENTIFIER = com.sendbird.swiftui.sample.SwiftUINotificationService;
76767684
PRODUCT_NAME = "$(TARGET_NAME)";
76777685
SDKROOT = iphoneos;
@@ -7761,7 +7769,7 @@
77617769
"@executable_path/Frameworks",
77627770
"@loader_path/Frameworks",
77637771
);
7764-
MARKETING_VERSION = 1.1.0;
7772+
MARKETING_VERSION = 1.1.1;
77657773
PRODUCT_BUNDLE_IDENTIFIER = com.sendbird.swiftui.sample;
77667774
PRODUCT_NAME = "$(TARGET_NAME)";
77677775
SDKROOT = iphoneos;
@@ -7848,7 +7856,7 @@
78487856
"@executable_path/Frameworks",
78497857
"@loader_path/Frameworks",
78507858
);
7851-
MARKETING_VERSION = 1.1.0;
7859+
MARKETING_VERSION = 1.1.1;
78527860
PRODUCT_BUNDLE_IDENTIFIER = com.sendbird.swiftui.sample.SwiftUINotificationService;
78537861
PRODUCT_NAME = "$(TARGET_NAME)";
78547862
SDKROOT = iphoneos;
@@ -7897,15 +7905,15 @@
78977905
repositoryURL = "https://github.com/sendbird/sendbird-chat-sdk-ios";
78987906
requirement = {
78997907
kind = upToNextMajorVersion;
7900-
minimumVersion = 4.26.0;
7908+
minimumVersion = 4.29.0;
79017909
};
79027910
};
79037911
BA2412B4C520C201A8099145 /* XCRemoteSwiftPackageReference "sendbird-uikit-ios-spm" */ = {
79047912
isa = XCRemoteSwiftPackageReference;
79057913
repositoryURL = "https://github.com/sendbird/sendbird-uikit-ios-spm";
79067914
requirement = {
79077915
kind = upToNextMajorVersion;
7908-
minimumVersion = 3.31.0;
7916+
minimumVersion = 3.32.2;
79097917
};
79107918
};
79117919
/* End XCRemoteSwiftPackageReference section */

Sample/project.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ options:
1212
packages:
1313
SendbirdChatSDK:
1414
url: https://github.com/sendbird/sendbird-chat-sdk-ios
15-
from: 4.26.0
15+
from: 4.29.0
1616
SendbirdUIKit:
1717
url: https://github.com/sendbird/sendbird-uikit-ios-spm
18-
from: 3.31.0
18+
from: 3.32.2
1919

2020
schemes:
2121
QuickStartSwiftUI:
@@ -43,7 +43,7 @@ settingGroups:
4343
FRAMEWORK_SEARCH_PATHS: ''
4444
IPHONEOS_DEPLOYMENT_TARGET: '15.0'
4545
LD_RUNPATH_SEARCH_PATHS: ["$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks"]
46-
MARKETING_VERSION: '1.1.0'
46+
MARKETING_VERSION: '1.1.1'
4747
PRODUCT_NAME: "$(TARGET_NAME)"
4848
SDKROOT: iphoneos
4949
SWIFT_VERSION: '5.0'

Sources/uikit/Configuration/SBUConfig.CodingKeys.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ extension SBUConfig.GroupChannel.Channel {
5959
case replyType
6060
case threadReplySelectType
6161
case input
62+
case isMarkAsUnreadEnabled = "enableMarkAsUnread" // 3.32.0
6263
}
6364
}
6465

Sources/uikit/Configuration/SBUConfig.GroupChannel.swift

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ extension SBUConfig.GroupChannel {
102102
set { _isSuperGroupReactionsEnabled = newValue }
103103
}
104104

105+
/// Enable the feature to mark message as unread.
106+
///
107+
/// - Since: 3.32.0
108+
@SBUPrioritizedConfig public var isMarkAsUnreadEnabled: Bool = false
109+
105110
/// Enable the feature to mention specific members in a message for notification.
106111
///
107112
/// - NOTE: If it's `true`, it sets new ``SBUUserMentionConfiguration`` instance to ``SBUGlobals/userMentionConfig`` if needed. If it's `false`, ``SBUGlobals/userMentionConfig`` is set to `nil`
@@ -183,7 +188,8 @@ extension SBUConfig.GroupChannel {
183188
self._isFormTypeMessageEnabled.setDashboardValue(channel.isFormTypeMessageEnabled)
184189
self._isFeedbackEnabled.setDashboardValue(channel.isFeedbackEnabled)
185190
self._isMarkdownForUserMessageEnabled.setDashboardValue(channel.isMarkdownForUserMessageEnabled)
186-
191+
self._isMarkAsUnreadEnabled.setDashboardValue(channel.isMarkAsUnreadEnabled)
192+
187193
self.input.updateWithDashboardData(channel.input)
188194
}
189195

@@ -207,6 +213,7 @@ extension SBUConfig.GroupChannel {
207213
SendbirdUI.config.groupChannel.channel.isFeedbackEnabled
208214
self.isMarkdownForUserMessageEnabled = (try? container.decode(Bool.self, forKey: .isMarkdownForUserMessageEnabled)) ??
209215
SendbirdUI.config.groupChannel.channel.isMarkdownForUserMessageEnabled
216+
self.isMarkAsUnreadEnabled = (try? container.decode(Bool.self, forKey: .isMarkAsUnreadEnabled)) ?? SendbirdUI.config.groupChannel.channel.isMarkAsUnreadEnabled
210217

211218
self.input = try container.decode(SBUConfig.GroupChannel.Channel.Input.self, forKey: .input)
212219
}
@@ -227,6 +234,8 @@ extension SBUConfig.GroupChannel {
227234
try container.encode(self._isSuperGroupReactionsEnabled, forKey: .isSuperGroupReactionsEnabled)
228235
try container.encode(self.isFeedbackEnabled, forKey: .isFeedbackEnabled)
229236
try container.encode(self.isMarkdownForUserMessageEnabled, forKey: .isMarkdownForUserMessageEnabled)
237+
try container.encode(self.isMarkAsUnreadEnabled, forKey: .isMarkAsUnreadEnabled)
238+
230239
try container.encode(self.input, forKey: .input)
231240
}
232241
}

Sources/uikit/Constant/SBUStringSet.swift

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public class SBUStringSet {
3434
public static var Settings = "Settings"
3535
public static var Reply = "Reply"
3636
public static var Submit = "Submit" // 3.11.0
37+
public static var MarkAsUnread = "Mark as unread" // 3.32.0
3738

3839
// MARK: - Alert
3940
public static var Alert_Delete = "Are you sure you want to delete?"
@@ -109,7 +110,22 @@ public class SBUStringSet {
109110
return ""
110111
}
111112
}
112-
public static var Channel_State_Banner_Frozen = "Channel frozen"
113+
public static var Channel_State_Banner_Frozen = "Channel is frozen"
114+
/// - Since: 3.32.0
115+
public static var Channel_Unread_Message: (UInt) -> String = { count in
116+
switch count {
117+
case 1:
118+
return "1 unread message"
119+
case 2...99:
120+
return "\(count) unread messages"
121+
case 100...:
122+
return "99+ unread messages"
123+
default:
124+
return ""
125+
}
126+
}
127+
/// - Since: 3.32.0
128+
public static var Channel_Unread_Message_Newline = "New messages"
113129

114130
// MARK: - Open Channel
115131
public static var Open_Channel_Name_Default = "Open Channel"

Sources/uikit/Enums/SBUIconSetType.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ public enum SBUIconSetType: String, Hashable {
7272
case iconStop
7373
case iconGood // 3.15.0
7474
case iconBad // 3.15.0
75+
case iconMarkAsUnread // 3.32.0
7576

7677
// MARK: - Metric
7778

@@ -209,6 +210,7 @@ public enum SBUIconSetType: String, Hashable {
209210
case .iconStop: SBUIconSet.iconStop = SBUIconSetType.iconStop.load()
210211
case .iconBad: SBUIconSet.iconBad = SBUIconSetType.iconBad.load()
211212
case .iconGood: SBUIconSet.iconGood = SBUIconSetType.iconGood.load()
213+
case .iconMarkAsUnread: SBUIconSet.iconMarkAsUnread = SBUIconSetType.iconMarkAsUnread.load()
212214
}
213215

214216
SBUIconSetType.customizedIcons.remove(self)
@@ -282,6 +284,7 @@ public enum SBUIconSetType: String, Hashable {
282284
case .iconStop: return SBUIconSet.iconStop
283285
case .iconGood: return SBUIconSet.iconGood
284286
case .iconBad: return SBUIconSet.iconBad
287+
case .iconMarkAsUnread: return SBUIconSet.iconMarkAsUnread
285288
}
286289
}
287290
}

Sources/uikit/Extension/Shared/UIView+SBUIKit.swift

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,7 @@ extension UIView {
12821282
}
12831283
}
12841284

1285-
// Round Corners
1285+
// MARK: - Round Corners
12861286
extension UIView {
12871287
func roundCorners(corners: UIRectCorner, radius: CGFloat) {
12881288
self.clipsToBounds = true
@@ -1298,6 +1298,28 @@ extension UIView {
12981298
}
12991299
}
13001300

1301+
// Shadows
1302+
extension UIView {
1303+
func applyMultipleShadows(cornerRadius: CGFloat = 20, backgroundColor: UIColor, shadowConfigs: [(radius: CGFloat, offset: CGSize, color: UIColor)]) {
1304+
// Clear existing shadow sublayers
1305+
self.layer.sublayers?.removeAll { $0.name == "shadowLayer" }
1306+
1307+
for shadowConfig in shadowConfigs {
1308+
let shadowLayer = CALayer()
1309+
shadowLayer.name = "shadowLayer"
1310+
shadowLayer.frame = self.bounds
1311+
shadowLayer.backgroundColor = backgroundColor.cgColor
1312+
shadowLayer.cornerRadius = cornerRadius
1313+
shadowLayer.shadowColor = shadowConfig.color.cgColor
1314+
shadowLayer.shadowOffset = shadowConfig.offset
1315+
shadowLayer.shadowRadius = shadowConfig.radius
1316+
shadowLayer.shadowOpacity = 1
1317+
shadowLayer.shadowPath = UIBezierPath(roundedRect: self.bounds, cornerRadius: cornerRadius).cgPath
1318+
self.layer.insertSublayer(shadowLayer, at: 0)
1319+
}
1320+
}
1321+
}
1322+
13011323
// MARK: - Image
13021324
extension UIView {
13031325
func asImage() -> UIImage {

0 commit comments

Comments
 (0)