Skip to content

Commit 08af6ba

Browse files
author
adamsfliu
committed
【RoomKit】【iOS】Fix known issues
1 parent 85b7bf9 commit 08af6ba

2 files changed

Lines changed: 1 addition & 67 deletions

File tree

application/App-UIKit/Login/LoginView.swift

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import TUICore
1414

1515
protocol LoginViewDelegate: NSObjectProtocol {
1616
func loginDelegate(userId: String)
17-
func testModeSwitchChanged(isOn: Bool)
1817
func autoLoginSwitchChanged(isOn: Bool)
1918
}
2019

@@ -68,24 +67,6 @@ class LoginView: UIView {
6867
return textField
6968
}()
7069

71-
private let testModeView: UIView = {
72-
let view = UIView(frame: .zero)
73-
return view
74-
}()
75-
76-
private let testTitleLabel: UILabel = {
77-
let label = UILabel(frame: .zero)
78-
label.textColor = .black
79-
label.text = "Test Environment".localized
80-
return label
81-
}()
82-
83-
private let testModeSwitch: UISwitch = {
84-
let switcher = UISwitch(frame: .zero)
85-
switcher.isOn = false
86-
return switcher
87-
}()
88-
8970
private let autoLoginView: UIView = {
9071
let view = UIView(frame: .zero)
9172
return view
@@ -159,9 +140,6 @@ class LoginView: UIView {
159140
userIdContentView.addSubview(userIdTextLable)
160141
userIdContentView.addSubview(userIdTextField)
161142
addSubview(loginBtn)
162-
addSubview(testModeView)
163-
testModeView.addSubview(testTitleLabel)
164-
testModeView.addSubview(testModeSwitch)
165143
addSubview(autoLoginView)
166144
autoLoginView.addSubview(autoLoginTitleLabel)
167145
autoLoginView.addSubview(autoLoginSwitch)
@@ -209,26 +187,9 @@ class LoginView: UIView {
209187
make.height.equalTo(52.scale375Height())
210188
}
211189

212-
testModeView.snp.makeConstraints { make in
213-
make.trailing.equalToSuperview().offset(-20.scale375Width())
214-
make.top.equalTo(loginBtn.snp.bottom).offset(20.scale375Height())
215-
make.height.equalTo(44.scale375Height())
216-
make.width.greaterThanOrEqualTo(120.scale375Height())
217-
}
218-
219-
testModeSwitch.snp.makeConstraints { make in
220-
make.trailing.equalToSuperview().offset(-10.scale375Width())
221-
make.centerY.equalToSuperview()
222-
}
223-
224-
testTitleLabel.snp.makeConstraints { make in
225-
make.trailing.equalTo(testModeSwitch.snp.leading).offset(-20.scale375Width())
226-
make.leading.centerY.equalToSuperview()
227-
}
228-
229190
autoLoginView.snp.makeConstraints { make in
230191
make.trailing.equalToSuperview().offset(-20.scale375Width())
231-
make.top.equalTo(testModeView.snp.bottom).offset(10.scale375Height())
192+
make.top.equalTo(loginBtn.snp.bottom).offset(20.scale375Height())
232193
make.height.equalTo(44.scale375Height())
233194
make.width.greaterThanOrEqualTo(120.scale375Height())
234195
}
@@ -246,7 +207,6 @@ class LoginView: UIView {
246207

247208
private func bindInteraction() {
248209
loginBtn.addTarget(self, action: #selector(loginBtnClick), for: .touchUpInside)
249-
testModeSwitch.addTarget(self, action: #selector(onTestModeSwitchValueChanged), for: .valueChanged)
250210
autoLoginSwitch.addTarget(self, action: #selector(onAutoLoginSwitchValueChanged), for: .valueChanged)
251211
TUICSToastManager.setDefaultPosition(TUICSToastPositionCenter)
252212
userIdTextField.delegate = self
@@ -262,10 +222,6 @@ class LoginView: UIView {
262222
delegate?.loginDelegate(userId: userId)
263223
}
264224

265-
@objc private func onTestModeSwitchValueChanged(_ switcher: UISwitch) {
266-
delegate?.testModeSwitchChanged(isOn: switcher.isOn)
267-
}
268-
269225
@objc private func onAutoLoginSwitchValueChanged(_ switcher: UISwitch) {
270226
delegate?.autoLoginSwitchChanged(isOn: switcher.isOn)
271227
}

application/App-UIKit/Login/LoginViewController.swift

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -104,36 +104,14 @@ class LoginViewController: UIViewController {
104104
}
105105

106106
extension LoginViewController: LoginViewDelegate {
107-
func testModeSwitchChanged(isOn: Bool) {
108-
isTestEnvironment = isOn
109-
}
110107

111108
func autoLoginSwitchChanged(isOn: Bool) {
112109
UserDefaults.standard.set(isOn, forKey: "AutoLoginKey")
113110
}
114111

115112
func loginDelegate(userId: String) {
116-
switchTestEnvironment(enableTest: isTestEnvironment)
117113
login(userId: userId)
118114
}
119-
120-
private func switchTestEnvironment(enableTest: Bool) {
121-
var jsonObject = [String: Any]()
122-
jsonObject["api"] = "setTestEnvironment"
123-
var params = [String: Any]()
124-
params["enableRoomTestEnv"] = enableTest
125-
jsonObject["params"] = params
126-
127-
if let jsonData = try? JSONSerialization.data(withJSONObject: jsonObject, options: []),
128-
let jsonString = String(data: jsonData, encoding: .utf8) {
129-
TUIRoomEngine.sharedInstance().callExperimentalAPI(jsonStr: jsonString) { _ in }
130-
}
131-
132-
V2TIMManager.sharedInstance().callExperimentalAPI(
133-
api: "setTestEnvironment",
134-
param: NSNumber(value: enableTest)
135-
) { _ in } fail: { _, _ in }
136-
}
137115
}
138116

139117
extension LoginViewController: LanguageSelectViewControllerDelegate {

0 commit comments

Comments
 (0)