Skip to content

Commit a59e634

Browse files
authored
Merge pull request #18 from zjc19891106/main
single chat pin message support&add readme
2 parents 61106a0 + 17c7523 commit a59e634

22 files changed

+140
-39
lines changed
-47.6 KB
Loading
79.8 KB
Loading

EaseChatUIKit.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |s|
1010
s.name = 'EaseChatUIKit'
11-
s.version = '4.8.0'
11+
s.version = '4.9.0'
1212
s.summary = 'A easy for use ChatUIKit.'
1313

1414
# This description is used to generate tags and improve search results.

EaseChatUIKitChangeLog.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# EaseChatUIKit change log
2+
3+
## 4.8.0
4+
1.消息页面新增功能
5+
- 消息置顶
6+
- 文本消息URL预览
7+
- 消息输入中状态
8+
9+
2.联系人
10+
- 黑名单
11+
12+
## 4.6.0
13+
14+
1.会话列表界面
15+
- 会话置顶
16+
- 会话删除
17+
- 会话免打扰
18+
- 会话已读
19+
- 更多扩展操作菜单
20+
21+
2.联系人列表界面
22+
- 联系人列表
23+
- 好友请求
24+
- 群组列表及其后续
25+
26+
3.聊天界面
27+
28+
- 消息内容的显示可配置
29+
- 消息扩展功能复制、删除、多选合并转发、单条转发、撤回、创建话题(群内消息)、表情回应、消息回复、消息翻译、消息举报、消息编辑。
30+
- 发送文本、音频、视频、文件、联系人名片、表情、图片。
31+
- 各种消息的预览。
32+
- 消息气泡两种样式切换。
33+
- 后续消息搜索等。
34+
35+
4.公共UI组件
36+
- 导航栏
37+
- 弹窗
38+
- 底部弹层
39+
- Loading页面
40+
- Toast工具
41+
- 图片加载存储组件
42+
- 换肤协议工具
43+
- 字体工具类
44+
- 主题颜色工具类
45+
46+
5.工具类
47+
- 国际化工具
48+
- 音频amr格式转换工具
49+
- 各种扩展工具
50+

Sources/EaseChatUIKit/Classes/Service/Client/EaseChatUIKitClient.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
22

3-
public let EaseChatUIKit_VERSION = "4.8.0"
3+
public let EaseChatUIKit_VERSION = "4.9.0"
44

55
public let cache_update_notification = "EaseChatUIKitContextUpdateCache"
66

@@ -74,7 +74,13 @@ public let cache_update_notification = "EaseChatUIKitContextUpdateCache"
7474
EaseChatUIKitContext.shared?.currentUser = user
7575
EaseChatUIKitContext.shared?.chatCache?[user.id] = user
7676
EaseChatUIKitContext.shared?.userCache?[user.id] = user
77-
self.userService = UserServiceImplement(userInfo: user, token: token, completion: completion)
77+
if self.userService != nil {
78+
self.userService?.login(userId: user.id, token: token, completion: { success, error in
79+
completion(error)
80+
})
81+
} else {
82+
self.userService = UserServiceImplement(userInfo: user, token: token, completion: completion)
83+
}
7884
}
7985

8086
/// Logout user

Sources/EaseChatUIKit/Classes/Service/Implement/ConversationServiceImplement.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ extension ConversationServiceImplement: ChatEventsListener {
450450
}
451451

