Skip to content

Commit e3738c8

Browse files
authored
Merge pull request #29 from easemob/dev
oc option set
2 parents 88a97b5 + 8f97131 commit e3738c8

File tree

2 files changed

+27
-26
lines changed

2 files changed

+27
-26
lines changed

Example/ChatroomUIKit/UIWithBusinessViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ final class UIWithBusinessViewController: UIViewController {
1717

1818
var owner = false
1919

20-
var option: ChatroomUIKitInitialOptions.UIOptions {
21-
let options = ChatroomUIKitInitialOptions.UIOptions()
20+
var option: UIOptions {
21+
let options = UIOptions()
2222
options.bottomDataSource = self.bottomBarDatas()
2323
options.showGiftMessageArea = true
2424
options.chatAreaShowGift = false

Sources/ChatroomUIKit/Classes/Service/Client/ChatroomUIKitClient.swift

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,30 @@ import UIKit
1616
/// The option of chat sdk function.
1717
public var option_chat: ChatOptions = ChatOptions()
1818

19-
@objcMembers public class UIOptions: NSObject {
20-
/// Whether to show a gift message area..
21-
@objc public var showGiftMessageArea = true
22-
23-
/// Data source of ``ChatBottomBar``.
24-
@objc public var bottomDataSource: [ChatBottomItemProtocol] = []
25-
26-
/// Whether to show the gift information in the chat area.
27-
@objc public var chatAreaShowGift = false
28-
}
19+
}
20+
21+
@objcMembers public class UIOptions: NSObject {
22+
/// Whether to show a gift message area..
23+
@objc public var showGiftMessageArea = true
24+
25+
/// Data source of ``ChatBottomBar``.
26+
@objc public var bottomDataSource: [ChatBottomItemProtocol] = []
27+
28+
/// Whether to show the gift information in the chat area.
29+
@objc public var chatAreaShowGift = false
30+
}
31+
32+
@objcMembers public class ChatOptions: NSObject {
33+
34+
/// Whether print chat sdk log or not.
35+
public var enableConsoleLog = false
36+
37+
/// Whether auto login or not.
38+
public var autoLogin = false
39+
40+
/// Whether to use user attributes.
41+
@objc public var useProperties: Bool = true
2942

30-
@objcMembers public class ChatOptions: NSObject {
31-
32-
/// Whether print chat sdk log or not.
33-
public var enableConsoleLog = false
34-
35-
/// Whether auto login or not.
36-
public var autoLogin = false
37-
38-
/// Whether to use user attributes.
39-
@objc public var useProperties: Bool = true
40-
41-
}
4243
}
4344

4445
///ChatroomUIKit initialization class.
@@ -62,7 +63,7 @@ import UIKit
6263
/// - Parameters:
6364
/// Returns the initialization success or an error that includes the description of the cause of the failure.
6465
@objc(setupWithAppkey:option:)
65-
public func setup(appKey: String,option: ChatroomUIKitInitialOptions.ChatOptions = ChatroomUIKitInitialOptions.ChatOptions()) -> ChatError? {
66+
public func setup(appKey: String,option: ChatOptions = ChatOptions()) -> ChatError? {
6667
let option = ChatSDKOptions(appkey: appKey)
6768
option.enableConsoleLog = true
6869
option.isAutoLogin = false
@@ -109,7 +110,7 @@ import UIKit
109110
/// - options: ``UIOptions``
110111
/// - Returns: ``ChatroomView`` instance.
111112
@objc(launchRoomViewWithRoomId:frame:ownerId:options:)
112-
public func launchRoomView(roomId: String,frame: CGRect, ownerId: String , options: ChatroomUIKitInitialOptions.UIOptions = ChatroomUIKitInitialOptions.UIOptions()) -> ChatroomView {
113+
public func launchRoomView(roomId: String,frame: CGRect, ownerId: String , options: UIOptions = UIOptions()) -> ChatroomView {
113114
self.roomId = roomId
114115
ChatroomContext.shared?.roomId = roomId
115116
ChatroomContext.shared?.ownerId = ownerId

0 commit comments

Comments
 (0)