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

代码修改

parent ad207555
......@@ -701,9 +701,9 @@ extension YHJsApi {
let tmpT = url.base64Encoded ?? ""// 对deepLink使用 base64编码
var oldUrl = shareH5Url
if oldUrl.contains("?") {
oldUrl = oldUrl + "&appDeepLink=\(tmpT)"
oldUrl += "&appDeepLink=\(tmpT)"
} else {
oldUrl = oldUrl + "?appDeepLink=\(tmpT)"
oldUrl += "?appDeepLink=\(tmpT)"
}
DispatchQueue.main.async {
......
......@@ -111,7 +111,9 @@ extension YHCategoryDropdownView: UITableViewDelegate, UITableViewDataSource {
}
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.isSelected = indexPath.row == selectedIndex
return cell
......
......@@ -136,8 +136,8 @@ class YHValidateCodeInputView: UIView {
func interactive() {
for index in 1...count {
let component = self.viewWithTag(baseTag+index) as! YHValidateCodeComponentView
_ = component.viewWithTag(999) as! UITextField
let component = self.viewWithTag(baseTag+index) as? YHValidateCodeComponentView
_ = component?.viewWithTag(999) as? UITextField
}
}
......
......@@ -136,7 +136,7 @@ class YHSmsCodeInputView: UIView {
if text.count > config.count { return }
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.showCursor = (index == text.count)
......
......@@ -294,7 +294,7 @@ extension YHMessageDetailListVC: UITableViewDelegate, UITableViewDataSource {
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 {
let item = msgArr[indexPath.row]
cell.updateModel(item, type: self.type)
......@@ -393,7 +393,7 @@ extension YHMessageDetailListVC: UITableViewDelegate, UITableViewDataSource {
// 累计出现在屏幕上的未读消息集合
func addUpAppearUnreadMessages() {
let visibleCells = tableView.visibleCells as! [YHDetailMessageCell]
let visibleCells = tableView.visibleCells as? [YHDetailMessageCell] ?? []
if visibleCells.count <= 0 { return }
for cell in visibleCells {
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