452452
@objc open func onConversationReadCallback(conversation: ChatConversation ) {
453-
conversation.markAllMessages(asRead: nil)
453+
// conversation.markAllMessages(asRead: nil)
454454
if let info = self.mapper(objects: [conversation]).first{
455455
info.unreadCount = 0
456456
for listener in self.responseDelegates.allObjects {

Sources/EaseChatUIKit/Classes/UI/Components/Chat/Controllers/MessageListController.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ extension MessageListController: MessageListDriverEventsListener {
398398
self.messageContainer.editMode = !$0
399399
self.navigation.editMode = !$0
400400
}
401+
401402
UIViewController.currentController?.present(vc, animated: true)
402403
}
403404

@@ -499,7 +500,7 @@ extension MessageListController: MessageListDriverEventsListener {
499500
messageActions.removeAll { $0.tag == "OriginalText" }
500501
}
501502
}
502-
if !Appearance.chat.enablePinMessage,self.chatType != .chat {
503+
if !Appearance.chat.enablePinMessage {
503504
messageActions.removeAll { $0.tag == "Pin" }
504505
}
505506
if !Appearance.chat.contentStyle.contains(.withReply) {
@@ -516,9 +517,7 @@ extension MessageListController: MessageListDriverEventsListener {
516517
messageActions.removeAll { $0.tag == "Recall" }
517518
}
518519
}
519-
if self.chatType == .chat {
520-
messageActions.removeAll { $0.tag == "Pin" }
521-
}
520+
522521
return messageActions
523522
}
524523

Sources/EaseChatUIKit/Classes/UI/Components/Chat/ViewModel/MessageListViewModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ import UIKit
305305
}
306306

307307
@objc open func fetchPinnedMessages() {
308-
if Appearance.chat.enablePinMessage,self.chatType != .chat {
308+
if Appearance.chat.enablePinMessage {
309309
self.chatService?.pinnedMessages(conversationId: self.to, completion: { [weak self] messages,error in
310310
guard let `self` = self else { return }
311311
if error == nil {

Sources/EaseChatUIKit/Classes/UI/Components/Chat/Views/MessageInputBar.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,13 +353,15 @@ extension MessageInputBar: UITextViewDelegate {
353353
}
354354

355355
@objc private func keyboardWillHide(notification: Notification) {
356-
if notification.object is MessageInputBar {
356+
if self.rightView.isSelected {
357357
let frame = notification.chat.keyboardEndFrame
358358
let duration = notification.chat.keyboardAnimationDuration
359359
self.hiddenDuration = duration ?? 0
360360
self.keyboardHeight = frame!.height
361361
self.showEmojiKeyboard()
362362
self.textViewFirstResponder?(true)
363+
} else {
364+
self.hiddenInputBar()
363365
}
364366
}
365367

Sources/EaseChatUIKit/Classes/UI/Components/Chat/Views/MessageListView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ extension MessageListView: IMessageListViewDriver {
807807

808808
public func reloadReaction(message: ChatMessage) {
809809
if let index = self.messages.firstIndex(where: { $0.message.messageId == message.messageId }) {
810-
if let indexPath = self.messageList.indexPathsForVisibleRows?.first(where: { $0.row == index }),indexPath.row > 0 {
810+
if let indexPath = self.messageList.indexPathsForVisibleRows?.first(where: { $0.row == index }),indexPath.row >= 0 {
811811
let entity = self.convertMessage(message: message)
812812
let reactionWidth = entity.reactionMenuWidth()
813813
if reactionWidth < reactionMaxWidth-30 {
@@ -836,7 +836,7 @@ extension MessageListView: IMessageListViewDriver {
836836

837837
public func reloadTopic(message: ChatMessage) {
838838
if let index = self.messages.firstIndex(where: { $0.message.messageId == message.messageId }) {
839-
if let indexPath = self.messageList.indexPathsForVisibleRows?.first(where: { $0.row == index }),indexPath.row > 0 {
839+
if let indexPath = self.messageList.indexPathsForVisibleRows?.first(where: { $0.row == index }),indexPath.row >= 0 {
840840
self.messages.replaceSubrange(index...index, with: [self.convertMessage(message: message)])
841841
self.messageList.reloadData()
842842
}

Sources/EaseChatUIKit/Classes/UI/Components/Conversation/Cells/ConversationListCell.swift

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,18 @@ import UIKit
7676
self.nickName.frame = CGRect(x: self.avatar.frame.maxX+12, y: self.avatar.frame.minX+4, width: self.contentView.frame.width-self.avatar.frame.maxX-12-16-50, height: 16)
7777
self.date.frame = CGRect(x: self.contentView.frame.width-66, y: self.nickName.frame.minY+2, width: 50, height: 16)
7878
self.content.frame = CGRect(x: self.avatar.frame.maxX+12, y: self.nickName.frame.maxY+2, width: self.contentView.frame.width-12-12-16-80, height: 20)
79-
// self.badge.frame = CGRect(x: self.contentView.frame.width-48, y: self.nickName.frame.maxY+5, width: 32, height: 18)
79+
var badgeWidth: CGFloat = 18
80+
if let badgeText = self.badge.text {
81+
if badgeText.count > 2 {
82+
badgeWidth = 32
83+
} else if badgeText.count > 1 {
84+
badgeWidth = 24
85+
}
86+
}
87+
self.badge.frame = CGRect(x: self.contentView.frame.width - badgeWidth - 16,
88+
y: self.nickName.frame.maxY + 5,
89+
width: badgeWidth,
90+
height: 18)
8091
self.dot.frame = CGRect(x: self.date.frame.maxX-12, y: self.nickName.frame.maxY+10, width: 8, height: 8)
8192
self.separatorLine.frame = CGRect(x: self.nickName.frame.minX, y: self.contentView.frame.height-0.5, width: self.contentView.frame.width-self.nickName.frame.minX, height: 0.5)
8293
}
@@ -124,15 +135,8 @@ import UIKit
124135
} else {
125136
self.badge.isHidden = info.unreadCount <= 0
126137
self.dot.isHidden = true
127-
var badgeWidth = 18
128-
if info.unreadCount > 9 {
129-
badgeWidth = 24
130-
if info.unreadCount > 99 {
131-
badgeWidth = 32
132-
}
133-
}
134-
self.badge.frame = CGRect(x: Int(ScreenWidth)-16-badgeWidth, y: Int(self.nickName.frame.maxY)+5, width: badgeWidth, height: 18)
135138
}
139+
self.setNeedsLayout()
136140
}
137141

138142

Sources/EaseChatUIKit/Classes/UI/Components/Conversation/Controllers/ConversationListController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ extension ConversationListController {
297297
}
298298

299299
extension ConversationListController: ThemeSwitchProtocol {
300-
public func switchTheme(style: ThemeStyle) {
300+
open func switchTheme(style: ThemeStyle) {
301301
self.view.backgroundColor = style == .dark ? UIColor.theme.neutralColor1:UIColor.theme.neutralColor98
302302
self.search.backgroundColor = style == .dark ? UIColor.theme.neutralColor2:UIColor.theme.neutralColor95
303303
self.navigation.backgroundColor = style == .dark ? UIColor.theme.neutralColor1:UIColor.theme.neutralColor98

Sources/EaseChatUIKit/Classes/UI/Components/Conversation/ViewModel/ConversationViewModel.swift

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ public let disturb_change = "EaseUIKit_do_not_disturb_changed"
132132
deinit {
133133
destroyed()
134134
}
135+
135136
}
136137

137138
//MARK: - ConversationListActionEventsDelegate
@@ -447,7 +448,15 @@ extension ConversationViewModel: ConversationServiceListener {
447448

448449
@objc open func conversationMessageAlreadyReadOnOtherDevice(info: ConversationInfo) {
449450
info.unreadCount = 0
450-
self.service?.markAllMessagesAsRead(conversationId: info.id)
451+
if let infos = ChatClient.shared().chatManager?.getAllConversations(true) {
452+
let items = self.mapper(objects: infos)
453+
var count = UInt(0)
454+
for item in items where item.doNotDisturb == false {
455+
count += item.unreadCount
456+
}
457+
self.service?.notifyUnreadCount(count: count)
458+
}
459+
// self.service?.markAllMessagesAsRead(conversationId: info.id)
451460
self.driver?.swipeMenuOperation(info: info, type: .read)
452461
}
453462
}

Sources/EaseChatUIKit/Classes/UI/Core/Foundation/ConsoleLog.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ private func consoleLog<T> (
4949
debugPrint("\(timeString) \(type.rawValue) \(fileName):\(line) EaseChatUIKit Log:\(message) function Name:\(functionName)")
5050
#else
5151
if type == .error {
52-
Log.saveLog(" EaseChatUIKit Log:\(message)",file: file,function: function,line: line)
52+
Log.saveLog(" EaseChatUIKit Log:\(message) \n",file: file,function: function,line: line)
5353
}
5454
#endif
5555
}

Sources/EaseChatUIKit/Classes/UI/Core/UIKit/Commons/Contants.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public let edgeZero: UIEdgeInsets = .zero
2020
public let BottomBarHeight = UIApplication.shared.windows.first?.safeAreaInsets.bottom ?? 0
2121

2222
/// The height of the status bar.
23-
public let StatusBarHeight :CGFloat = BottomBarHeight > 0 ? 43:20
23+
public let StatusBarHeight :CGFloat = UIApplication.shared.statusBarFrame.height
2424

2525
/// The height of the navigation bar, which includes the status bar.
2626
public let NavigationHeight :CGFloat = StatusBarHeight + 44

Sources/EaseChatUIKit/Classes/UI/Core/UIKit/Commons/EaseChatNavigationBar.swift

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ import UIKit
110110
}
111111

112112
public private(set) lazy var titleLabel: UILabel = {
113-
UILabel(frame: CGRect(x: self.avatar.frame.maxX+4, y: StatusBarHeight+2, width: ScreenWidth-self.avatar.frame.maxX*2-8*3, height: 22)).font(UIFont.theme.headlineSmall).textColor(UIColor.theme.neutralColor1).backgroundColor(.clear).tag(2)
113+
UILabel(frame: CGRect(x: self.avatar.frame.maxX+4, y: (nearStatusBar ? StatusBarHeight:0)+2, width: ScreenWidth-self.avatar.frame.maxX*2-8*3, height: 22)).font(UIFont.theme.headlineSmall).textColor(UIColor.theme.neutralColor1).backgroundColor(.clear).tag(2)
114114
}()
115115

116116
public private(set) lazy var detail: UILabel = {
@@ -141,6 +141,10 @@ import UIKit
141141
public private(set) lazy var cancel: UIButton = {
142142
UIButton(type: .custom).frame(CGRect(x: ScreenWidth-58, y: self.frame.height-36, width: 50, height: 28)).backgroundColor(.clear).title("barrage_long_press_menu_cancel".chat.localize, .normal).font(UIFont.theme.labelMedium).textColor(UIColor.theme.primaryColor5, .normal).tag(4).addTargetFor(self, action: #selector(buttonAction(sender:)), for: .touchUpInside)
143143
}()
144+
145+
private var originalRenderRightImage = false
146+
147+
private var nearStatusBar = true
144148

145149
internal override init(frame: CGRect) {
146150
super.init(frame: frame)
@@ -154,9 +158,10 @@ import UIKit
154158
/// - avatarURL: Avatar url.
155159
/// - rightImages: Right buttons kind of `[UIImage]`.
156160
/// - hiddenAvatar: Whether hide avatar or not.
157-
@objc required public convenience init(frame: CGRect = CGRect(x: 0, y: 0, width: ScreenWidth, height: NavigationHeight),showLeftItem: Bool, textAlignment: NSTextAlignment = .center, placeHolder: UIImage? = nil,avatarURL: String? = nil,rightImages: [UIImage] = [],hiddenAvatar: Bool = false) {
161+
@objc required public convenience init(frame: CGRect = CGRect(x: 0, y: 0, width: ScreenWidth, height: NavigationHeight),showLeftItem: Bool, textAlignment: NSTextAlignment = .center, placeHolder: UIImage? = nil,avatarURL: String? = nil,rightImages: [UIImage] = [],hiddenAvatar: Bool = false,nearStatusBar: Bool = true) {
158162
self.init(frame: frame)
159163
self.showLeft = showLeftItem
164+
self.nearStatusBar = nearStatusBar
160165
if showLeftItem {
161166
var width = CGFloat(self.rightImages.count*36)
162167
if self.avatar.frame.maxX+4 > width {
@@ -167,7 +172,7 @@ import UIKit
167172
} else {
168173
self.addSubViews([self.leftItem,self.avatar,self.status,self.titleLabel,self.detail,self.rightItems,self.separateLine,self.cancel])
169174
}
170-
self.titleLabel.frame = CGRect(x: (hiddenAvatar ? self.leftItem.frame.maxX:self.avatar.frame.maxX)+8, y: StatusBarHeight+4, width: ScreenWidth - width*2 - 4, height: 22)
175+
self.titleLabel.frame = CGRect(x: (hiddenAvatar ? self.leftItem.frame.maxX:self.avatar.frame.maxX)+8, y: (nearStatusBar ? StatusBarHeight:0)+4, width: ScreenWidth - width*2 - 4, height: 22)
171176
if textAlignment == .center {
172177
self.titleLabel.center = CGPoint(x: self.center.x, y: self.titleLabel.center.y)
173178
}
@@ -180,7 +185,7 @@ import UIKit
180185
}
181186
self.bringSubviewToFront(self.avatar)
182187
self.bringSubviewToFront(self.status)
183-
self.titleLabel.frame = CGRect(x: (hiddenAvatar ? self.leftItem.frame.maxX:self.avatar.frame.maxX)+8, y: StatusBarHeight+4, width: ScreenWidth - CGFloat(self.rightImages.count*36)*2, height: 22)
188+
self.titleLabel.frame = CGRect(x: (hiddenAvatar ? self.leftItem.frame.maxX:self.avatar.frame.maxX)+8, y: (nearStatusBar ? StatusBarHeight:0), width: ScreenWidth - CGFloat(self.rightImages.count*36)*2, height: 22)
184189
if textAlignment == .center {
185190
self.titleLabel.center = CGPoint(x: self.center.x, y: self.titleLabel.center.y)
186191
}
@@ -198,8 +203,9 @@ import UIKit
198203
self.addGesture()
199204
self.cancel.isHidden = true
200205
self.leftItem.center = CGPoint(x: self.leftItem.center.x, y: self.leftItem.center.y-2)
206+
self.avatar.frame = CGRect(x: self.showLeft ? self.leftItem.frame.maxX:CGFloat(10), y: self.frame.height-38, width: 32, height: 32)
201207
self.updateRightItems(images: rightImages)
202-
self.titleLabel.frame = CGRect(x: (hiddenAvatar ? self.leftItem.frame.maxX:self.avatar.frame.maxX)+8, y: StatusBarHeight+4, width: ScreenWidth - self.rightItems.frame.width - 8 - ((hiddenAvatar ? self.leftItem.frame.maxX:self.avatar.frame.maxX)+8), height: 22)
208+
self.titleLabel.frame = CGRect(x: (hiddenAvatar ? self.leftItem.frame.maxX:self.avatar.frame.maxX)+8, y: (nearStatusBar ? StatusBarHeight:0)+4, width: ScreenWidth - self.rightItems.frame.width - 8 - ((hiddenAvatar ? self.leftItem.frame.maxX:self.avatar.frame.maxX)+8), height: 22)
203209
self.detail.frame = CGRect(x: self.titleLabel.frame.minX, y: self.titleLabel.frame.maxY, width: self.titleLabel.frame.width, height: 14)
204210
self.status.isHidden = Appearance.hiddenPresence
205211
Theme.registerSwitchThemeViews(view: self)
@@ -269,27 +275,33 @@ import UIKit
269275
}
270276
}
271277

272-
@objc public func updateRightItems(images: [UIImage]) {
278+
@objc public func updateRightItems(images: [UIImage],original: Bool = false) {
279+
self.originalRenderRightImage = original
273280
self.rightImages.removeAll()
274281
if images.count > 3 {
275282
self.rightImages = Array(images.prefix(3))
276283
} else {
277284
self.rightImages.append(contentsOf: images)
278285
}
279-
self.rightItems.frame = CGRect(x: ScreenWidth-CGFloat(images.count*36)-8, y: StatusBarHeight+8, width: CGFloat(images.count*36), height: 36)
286+
self.rightItems.frame = CGRect(x: ScreenWidth-CGFloat(images.count*36)-8, y: (nearStatusBar ? StatusBarHeight:0)+8, width: CGFloat(images.count*36), height: 36)
280287
self.rightItems.reloadData()
281288
}
289+
282290
}
283291

284292
extension EaseChatNavigationBar: UICollectionViewDataSource,UICollectionViewDelegate {
285-
293+
286294
public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
287295
self.rightImages.count
288296
}
289297

290298
public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
291299
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "EaseChatNavigationBarRightCell", for: indexPath) as? EaseChatNavigationBarRightCell
292-
cell?.imageView.image = self.rightImages[safe: indexPath.row]?.withTintColor(Theme.style == .dark ? UIColor.theme.neutralColor98:UIColor.theme.neutralColor3)
300+
if self.originalRenderRightImage {
301+
cell?.imageView.image = self.rightImages[safe: indexPath.row]?.withRenderingMode(.alwaysOriginal)
302+
} else {
303+
cell?.imageView.image = self.rightImages[safe: indexPath.row]?.withTintColor(Theme.style == .dark ? UIColor.theme.neutralColor98:UIColor.theme.neutralColor3)
304+
}
293305
return cell ?? UICollectionViewCell()
294306
}
295307

Sources/EaseChatUIKit/Classes/UI/Core/UIKit/Commons/ImageView.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ import Combine
2727
/// - placeHolder: An optional placeholder image to display while the image is being loaded.
2828
@MainActor public func image(with url: String,placeHolder: UIImage?) {
2929
self.image = placeHolder
30-
var urlString = url.lowercased()
30+
var urlString = ""
31+
if url.hasSuffix(".png") || url.hasSuffix(".jpg") || url.hasSuffix(".jpeg") {
32+
urlString = url
33+
} else {
34+
urlString = url.lowercased()
35+
}
3136
if !url.hasPrefix("http://"), !url.hasPrefix("https://") {
3237
urlString = "https://" + url
3338
} else {

Sources/EaseChatUIKit/Classes/UI/Core/UIKit/DialogComponent/DialogManager/DialogContainerViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import UIKit
1616

1717
public var presentedViewComponent: PresentedViewComponent? = PresentedViewComponent(contentSize: Appearance.pageContainerConstraintsSize,destination: .bottomBaseline,canTapBGDismiss: true)
1818

19-
var customView: UIView?
19+
public var customView: UIView?
2020

2121
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
2222
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)

Sources/EaseChatUIKit/Classes/UI/Core/UIKit/DialogComponent/DialogManager/PageContainersDialogController.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import UIKit
2121
private var pageTitles = [String]()
2222

2323
private var childControllers = [UIViewController]()
24+
25+
public var willRemoveClosure: (() -> ())?
2426

2527
lazy var container: PageContainer = {
2628
PageContainer(frame: CGRect(x: 0, y: 0, width: self.presentedViewComponent?.contentSize.width ?? 0, height: self.presentedViewComponent?.contentSize.height ?? 0), viewControllers: self.childControllers, indicators: self.pageTitles).cornerRadius(.medium, [.topLeft,.topRight], .clear, 0).backgroundColor(UIColor.theme.neutralColor98)
@@ -63,6 +65,11 @@ import UIKit
6365
self.view.backgroundColor(.clear)
6466
self.view.addSubview(self.container)
6567
}
68+
69+
public override func viewWillDisappear(_ animated: Bool) {
70+
super.viewWillDisappear(animated)
71+
self.willRemoveClosure?()
72+
}
6673
}
6774

6875

0 commit comments

Comments
 (0)