Commit f736ecfc authored by pete谢兆麟's avatar pete谢兆麟

代码修改

parent ad207555
...@@ -701,9 +701,9 @@ extension YHJsApi { ...@@ -701,9 +701,9 @@ extension YHJsApi {
let tmpT = url.base64Encoded ?? ""// 对deepLink使用 base64编码 let tmpT = url.base64Encoded ?? ""// 对deepLink使用 base64编码
var oldUrl = shareH5Url var oldUrl = shareH5Url
if oldUrl.contains("?") { if oldUrl.contains("?") {
oldUrl = oldUrl + "&appDeepLink=\(tmpT)" oldUrl += "&appDeepLink=\(tmpT)"
} else { } else {
oldUrl = oldUrl + "?appDeepLink=\(tmpT)" oldUrl += "?appDeepLink=\(tmpT)"
} }
DispatchQueue.main.async { DispatchQueue.main.async {
......
...@@ -111,7 +111,9 @@ extension YHCategoryDropdownView: UITableViewDelegate, UITableViewDataSource { ...@@ -111,7 +111,9 @@ extension YHCategoryDropdownView: UITableViewDelegate, UITableViewDataSource {
} }
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "YHDropCategoryCell", for: indexPath) as! YHDropCategoryCell guard let cell = tableView.dequeueReusableCell(withIdentifier: "YHDropCategoryCell", for: indexPath) as? YHDropCategoryCell else {
return UITableViewCell()
}
cell.titleLabel.text = categories[indexPath.row] cell.titleLabel.text = categories[indexPath.row]
cell.isSelected = indexPath.row == selectedIndex cell.isSelected = indexPath.row == selectedIndex
return cell return cell
......
...@@ -136,8 +136,8 @@ class YHValidateCodeInputView: UIView { ...@@ -136,8 +136,8 @@ class YHValidateCodeInputView: UIView {
func interactive() { func interactive() {
for index in 1...count { for index in 1...count {
let component = self.viewWithTag(baseTag+index) as! YHValidateCodeComponentView let component = self.viewWithTag(baseTag+index) as? YHValidateCodeComponentView
_ = component.viewWithTag(999) as! UITextField _ = component?.viewWithTag(999) as? UITextField
} }
} }
......
...@@ -136,7 +136,7 @@ class YHSmsCodeInputView: UIView { ...@@ -136,7 +136,7 @@ class YHSmsCodeInputView: UIView {
if text.count > config.count { return } if text.count > config.count { return }
for index in 0..<config.count { for index in 0..<config.count {
let codeView = self.viewWithTag(codeViewBaseTag+index+1) as! YHSmsCodeView guard let codeView = self.viewWithTag(codeViewBaseTag+index+1) as? YHSmsCodeView else { return }
codeView.text = (index < text.count ? String(text[index]) : "") codeView.text = (index < text.count ? String(text[index]) : "")
codeView.showCursor = (index == text.count) codeView.showCursor = (index == text.count)
......
...@@ -294,7 +294,7 @@ extension YHMessageDetailListVC: UITableViewDelegate, UITableViewDataSource { ...@@ -294,7 +294,7 @@ extension YHMessageDetailListVC: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHDetailMessageCell.cellReuseIdentifier, for: indexPath) as! YHDetailMessageCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHDetailMessageCell.cellReuseIdentifier, for: indexPath) as? YHDetailMessageCell else { return UITableViewCell() }
if 0 <= indexPath.row && indexPath.row < msgArr.count { if 0 <= indexPath.row && indexPath.row < msgArr.count {
let item = msgArr[indexPath.row] let item = msgArr[indexPath.row]
cell.updateModel(item, type: self.type) cell.updateModel(item, type: self.type)
...@@ -393,7 +393,7 @@ extension YHMessageDetailListVC: UITableViewDelegate, UITableViewDataSource { ...@@ -393,7 +393,7 @@ extension YHMessageDetailListVC: UITableViewDelegate, UITableViewDataSource {
// 累计出现在屏幕上的未读消息集合 // 累计出现在屏幕上的未读消息集合
func addUpAppearUnreadMessages() { func addUpAppearUnreadMessages() {
let visibleCells = tableView.visibleCells as! [YHDetailMessageCell] let visibleCells = tableView.visibleCells as? [YHDetailMessageCell] ?? []
if visibleCells.count <= 0 { return } if visibleCells.count <= 0 { return }
for cell in visibleCells { for cell in visibleCells {
if let msgItem = cell.model { if let msgItem = cell.model {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment