Commit ad207555 authored by Steven杜宇's avatar Steven杜宇

// lint

parent 97a6e55e
......@@ -84,7 +84,9 @@ extension YHAppleLoginManager: ASAuthorizationControllerDelegate, ASAuthorizatio
printLog("Apple login FAILED: \(error.localizedDescription)")
isAppleLoginBtnEnabled = true
if error is ASAuthorizationError {
let err = error as! ASAuthorizationError
guard let err = error as? ASAuthorizationError else {
return
}
// 在这里处理 AuthenticationError
handleAuthenticationError(err)
}
......
......@@ -103,7 +103,7 @@ extension YHHomeInformationViewController: UICollectionViewDelegate, UICollectio
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHHomeCollectionViewCell.cellReuseIdentifier, for: indexPath) as! YHHomeCollectionViewCell
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHHomeCollectionViewCell.cellReuseIdentifier, for: indexPath) as? YHHomeCollectionViewCell else { return UICollectionViewCell() }
cell.listModel = self.viewModel.arrHomeNewsData?[indexPath.row]
return cell
}
......
......@@ -502,7 +502,7 @@ extension YHHomePageViewController: UICollectionViewDelegate, UICollectionViewDa
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHHomeCollectionViewCell.cellReuseIdentifier, for: indexPath) as! YHHomeCollectionViewCell
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHHomeCollectionViewCell.cellReuseIdentifier, for: indexPath) as? YHHomeCollectionViewCell else { return UICollectionViewCell() }
cell.listModel = self.viewModel.arrHomeNewsData?[indexPath.row]
return cell
}
......
......@@ -150,9 +150,9 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
if !url.contains("yhid=") {
let id = YHLoginManager.shared.userModel?.id ?? ""
if url.contains("?") {
url = url + "&yhid=\(id)"
url += "&yhid=\(id)"
} else {
url = url + "?yhid=\(id)"
url += "?yhid=\(id)"
}
}
......
......@@ -98,7 +98,7 @@ extension YHOtherServiceListViewController: UICollectionViewDelegate, UICollecti
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHHomeCollectionViewCell.cellReuseIdentifier, for: indexPath) as! YHHomeCollectionViewCell
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHHomeCollectionViewCell.cellReuseIdentifier, for: indexPath) as? YHHomeCollectionViewCell else { return UICollectionViewCell() }
cell.listModel = items[indexPath.row]
return cell
......
......@@ -359,7 +359,7 @@ extension YHSearchInfomationVC: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHSearchInfoCell.cellReuseIdentifier, for: indexPath) as! YHSearchInfoCell
gurad let cell = tableView.dequeueReusableCell(withIdentifier: YHSearchInfoCell.cellReuseIdentifier, for: indexPath) as? YHSearchInfoCell else { return UITableViewCell() }
if 0 <= indexPath.section && indexPath.section < items.count {
let item = items[indexPath.section]
......
......@@ -61,7 +61,7 @@ private extension YHStartPageViewController {
}
@objc func downTimerOp() {
MaxTime = MaxTime - 1
MaxTime -= 1
if MaxTime < 0 {
cancelTimer()
clickCancelBtn()
......
......@@ -153,7 +153,7 @@ extension YHInvatationShareViewController {
@objc func saveBtnClick() {
let currentPage = self.currentPage(collectionView: myCollectView)
if currentPage == 0 {
let cell = myCollectView.cellForItem(at: IndexPath(row: currentPage, section: 0)) as! YHShareOneCollectionViewCell
guard let cell = myCollectView.cellForItem(at: IndexPath(row: currentPage, section: 0)) as? YHShareOneCollectionViewCell else { return }
guard let combinedImage = combinedImageFrom(imageView: cell.centerImageView) else { return }
saveImageToPhotosAlbum(image: combinedImage)
} else {
......
......@@ -35,7 +35,7 @@ class YHInvitationWithGiftsHeadView: UIView {
subMarqueeLabel.text = "\(nextModel.mobile) 已提现 \(nextModel.amount) 元"
timer = Timer.scheduledTimer(withTimeInterval: 2.0, repeats: true) { [weak self] _ in
index = index + 1
index += 1
UIView.animate(withDuration: 0.5) {
self?.marqueeLabel.frame.origin.y = -30
self?.subMarqueeLabel.frame.origin.y = 0
......
......@@ -100,7 +100,6 @@ class YHInvitationWithGiftsSecondTableViewCell: UITableViewCell {
make.right.equalTo(-12)
make.bottom.equalTo(-8)
}
titleLeftImageView = {
let view = UIImageView()
view.image = UIImage(named: "invitation_with_gifts_second_left")
......@@ -113,7 +112,6 @@ class YHInvitationWithGiftsSecondTableViewCell: UITableViewCell {
make.width.equalTo(110)
make.height.equalTo(20)
}
titleRightImageView = {
let view = UIImageView()
view.image = UIImage(named: "invitation_with_gifts_second_right")
......
......@@ -414,7 +414,7 @@ class YHInvitationWithGiftsSelectItemCell: UITableViewCell {
make.top.equalTo(16)
}
x = x + Int(width) + 12
index = index + 1
index += 1
}
}
......
......@@ -26,7 +26,9 @@ class YHInvitationWithGiftsViewModel: YHBaseViewModel {
callBackBlock(false, nil)
return
}
self.model = (result as! [YHShareCashOutModel])
if let result = result as? [YHShareCashOutModel] {
self.model = result
}
callBackBlock(true, nil)
} else {
let error: YHErrorModel = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg)
......
......@@ -353,7 +353,9 @@ extension YHLifeDetailViewController: UIScrollViewDelegate {
extension YHLifeDetailViewController: UITableViewDataSource, UITableViewDelegate {
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHHomeIdentityCell.cellReuseIdentifier, for: indexPath) as! YHHomeIdentityCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHHomeIdentityCell.cellReuseIdentifier, for: indexPath) as? YHHomeIdentityCell else {
return UITableViewCell()
}
if 0 <= indexPath.row, indexPath.row < self.imgItems.count {
let item = self.imgItems[indexPath.row]
cell.image = item.img
......
......@@ -267,10 +267,14 @@ extension YHLifeViewController: UICollectionViewDelegate, UICollectionViewDataSo
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
if self.viewModel.liveArr.count == 0 {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHLookNodataCollectionViewCell.cellReuseIdentifier, for: indexPath) as! YHLookNodataCollectionViewCell
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHLookNodataCollectionViewCell.cellReuseIdentifier, for: indexPath) as? YHLookNodataCollectionViewCell else {
return UICollectionViewCell()
}
return cell
}
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHLookCollectionViewCell.cellReuseIdentifier, for: indexPath) as! YHLookCollectionViewCell
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHLookCollectionViewCell.cellReuseIdentifier, for: indexPath) as? YHLookCollectionViewCell else {
return UICollectionViewCell()
}
cell.dataSource = self.viewModel.liveArr[indexPath.row]
return cell
......
......@@ -81,7 +81,9 @@ extension YHLifeSectionView: UICollectionViewDelegate, UICollectionViewDataSourc
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHLifeSectionCollectionViewCell.cellReuseIdentifier, for: indexPath) as! YHLifeSectionCollectionViewCell
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHLifeSectionCollectionViewCell.cellReuseIdentifier, for: indexPath) as? YHLifeSectionCollectionViewCell else {
return UICollectionViewCell()
}
cell.dataSource = items[indexPath.row]
if indexPath.row == selectIndex {
......
......@@ -135,7 +135,9 @@ extension YHHomeBannerView: FSPagerViewDataSource, FSPagerViewDelegate {
}
public func pagerView(_ pagerView: FSPagerView, cellForItemAt index: Int) -> FSPagerViewCell {
let cell = pagerView.dequeueReusableCell(withReuseIdentifier: "cell", at: index) as! YHHomeBannerCollectionViewCell
guard let cell = pagerView.dequeueReusableCell(withReuseIdentifier: "cell", at: index) as? YHHomeBannerCollectionViewCell else {
return FSPagerViewCell()
}
if index < dataArr.count {
cell.dataModel = dataArr[index]
}
......
......@@ -246,7 +246,7 @@ extension YHHomeCollectionViewCell {
if success {
listModel.is_like = true
listModel.like_count = listModel.like_count + 1
listModel.like_count += 1
self.numLable.text = listModel.like_count.string
self.heartImageViewBtn.setImage(UIImage(named: ""), for: .selected)
......
......@@ -21,7 +21,7 @@ class YHHomeInfoSectionHeadView: UICollectionReusableView {
self.collectView.reloadData()
var row = items.count/3
if items.count%3 != 0 {
row = row + 1
row += 1
}
let totalHeight = Double(row) * kHomeItemHeight
self.collectView.snp.updateConstraints { make in
......
......@@ -19,8 +19,9 @@ class YHIdentityTabBar: UIView {
didSet {
for (index, item) in self.subviews.enumerated() {
if item.isKind(of: UIButton.self) {
let itemBtn = item as! UIButton
self.setButton(itemBtn, isSelected: index == self.selectIndex)
if let itemBtn = item as? UIButton {
self.setButton(itemBtn, isSelected: index == self.selectIndex)
}
}
}
if 0 <= self.selectIndex, self.selectIndex < self.items.count {
......
......@@ -127,7 +127,7 @@ extension YHSearchInfoHistoryView: UICollectionViewDelegate, UICollectionViewDat
// 返回自定义单元格
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHSearchInfoHistoryCell.cellReuseIdentifier, for: indexPath) as! YHSearchInfoHistoryCell
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHSearchInfoHistoryCell.cellReuseIdentifier, for: indexPath) as? YHSearchInfoHistoryCell else { return UICollectionViewCell() }
if 0 <= indexPath.item && indexPath.item < historyItems.count {
cell.titleLabel.text = historyItems[indexPath.item]
}
......
......@@ -153,7 +153,7 @@ extension YHHomePageViewModel {
self.arrHomeNewsData = result.data
curPageIndex = 1
} else {
curPageIndex = curPageIndex + 1
curPageIndex += 1
self.arrHomeNewsData?.append(contentsOf: result.data)
}
......
......@@ -314,7 +314,7 @@ class YHSelectLookTableViewCell: UITableViewCell {
make.left.equalTo(view?.snp.right ?? 0).offset(4)
}
}
i = i + 1
i += 1
}
guard let url = URL(string: dataSource.image) else { return }
self.centerImageView.kf.setImage(with: url)
......
......@@ -195,7 +195,7 @@ extension YHSelectLookHeadView: UICollectionViewDelegate, UICollectionViewDataSo
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHSelectLookHeadViewCollectionViewCell.cellReuseIdentifier, for: indexPath) as! YHSelectLookHeadViewCollectionViewCell
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHSelectLookHeadViewCollectionViewCell.cellReuseIdentifier, for: indexPath) as? YHSelectLookHeadViewCollectionViewCell else { return UICollectionViewCell() }
cell.dataSource = items[indexPath.row]
if indexPath.row == selectIndex {
......
......@@ -90,7 +90,7 @@ extension YHSelectLookView: UICollectionViewDelegate, UICollectionViewDataSource
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHSelectLookViewCell.cellReuseIdentifier, for: indexPath) as! YHSelectLookViewCell
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHSelectLookViewCell.cellReuseIdentifier, for: indexPath) as? YHSelectLookViewCell else { return UICollectionViewCell() }
if indexPath.row < 5 {
cell.dataSource = items[indexPath.row]
} else {
......
......@@ -37,9 +37,9 @@ class YHInformationPerfectListVC: YHBaseViewController {
} else {
name = applicant.applicantName
if applicant.sex == 1 {
name = name + "先生"
name += "先生"
} else if applicant.sex == 2 {
name = name + "女士"
name += "女士"
} else {
}
......
......@@ -28,7 +28,9 @@ class YHOrderDetailViewController: YHBaseViewController {
getWhiteList()
getData()
// Do any additional setup after loading the view.
let appDelegate = UIApplication.shared.delegate as! AppDelegate
guard let appDelegate = UIApplication.shared.delegate as? AppDelegate else {
return
}
appDelegate.window?.rootViewController?.setNeedsStatusBarAppearanceUpdate()
let orientation = UIInterfaceOrientation.landscapeLeft
......
......@@ -97,7 +97,7 @@ extension YHServiceBannerView: FSPagerViewDataSource, FSPagerViewDelegate {
}
public func pagerView(_ pagerView: FSPagerView, cellForItemAt index: Int) -> FSPagerViewCell {
let cell = pagerView.dequeueReusableCell(withReuseIdentifier: "cell", at: index) as! YHServiceBannerCollectionViewCell
guard let cell = pagerView.dequeueReusableCell(withReuseIdentifier: "cell", at: index) as? YHServiceBannerCollectionViewCell else { return FSPagerViewCell() }
if index < dataArr.count {
cell.dataModel = dataArr[index]
}
......
......@@ -135,7 +135,9 @@ extension YHServiceCenterStepThreeTableHeadView: UICollectionViewDelegate, UICol
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHServiceSectionStepThreeCollectionViewCell.cellReuseIdentifier, for: indexPath) as! YHServiceSectionStepThreeCollectionViewCell
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHServiceSectionStepThreeCollectionViewCell.cellReuseIdentifier, for: indexPath) as? YHServiceSectionStepThreeCollectionViewCell else {
return UICollectionViewCell()
}
cell.dataSource = indexPath.row + 1
if indexPath.row == selectIndex {
cell.setSelectedStyle()
......
......@@ -208,7 +208,7 @@ private extension YHServiceOrderGuideTipsView {
@objc func timerFired() {
// 定时器触发时执行的代码
print("Timer fired")
self.maxCount = self.maxCount - 1
self.maxCount -= 1
if self.maxCount < 1 {
self.stopTimer()
self.setButtonEnable(true)
......
......@@ -87,7 +87,7 @@ extension YHServiceSectionView: UICollectionViewDelegate, UICollectionViewDataSo
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHServiceSectionCollectionViewCell.cellReuseIdentifier, for: indexPath) as! YHServiceSectionCollectionViewCell
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHServiceSectionCollectionViewCell.cellReuseIdentifier, for: indexPath) as? YHServiceSectionCollectionViewCell else { return UICollectionViewCell() }
if type == 0 {
cell.dataSource = items[indexPath.row]
} else {
......
......@@ -72,7 +72,7 @@ extension YHServiceTableFootView: UICollectionViewDelegate, UICollectionViewData
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHHomeCollectionViewCell.cellReuseIdentifier, for: indexPath) as! YHHomeCollectionViewCell
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHHomeCollectionViewCell.cellReuseIdentifier, for: indexPath) as? YHHomeCollectionViewCell else { return UICollectionViewCell() }
cell.listModel = items[indexPath.row]
return cell
......
......@@ -456,7 +456,7 @@ extension YHServiceCenterMainViewModel {
if let path = Bundle.main.path(forResource: "scoreOptionData", ofType: "plist") {
if let plistData = FileManager.default.contents(atPath: path) {
do {
let listDictionary = try PropertyListSerialization.propertyList(from: plistData, options: [], format: nil) as! [String: Any]
guard let listDictionary = try PropertyListSerialization.propertyList(from: plistData, options: [], format: nil) as? [String: Any] else { return }
guard let model = YHScoreDataModel.deserialize(from: listDictionary) else {
localScoreData = nil
return
......
......@@ -137,7 +137,7 @@ class YHAdopterNewPeopleViewController: YHBaseViewController {
make.height.equalTo(44)
make.left.equalTo(bottom.saveButton.snp.right).offset(10)
}
self.stepView.currentIndex = self.stepView.currentIndex + 1
self.stepView.currentIndex += 1
self.updateDataSource()
if self.viewModel.mainModel.info.is_read_agreement == 0 && titleText == "新增子女" {
let view = YHAdopterCardOtherGuideView.sheetView()
......
......@@ -165,7 +165,7 @@ class YHAdopterAddNewTableViewCell: UITableViewCell {
make.right.equalTo(-18)
}
}
total = total + 1
total += 1
let itemView = YHAdopterItemView()
itemView.clickBlock = {[weak self] model in
guard let self = self else { return }
......
......@@ -115,7 +115,7 @@ private extension YHAdopterCardOtherGuideView {
@objc func timerFired() {
// 定时器触发时执行的代码
print("Timer fired")
self.maxCount = self.maxCount - 1
self.maxCount -= 1
if self.maxCount < 1 {
self.stopTimer()
self.setButtonEnable(true)
......
......@@ -82,7 +82,7 @@ extension YHAdopterOtherCardTableViewCell: UICollectionViewDelegate, UICollectio
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHAdopterOtherCardCollectionViewCell.cellReuseIdentifier, for: indexPath) as! YHAdopterOtherCardCollectionViewCell
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHAdopterOtherCardCollectionViewCell.cellReuseIdentifier, for: indexPath) as? YHAdopterOtherCardCollectionViewCell else { return UICollectionViewCell() }
cell.url = self.dataSource[indexPath.row]
cell.index = indexPath.row + 1
cell.state = state
......
......@@ -342,7 +342,7 @@ extension YHCertificateAppointViewController: UITableViewDelegate, UITableViewDa
let item = arr[indexPath.row]
if item.type == .goHKMakeCertificate {
// 赴港办证
let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateAppointOptionCell.cellReuseIdentifier, for: indexPath) as! YHCertificateAppointOptionCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateAppointOptionCell.cellReuseIdentifier, for: indexPath) as? YHCertificateAppointOptionCell else { return UITableViewCell() }
var isGoHK: Bool?
if self.isNeedGoHK == 0 {
......
......@@ -140,12 +140,12 @@ extension YHReAppointViewController: UITableViewDelegate, UITableViewDataSource
let item = items[indexPath.row]
if item.type == .warmTips {
// 温馨提示
let cell = tableView.dequeueReusableCell(withIdentifier: YHAppointWarmTipsCell.cellReuseIdentifier, for: indexPath) as! YHAppointWarmTipsCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHAppointWarmTipsCell.cellReuseIdentifier, for: indexPath) as? YHAppointWarmTipsCell else { return UITableViewCell() }
return cell
}
if item.type == .confirmGoHKInfo {
// 请您确认第X批赴港信息
let cell = tableView.dequeueReusableCell(withIdentifier: YHSelectApplicantGroupCell.cellReuseIdentifier, for: indexPath) as! YHSelectApplicantGroupCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHSelectApplicantGroupCell.cellReuseIdentifier, for: indexPath) as? YHSelectApplicantGroupCell else { return UITableViewCell()}
cell.repointMembersNameLabel.text = self.getReAppointMemberNameText()
cell.dataModel = item
cell.refreshBlock = {
......
......@@ -16,7 +16,9 @@ extension Array where Element == YHHKMemberModel {
var results: [YHHKMemberModel] = []
for item in self {
let newItem = item.copy()
results.append(newItem as! YHHKMemberModel)
if let a = newItem as? YHHKMemberModel {
results.append(a)
}
}
return results
}
......
......@@ -291,7 +291,7 @@ extension YHGrabNumberInfoItemView: UICollectionViewDelegate, UICollectionViewDa
// 返回自定义单元格
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHGrabFileCell.cellReuseIdentifier, for: indexPath) as! YHGrabFileCell
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHGrabFileCell.cellReuseIdentifier, for: indexPath) as? YHGrabFileCell else { return UICollectionViewCell() }
if 0 <= indexPath.item && indexPath.item < item.files.count {
let url = item.files[indexPath.item]
if item.publicFiles.count == item.files.count {
......
......@@ -382,7 +382,7 @@ extension YHSelectApplicantGroupCell: UICollectionViewDelegate, UICollectionView
// 返回自定义单元格
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHSelectApplicantCell.cellReuseIdentifier, for: indexPath) as! YHSelectApplicantCell
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHSelectApplicantCell.cellReuseIdentifier, for: indexPath) as? YHSelectApplicantCell else { return UICollectionViewCell() }
if let arr = dataModel?.model?.arr {
if 0 <= indexPath.item && indexPath.item < arr.count {
let applicant = arr[indexPath.item]
......
......@@ -198,7 +198,7 @@ extension YHSelectHKPlaceListView: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHHKPlaceInfoCell.cellReuseIdentifier, for: indexPath) as! YHHKPlaceInfoCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHHKPlaceInfoCell.cellReuseIdentifier, for: indexPath) as? YHHKPlaceInfoCell else { return UITableViewCell() }
if 0 <= indexPath.row && indexPath.row < listArr.count {
let model = listArr[indexPath.row]
......
......@@ -233,7 +233,7 @@ extension YHServiceSelectAlertView: UICollectionViewDelegate, UICollectionViewDa
// 返回自定义单元格
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHServiceItemCell.cellReuseIdentifier, for: indexPath) as! YHServiceItemCell
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHServiceItemCell.cellReuseIdentifier, for: indexPath) as? YHServiceItemCell else { return UICollectionViewCell() }
if 0 <= indexPath.item && indexPath.item < items.count {
let item = items[indexPath.item]
cell.updateItem(item)
......
......@@ -150,7 +150,7 @@ extension YHFamilyInfoConfirmViewController: UITableViewDelegate, UITableViewDat
return warningCell
}
if indexPath.section == 1 {
let approveCell = tableView.dequeueReusableCell(withIdentifier: YHApproverInfoVerifyCell.cellReuseIdentifier, for: indexPath) as! YHApproverInfoVerifyCell
guard let approveCell = tableView.dequeueReusableCell(withIdentifier: YHApproverInfoVerifyCell.cellReuseIdentifier, for: indexPath) as? YHApproverInfoVerifyCell else { return UITableViewCell()}
approveCell.updateFamilyArr(self.familyArr, familyGroup: self.viewModel.familyInfo)
return approveCell
}
......
......@@ -215,7 +215,7 @@ extension YHFamilyInfoUpdateViewController: UITableViewDelegate, UITableViewData
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHIFamilyInfoListCell.cellReuseIdentifier, for: indexPath) as! YHIFamilyInfoListCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHIFamilyInfoListCell.cellReuseIdentifier, for: indexPath) as? YHIFamilyInfoListCell else { return UITableViewCell() }
if indexPath.row == 0 {
// 标题
......
......@@ -114,7 +114,7 @@ extension YHApproverInfoVerifyCell: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFamilyMemberInfoCell.cellReuseIdentifier, for: indexPath) as! YHFamilyMemberInfoCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFamilyMemberInfoCell.cellReuseIdentifier, for: indexPath) as? YHFamilyMemberInfoCell else { return UITableViewCell() }
if 0 <= indexPath.row && indexPath.row < familyArr.count {
let model = familyArr[indexPath.row]
......
......@@ -245,14 +245,15 @@ class YHIFamilyInfoListCell: UITableViewCell {
for subView in self.itemsContentView.subviews {
if subView is YHInfoItemView {
let targetView = subView as! YHInfoItemView
if targetView.item.id == .firstName {
targetView.item.value = self.familyInfo.familyName
targetView.updateItem(targetView.item, familyInfo: self.familyInfo)
}
if targetView.item.id == .lastName {
targetView.item.value = self.familyInfo.givenName
targetView.updateItem(targetView.item, familyInfo: self.familyInfo)
if let targetView = subView as? YHInfoItemView {
if targetView.item.id == .firstName {
targetView.item.value = self.familyInfo.familyName
targetView.updateItem(targetView.item, familyInfo: self.familyInfo)
}
if targetView.item.id == .lastName {
targetView.item.value = self.familyInfo.givenName
targetView.updateItem(targetView.item, familyInfo: self.familyInfo)
}
}
}
}
......
......@@ -99,11 +99,13 @@ extension YHMyTestViewController: UITableViewDelegate, UITableViewDataSource {
if indexPath.section == 3 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHTravelCertificateUploadCell.cellReuseIdentifier, for: indexPath) as! YHTravelCertificateUploadCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHTravelCertificateUploadCell.cellReuseIdentifier, for: indexPath) as? YHTravelCertificateUploadCell else { return UITableViewCell() }
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: YHTravelCertificateTipsCell.cellReuseIdentifier, for: indexPath) as! YHTravelCertificateTipsCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHTravelCertificateTipsCell.cellReuseIdentifier, for: indexPath) as? YHTravelCertificateTipsCell else {
return UITableViewCell()
}
if 0 <= indexPath.section && indexPath.section < sectionItems.count {
let arr = sectionItems[indexPath.section]
......
......@@ -96,7 +96,6 @@ extension YHMyNotifySettingVC: UITableViewDelegate, UITableViewDataSource {
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHMyPermissionCell.cellReuseIdentifier, for: indexPath) as? YHMyPermissionCell else { return UITableViewCell() }
if 0 <= indexPath.row && indexPath.row < items.count {
......
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