Commit 55e89962 authored by pete谢兆麟's avatar pete谢兆麟

Merge branch 'swiftLint-develop' of...

Merge branch 'swiftLint-develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS into swiftLint-develop
parents 3b3b761e a46e9997
......@@ -153,7 +153,7 @@ extension YHHomeInformationViewController: CollectionViewWaterfallLayoutDelegate
}
var row = self.sectionItems.count/3
if self.sectionItems.count%3 != 0 {
row = row + 1
row += 1
}
let listHeight = Float(Double(row) * kHomeItemHeight)
let totalHeight = listHeight + 4.0 + 0.5 + 65.0
......
......@@ -157,7 +157,7 @@ extension YHInvatationShareViewController {
guard let combinedImage = combinedImageFrom(imageView: cell.centerImageView) else { return }
saveImageToPhotosAlbum(image: combinedImage)
} else {
let cell = myCollectView.cellForItem(at: IndexPath(row: currentPage, section: 0)) as! YHShareTwoCollectionViewCell
guard let cell = myCollectView.cellForItem(at: IndexPath(row: currentPage, section: 0)) as? YHShareTwoCollectionViewCell else { return }
guard let combinedImage = combinedImageFrom(imageView: cell.centerImageView) else { return }
saveImageToPhotosAlbum(image: combinedImage)
}
......
......@@ -124,7 +124,6 @@ class YHInvitationWithGiftsSecondTableViewCell: UITableViewCell {
make.right.equalTo(-15)
make.height.equalTo(20)
}
titleImageView = {
let view = UIImageView()
view.image = UIImage(named: "invitation_with_gifts_second_title")
......@@ -137,7 +136,6 @@ class YHInvitationWithGiftsSecondTableViewCell: UITableViewCell {
make.centerX.equalToSuperview()
make.height.equalTo(20)
}
timeLabel = {
let view = UILabel()
view.text = "您的推荐周期:2023-11-20 至2024-11-19"
......
......@@ -429,13 +429,14 @@ class YHInvitationWithGiftsSelectItemCell: UITableViewCell {
}
guard let data = dataSource else { return }
for i in 0..<data.count {
let button = centerView.viewWithTag(1000+i) as! UIButton
if sender.tag == 1000 + i {
button.isSelected = true
button.layer.borderWidth = 1
} else {
button.isSelected = false
button.layer.borderWidth = 0
if let button = centerView.viewWithTag(1000+i) as? UIButton {
if sender.tag == 1000 + i {
button.isSelected = true
button.layer.borderWidth = 1
} else {
button.isSelected = false
button.layer.borderWidth = 0
}
}
}
selectIndex = sender.tag - 1000
......
......@@ -296,7 +296,9 @@ extension YHLifeViewController: UICollectionViewDelegate, UICollectionViewDataSo
func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {
if kind == UICollectionView.elementKindSectionFooter {
let footerView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: YHlifeCollectionReusableView.reuseIdentifier, for: indexPath) as! YHlifeCollectionReusableView
guard let footerView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: YHlifeCollectionReusableView.reuseIdentifier, for: indexPath) as? YHlifeCollectionReusableView else {
return YHlifeCollectionReusableView()
}
// 配置 footerView
footerView.dataSource = self.viewModel.schedulLiveArr
return footerView
......
......@@ -268,7 +268,7 @@ extension YHHomeCollectionViewCell {
guard let self = self else { return }
if success {
listModel.is_like = false
listModel.like_count = listModel.like_count - 1
listModel.like_count -= 1
self.updataSubViews()
}
}
......
......@@ -109,7 +109,7 @@ extension YHHomeInfoSectionHeadView: UICollectionViewDelegate, UICollectionViewD
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHHomeInfoSectionCell.cellReuseIdentifier, for: indexPath) as! YHHomeInfoSectionCell
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHHomeInfoSectionCell.cellReuseIdentifier, for: indexPath) as? YHHomeInfoSectionCell else { return UICollectionViewCell() }
if 0 <= indexPath.row, indexPath.row < self.items.count {
if let item = self.items[indexPath.row] {
cell.updateModel(item)
......
......@@ -288,7 +288,7 @@ extension YHHomePageViewModel {
self.totalCount = result.total
self.arrHomeNewsData = result.data
} else {
self.curPageIndex = self.curPageIndex + 1
self.curPageIndex += 1
self.arrHomeNewsData?.append(contentsOf: result.data)
}
......
......@@ -126,12 +126,10 @@ extension YHServiceOrderProgressTableViewCell {
titleLabel.text = "赴港办证预约"
messageLabel.text = "请填写意向办证时间,银河代预约~"
}
if model.type == 23 {
titleLabel.text = "电子签证缴费"
messageLabel.text = "请根据指引缴费领取电子签证~"
}
if model.type == 25 {
titleLabel.text = "赴港行程指引"
messageLabel.text = "请根据指引清单提前规划赴港行程"
......
......@@ -288,13 +288,13 @@ extension YHAdopterNewPeopleViewController: UITableViewDelegate, UITableViewData
if isShow && message.count == 0 && isNeed {
h = h + 72 + 20
} else {
h = h + 72
h += 72
}
} else {
if isShow && message.count == 0 && isNeed {
h = h + 52 + 20
h += (52 + 20)
} else {
h = h + 52
h += 52
}
}
}
......
......@@ -191,7 +191,7 @@ class YHAdopterAddNewTableViewCell: UITableViewCell {
make.height.equalTo(51)
make.right.equalTo(-18)
}
total = total + 51
total += 51
}
}
......
......@@ -382,7 +382,9 @@ extension YHCertificateAppointViewController: UITableViewDelegate, UITableViewDa
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
}
......
......@@ -242,9 +242,9 @@ extension YHReAppointViewController {
return $0.isSelected == true
}
let users = self.waitAppointMembers.map {
let dict = ["id": $0.id,
"type": $0.type,
"name": $0.name] as! [String: Any]
guard let dict = ["id": $0.id,
"type": $0.type,
"name": $0.name] as? [String: Any] else { return [:]}
return dict
}
......
......@@ -155,7 +155,9 @@ extension YHFamilyInfoConfirmViewController: UITableViewDelegate, UITableViewDat
return approveCell
}
if indexPath.section == 2 {
let certificateInfoCell = tableView.dequeueReusableCell(withIdentifier: YHCertificateInfoPhotoCell.cellReuseIdentifier, for: indexPath) as! YHCertificateInfoPhotoCell
guard let certificateInfoCell = tableView.dequeueReusableCell(withIdentifier: YHCertificateInfoPhotoCell.cellReuseIdentifier, for: indexPath) as? YHCertificateInfoPhotoCell else {
return UITableViewCell()
}
return certificateInfoCell
}
}
......
......@@ -391,7 +391,7 @@ extension YHTravelDocsPreparationDetailVC: UITableViewDelegate, UITableViewDataS
let item = sectionItems[indexPath.section]
if item.type == .tips {
if indexPath.section == 0 {
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() }
cell.userName = self.dataModel.name
cell.tipsArr = item.tipsArr
return cell
......
......@@ -106,7 +106,9 @@ extension YHTravelDocsPreparationListViewController: UITableViewDelegate, UITabl
return approveCell
} else if viewModel.arrTravelDocs.count > 0, indexPath.section < viewModel.arrTravelDocs.count {
let approveCell = tableView.dequeueReusableCell(withIdentifier: YHTravelDocsPreparationListCell.cellReuseIdentifier, for: indexPath) as! YHTravelDocsPreparationListCell
guard let approveCell = tableView.dequeueReusableCell(withIdentifier: YHTravelDocsPreparationListCell.cellReuseIdentifier, for: indexPath) as? YHTravelDocsPreparationListCell else {
return UITableViewCell()
}
approveCell.dataModel = viewModel.arrTravelDocs[indexPath.section]
return approveCell
}
......
......@@ -146,7 +146,9 @@ extension YHUploadCertificateVC: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.row == 0 {
let warningCell = tableView.dequeueReusableCell(withIdentifier: YHUploadCertificateTitleCell.cellReuseIdentifier, for: indexPath) as! YHUploadCertificateTitleCell
guard let warningCell = tableView.dequeueReusableCell(withIdentifier: YHUploadCertificateTitleCell.cellReuseIdentifier, for: indexPath) as? YHUploadCertificateTitleCell else {
return UITableViewCell()
}
var title = ""
if indexPath.section == 0 {
......
......@@ -368,7 +368,9 @@ extension YHOfficialApprovalResultVC: FSPagerViewDataSource, FSPagerViewDelegate
}
public func pagerView(_ pagerView: FSPagerView, cellForItemAt index: Int) -> FSPagerViewCell {
let cell = pagerView.dequeueReusableCell(withReuseIdentifier: YHOfficailLetterColledtionCell.cellReuseIdentifier, at: index) as! YHOfficailLetterColledtionCell
guard let cell = pagerView.dequeueReusableCell(withReuseIdentifier: YHOfficailLetterColledtionCell.cellReuseIdentifier, at: index) as? YHOfficailLetterColledtionCell else {
return FSPagerViewCell()
}
if index < dataArr.count {
cell.dataModel = dataArr[index]
}
......
......@@ -134,7 +134,7 @@ private extension YHOffivialApprovalGuildLineCheckView {
@objc func timerFired() {
// 定时器触发时执行的代码
print("Timer fired")
self.maxCount = self.maxCount - 1
self.maxCount -= 1
if self.maxCount < 1 {
self.stopTimer()
self.setButtonEnable(true)
......
......@@ -79,7 +79,7 @@ class YHOffivialApprovalSuccessView: UIView {
make.height.equalTo(1)
}
h = h + 26 + 10
index = index + 1
index += 1
arrViews.append(label)
arrViews.append(line)
......
......@@ -125,7 +125,9 @@ extension YHPrincipleApprovedMailViewController: UITableViewDelegate, UITableVie
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if 0 <= indexPath.row && indexPath.row < items.count {
let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleProfileListCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleProfileListCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleProfileListCell.cellReuseIdentifier, for: indexPath) as? YHPrincipleProfileListCell else {
return UITableViewCell()
}
let m = items[indexPath.row]
if m is YHPrincipleWaitResultModel {
let model = m as! YHPrincipleWaitResultModel
......
......@@ -115,7 +115,9 @@ extension YHPrincipleApprovedWaitSubmitVC: UITableViewDelegate, UITableViewDataS
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleEnvelopeCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleEnvelopeCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleEnvelopeCell.cellReuseIdentifier, for: indexPath) as? YHPrincipleEnvelopeCell else {
return UITableViewCell()
}
if 0 <= indexPath.row && indexPath.row < items.count {
let model = items[indexPath.row]
cell.updateModel(model)
......
......@@ -346,7 +346,9 @@ extension YHPrincipleUploadListVC: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "UITableViewCell", for: indexPath) as! UITableViewCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: "UITableViewCell", for: indexPath) as? UITableViewCell else {
return UITableViewCell()
}
if 0 <= indexPath.row && indexPath.row < items.count {
let m = items[indexPath.row]
......
......@@ -253,7 +253,9 @@ extension YHPrinciplePhotoListCell: UICollectionViewDelegateFlowLayout, UICollec
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHPrinciplePhotoCollectCell.cellReuseIdentifier, for: indexPath) as! YHPrinciplePhotoCollectCell
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHPrinciplePhotoCollectCell.cellReuseIdentifier, for: indexPath) as? YHPrinciplePhotoCollectCell else {
return UICollectionViewCell()
}
cell.isSinglePhoto = items.count == 1
if 0 <= indexPath.item, indexPath.item < items.count {
let model = items[indexPath.item]
......
......@@ -213,7 +213,7 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
self.statusLabel.textColor = self.getUploadTitleColor(status: model.check_status)
self.statusLabel.backgroundColor = self.getUploadBgColor(status: model.check_status)
let status: ASAttributedString = " \(.view(self.statusLabel, .original(.center)))"
titleStr = titleStr + status
titleStr += status
}
titleLabel.attributed.text = titleStr
......
......@@ -298,7 +298,9 @@ extension YHMyFileListViewController: UITableViewDelegate, UITableViewDataSource
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let noneCell = tableView.dequeueReusableCell(withIdentifier: YHMyFileListNoneCell.cellReuseIdentifier, for: indexPath) as! YHMyFileListNoneCell
guard let noneCell = tableView.dequeueReusableCell(withIdentifier: YHMyFileListNoneCell.cellReuseIdentifier, for: indexPath) as? YHMyFileListNoneCell else {
return UITableViewCell()
}
if 0 <= indexPath.section && indexPath.section < items.count {
let model = items[indexPath.section]
if model.supplement_list.count > 0 {
......
......@@ -73,11 +73,15 @@ extension YHFileListContentView {
if let iii = item {
var view: UIView = YHFileListItemsView()
if iii.type == 0 {
(view as! YHFileListItemsView).dataModel = item
if let view = view as? YHFileListItemsView {
view.dataModel = item
}
} else {
// if item?.type == 1
view = YHFileListItemsView2()
(view as! YHFileListItemsView2).dataModel = item
if let view = view as? YHFileListItemsView2 {
view.dataModel = item
}
}
addSubview(view)
......
......@@ -108,8 +108,9 @@ class YHSegmentView: UIView {
self.selectIndex = index
for subView in self.subviews {
if subView is YHSegmentItemView {
let subItemView = subView as! YHSegmentItemView
subItemView.isSelect = subItemView.tag == index+self.itemBaseTag
if let subItemView = subView as? YHSegmentItemView {
subItemView.isSelect = subItemView.tag == index+self.itemBaseTag
}
}
}
}
......
......@@ -80,7 +80,7 @@ extension YHCertificateListVC: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateInfoCell.cellReuseIdentifier, for: indexPath) as! YHCertificateInfoCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateInfoCell.cellReuseIdentifier, for: indexPath) as? YHCertificateInfoCell else { return UITableViewCell() }
if 0 <= indexPath.section && indexPath.section < items.count {
let item = items[indexPath.section]
......
......@@ -114,7 +114,7 @@ extension YHCertificateSearchViewController: UITableViewDelegate, UITableViewDat
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateInfoCell.cellReuseIdentifier, for: indexPath) as! YHCertificateInfoCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateInfoCell.cellReuseIdentifier, for: indexPath) as? YHCertificateInfoCell else { return UITableViewCell() }
if 0 <= indexPath.section && indexPath.section < items.count {
let item = items[indexPath.section]
......
......@@ -228,7 +228,7 @@ extension YHCertificateUploadContentListVC: UITableViewDelegate, UITableViewData
if indexPath.section == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateTemplateCell.cellReuseIdentifier, for: indexPath) as! YHCertificateTemplateCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateTemplateCell.cellReuseIdentifier, for: indexPath) as? YHCertificateTemplateCell else { return UITableViewCell() }
cell.update(bottomMargin: 15)
if 0 <= indexPath.row && indexPath.row < templateArr.count {
cell.templatePath = templateArr[indexPath.row]
......
......@@ -89,9 +89,9 @@ private extension YHCertificateEntryHeadView {
} else {
tmp = dataModel.user_name
if dataModel.sex == 1 {
tmp = tmp + "先生"
tmp += "先生"
} else if dataModel.sex == 2 {
tmp = tmp + "女士"
tmp += "女士"
} else {
}
......
......@@ -335,7 +335,9 @@ extension YHCertificateFilterView: UICollectionViewDataSource, UICollectionViewD
func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {
if kind == UICollectionView.elementKindSectionHeader {
let headerView: YHCertificateFilterTypeView = collectionView.dequeueReusableSupplementaryView(ofKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: YHCertificateFilterTypeView.reuseIdentifier, for: indexPath) as! YHCertificateFilterTypeView
guard let headerView: YHCertificateFilterTypeView = collectionView.dequeueReusableSupplementaryView(ofKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: YHCertificateFilterTypeView.reuseIdentifier, for: indexPath) as? YHCertificateFilterTypeView else {
return YHCertificateFilterTypeView()
}
if 0 <= indexPath.section && indexPath.section < items.count {
let sectionInfo = items[indexPath.section]
......
......@@ -222,7 +222,9 @@ extension YHCertificateTemplateSheetView: UITableViewDelegate, UITableViewDataSo
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateTemplateCell.cellReuseIdentifier, for: indexPath) as! YHCertificateTemplateCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateTemplateCell.cellReuseIdentifier, for: indexPath) as? YHCertificateTemplateCell else {
return UITableViewCell()
}
cell.update(bottomMargin: 20)
if 0 <= indexPath.row && indexPath.row < templateArr.count {
cell.templatePath = templateArr[indexPath.row]
......
......@@ -305,7 +305,9 @@ extension YHCertificateUploadSheetView: UITableViewDelegate, UITableViewDataSour
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateUploadTypeCell.cellReuseIdentifier, for: indexPath) as! YHCertificateUploadTypeCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateUploadTypeCell.cellReuseIdentifier, for: indexPath) as? YHCertificateUploadTypeCell else {
return UITableViewCell()
}
if 0 <= indexPath.row && indexPath.row < uploadTypeArr.count {
cell.item = uploadTypeArr[indexPath.row]
}
......
......@@ -149,7 +149,7 @@ class YHDocumentUploadTableViewCell: UITableViewCell {
make.height.equalTo(1)
make.right.equalTo(-18)
}
y = y + 1
y += 1
let data = dataSource.writing_document.doc_sign.doc_return_manual[i]
let h = 70
let itemView = YHDocumentFileItemView()
......
......@@ -247,7 +247,9 @@ extension YHDocumentUploadView: UITableViewDelegate, UITableViewDataSource {
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateUploadTypeCell.cellReuseIdentifier, for: indexPath) as! YHCertificateUploadTypeCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateUploadTypeCell.cellReuseIdentifier, for: indexPath) as? YHCertificateUploadTypeCell else {
return UITableViewCell()
}
if 0 <= indexPath.row && indexPath.row < uploadTypeArr.count {
cell.item = uploadTypeArr[indexPath.row]
}
......
......@@ -351,9 +351,9 @@ private extension YHHKPlanItemView {
if scalar.value >= 0x4E00 && scalar.value <= 0x9FFF {
// 中文字符的Unicode范围
if isPreDone == false {
totalNumber = totalNumber + 1
totalNumber += 1
}
totalNumber = totalNumber + 1
totalNumber += 1
isPreDone = true
} else if scalar.isASCII && (scalar >= "a" && scalar <= "z" || scalar >= "A" && scalar <= "Z") {
......@@ -367,7 +367,7 @@ private extension YHHKPlanItemView {
} else {
if isPreDone == false {
totalNumber = totalNumber + 1
totalNumber += 1
} else {
}
......@@ -376,7 +376,7 @@ private extension YHHKPlanItemView {
if index == stringLength - 1 {
if isPreDone == false {
totalNumber = totalNumber + 1
totalNumber += 1
}
}
}
......
......@@ -166,9 +166,9 @@ extension YHMyDocListHeaderView {
} else {
var tmp = "您好," + model.username
if model.sex == 1 {
tmp = tmp + "先生"
tmp += "先生"
} else if model.sex == 2 {
tmp = tmp + "女士"
tmp += "女士"
}
titleLable.text = tmp
}
......
......@@ -290,7 +290,9 @@ extension YHImproveSchemeViewController: UITableViewDelegate, UITableViewDataSou
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.row == 1 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHIHKIdentityPlanCell.cellReuseIdentifier, for: indexPath) as! YHIHKIdentityPlanCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHIHKIdentityPlanCell.cellReuseIdentifier, for: indexPath) as? YHIHKIdentityPlanCell else {
return UITableViewCell()
}
return cell
}
......
......@@ -419,7 +419,9 @@ extension YHMyNewSchemeViewController: UITableViewDelegate, UITableViewDataSourc
let item = arr[indexPath.row]
if item.type == .evaluate {
let cell = tableView.dequeueReusableCell(withIdentifier: YHComprehensiveEvaluationCell.cellReuseIdentifier, for: indexPath) as! YHComprehensiveEvaluationCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHComprehensiveEvaluationCell.cellReuseIdentifier, for: indexPath) as? YHComprehensiveEvaluationCell else {
return UITableViewCell()
}
cell.tipsType = self.tipsType
targetCell = cell
}
......
......@@ -157,7 +157,9 @@ extension YHImproveSchemeTemplateListView: UITableViewDelegate, UITableViewDataS
if 0 <= indexPath.row && indexPath.row < items.count {
let item = items[indexPath.row]
let cell = tableView.dequeueReusableCell(withIdentifier: YHImproveSchemeTemplateListCell.cellReuseIdentifier, for: indexPath) as! YHImproveSchemeTemplateListCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHImproveSchemeTemplateListCell.cellReuseIdentifier, for: indexPath) as? YHImproveSchemeTemplateListCell else {
return UITableViewCell()
}
cell.titleLabel.text = "\(indexPath.row+1)\(item.name)"
cell.model = item
cell.clickBlock = {
......
......@@ -150,7 +150,7 @@ class YHSignatureUploadTableViewCell: UITableViewCell {
make.height.equalTo(1)
make.right.equalTo(-18)
}
y = y + 1
y += 1
let data = dataSource.doc_return_manual[i]
let h = 70
let itemView = YHDocumentFileItemView()
......
......@@ -212,7 +212,9 @@ extension YHLookResignResultViewController: UITableViewDelegate, UITableViewData
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if state == 0 {
let approveCell = tableView.dequeueReusableCell(withIdentifier: YHLookResignResultStateOneTableViewCell.cellReuseIdentifier, for: indexPath) as! YHLookResignResultStateOneTableViewCell
guard let approveCell = tableView.dequeueReusableCell(withIdentifier: YHLookResignResultStateOneTableViewCell.cellReuseIdentifier, for: indexPath) as? YHLookResignResultStateOneTableViewCell else {
return UITableViewCell()
}
approveCell.title = "第" + convertNumberToChineseText(self.viewModel.dataModel.data.data[indexPath.section].number) + "批"
approveCell.dataSource = self.viewModel.dataModel.data.data[indexPath.section]
return approveCell
......
......@@ -135,7 +135,7 @@ private extension YHLookResignGuideLineView {
@objc func timerFired() {
// 定时器触发时执行的代码
print("Timer fired")
self.maxCount = self.maxCount - 1
self.maxCount -= 1
if self.maxCount < 1 {
self.stopTimer()
self.setButtonEnable(true)
......
......@@ -176,7 +176,7 @@ class YHLookResignResultStateOneTableViewCell: UITableViewCell {
var i = 0
for item in dataSource.users {
if i == 0 {
names = names + item
names += item
} else {
names = names + "、" + item
}
......
......@@ -168,7 +168,7 @@ class YHLookResignResultStateThreePeopleTableViewCell: UITableViewCell {
var i = 0
for item in dataSource.users {
if i == 0 {
names = names + item
names += item
} else {
names = names + "、" + item
}
......
......@@ -131,7 +131,7 @@ class YHLookResignResultStateThreeTableViewCell: UITableViewCell {
make.width.equalTo(140.fix)
make.height.equalTo(101)
}
count = count + 1
count += 1
}
}
}
......
......@@ -136,7 +136,7 @@ class YHLookResignResultStateTwoTableViewCell: UITableViewCell {
make.width.equalTo(140.fix)
make.height.equalTo(101)
}
count = count + 1
count += 1
}
}
}
......
......@@ -267,7 +267,9 @@ extension YHResignCertificateDetailHkViewController: UITableViewDelegate, UITabl
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section == 0 {
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()
}
cell.userName = self.dataModel.name
cell.tipsArr = tipsArr
return cell
......
......@@ -246,7 +246,9 @@ extension YHResignCertificateDetailPassPortViewController: UITableViewDelegate,
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section == 0 {
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()
}
cell.userName = self.dataModel.name
cell.tipsArr = tipsArr
return cell
......
......@@ -262,7 +262,6 @@ class YHResignCertificateHKTableViewCell: UITableViewCell {
view.layer.cornerRadius = kCornerRadius6
return view
}()
contentView.addSubview(centerView)
centerView.snp.makeConstraints { make in
make.left.equalTo(16)
......@@ -270,7 +269,6 @@ class YHResignCertificateHKTableViewCell: UITableViewCell {
make.top.equalTo(0)
make.bottom.equalTo(0)
}
titleLabel = {
let label = UILabel()
// label.font = UIFont.PFSC_M(ofSize: 17)
......@@ -292,7 +290,6 @@ class YHResignCertificateHKTableViewCell: UITableViewCell {
make.top.equalTo(16)
make.height.equalTo(20)
}
exampleButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.08)
......
......@@ -93,7 +93,7 @@ class YHResignCertificateListTableViewCell: UITableViewCell {
make.height.equalTo(0.5)
make.right.equalTo(-18)
}
total = total + 1
total += 1
let itemView = YHResignCertificateView()
itemView.index = index
itemView.clickBlock = {[weak self] model in
......
......@@ -280,9 +280,11 @@ class YHResignAppointScheduleListViewController: YHBaseViewController {
if status != .haveConfirmHK { // 非已确认在港
// 先讲所有需分批用户设置为未选择状态
let users = lastLeftUnselectUsers.map {
let m = $0.copy() as! YHResignAppointMember
m.isSelected = false
return m
if let m = $0.copy() as? YHResignAppointMember {
m.isSelected = false
return m
}
return YHResignAppointMember()
}
// group.user_list 表示当前批已选用户组 更新已选择状态
......
......@@ -151,7 +151,9 @@ extension YHResignAppointTimeModifyViewController: UITableViewDelegate, UITableV
return cell1
}
// 可编辑是否一起递交
let cell = tableView.dequeueReusableCell(withIdentifier: YHResignAppointOptionCell.cellReuseIdentifier, for: indexPath) as! YHResignAppointOptionCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHResignAppointOptionCell.cellReuseIdentifier, for: indexPath) as? YHResignAppointOptionCell else {
return UITableViewCell()
}
cell.isSelectTogether = self.isTogether
cell.selectBlock = {
[weak self] index in
......
......@@ -231,13 +231,14 @@ class YHResignAppointTimeViewController: YHBaseViewController {
} else { // 如果操作的当前批次不是最后一批 需要更新后面几批的选中状态
let nextGroupIndex = groupLevel+1
let newMember = currentMember.copy() as! YHResignAppointMember
newMember.isSelected = true
if 0 <= groupLevel, groupLevel < selectGroupArr.count {
let item = selectGroupArr[nextGroupIndex]
var members = item.users
members.append(newMember)
item.users = members
if let newMember = currentMember.copy() as? YHResignAppointMember {
newMember.isSelected = true
if 0 <= groupLevel, groupLevel < selectGroupArr.count {
let item = selectGroupArr[nextGroupIndex]
var members = item.users
members.append(newMember)
item.users = members
}
}
}
} else { // 如果操作是选中
......
......@@ -157,8 +157,9 @@ extension Array where Element == YHResignAppointUser {
func deepCopy() -> [YHResignAppointUser] {
var results: [YHResignAppointUser] = []
for item in self {
let newItem = item.copy()
results.append(newItem as! YHResignAppointUser)
if let newItem = item.copy() as? YHResignAppointUser {
results.append(newItem)
}
}
return results
}
......
......@@ -15,8 +15,9 @@ extension Array where Element == YHResignAppointMember {
func deepCopy() -> [YHResignAppointMember] {
var results: [YHResignAppointMember] = []
for item in self {
let newItem = item.copy()
results.append(newItem as! YHResignAppointMember)
if let newItem = item.copy() as? YHResignAppointMember {
results.append(newItem)
}
}
return results
}
......
......@@ -179,7 +179,9 @@ extension YHRangeDatePickerView2 {
}
func calendar(_ calendar: FSCalendar, cellFor date: Date, at monthPosition: FSCalendarMonthPosition) -> FSCalendarCell {
let cell: YHRangeDatePickerCell2 = calendar.dequeueReusableCell(withIdentifier: YHRangeDatePickerCell2.cellReuseIdentifier, for: date, at: monthPosition) as! YHRangeDatePickerCell2
guard let cell: YHRangeDatePickerCell2 = calendar.dequeueReusableCell(withIdentifier: YHRangeDatePickerCell2.cellReuseIdentifier, for: date, at: monthPosition) as? YHRangeDatePickerCell2 else {
return FSCalendarCell()
}
return cell
}
......
......@@ -135,7 +135,7 @@ private extension YHResignAppointGuideLineView {
@objc func timerFired() {
// 定时器触发时执行的代码
print("Timer fired")
self.maxCount = self.maxCount - 1
self.maxCount -= 1
if self.maxCount < 1 {
self.stopTimer()
self.setButtonEnable(true)
......
......@@ -439,7 +439,9 @@ extension YHResignAppointTimeMultipleCell: UICollectionViewDelegate, UICollectio
// 返回自定义单元格
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHResignSelectApplicantCollectCell.cellReuseIdentifier, for: indexPath) as! YHResignSelectApplicantCollectCell
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHResignSelectApplicantCollectCell.cellReuseIdentifier, for: indexPath) as? YHResignSelectApplicantCollectCell else {
return UICollectionViewCell()
}
if 0 <= indexPath.item && indexPath.item < arr.count {
let applicant = arr[indexPath.item]
cell.updateApplicantInfo(applicant)
......
......@@ -134,7 +134,9 @@ extension YHResignAppointedScheduleLineView: UICollectionViewDelegate, UICollect
// 返回自定义单元格
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHResignScheduleLineCollectCell.cellReuseIdentifier, for: indexPath) as! YHResignScheduleLineCollectCell
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHResignScheduleLineCollectCell.cellReuseIdentifier, for: indexPath) as? YHResignScheduleLineCollectCell else {
return UICollectionViewCell()
}
if 0 <= indexPath.item && indexPath.item < steps.count {
let model = steps[indexPath.item]
model.index = indexPath.item+1
......
......@@ -148,7 +148,9 @@ extension YHResignConfirmInfoListViewController: UITableViewDelegate, UITableVie
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHResignFamilyMemberInfoCell.cellReuseIdentifier, for: indexPath) as! YHResignFamilyMemberInfoCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHResignFamilyMemberInfoCell.cellReuseIdentifier, for: indexPath) as? YHResignFamilyMemberInfoCell else {
return UITableViewCell()
}
if 0 <= indexPath.row && indexPath.row < familyArr.count {
let model = familyArr[indexPath.row]
......
......@@ -202,7 +202,9 @@ extension YHResignInfoConfirmModifyViewController: UITableViewDelegate, UITableV
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHResignFamilyInfoListCell.cellReuseIdentifier, for: indexPath) as! YHResignFamilyInfoListCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHResignFamilyInfoListCell.cellReuseIdentifier, for: indexPath) as? YHResignFamilyInfoListCell else {
return UITableViewCell()
}
cell.familyInfo = self.detailMember
if indexPath.row == 0 {
......
......@@ -91,7 +91,7 @@ extension YHResignMaterialListVC: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHResignMaterialCell.cellReuseIdentifier, for: indexPath) as! YHResignMaterialCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHResignMaterialCell.cellReuseIdentifier, for: indexPath) as? YHResignMaterialCell else { return UITableViewCell() }
if 0 <= indexPath.section && indexPath.section < items.count {
let list = items[indexPath.section]
......
......@@ -218,7 +218,7 @@ extension YHResignMaterialUploadVC: UITableViewDelegate, UITableViewDataSource {
if indexPath.section == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateTemplateCell.cellReuseIdentifier, for: indexPath) as! YHCertificateTemplateCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateTemplateCell.cellReuseIdentifier, for: indexPath) as? YHCertificateTemplateCell else { return UITableViewCell() }
cell.update(bottomMargin: 15)
if 0 <= indexPath.row && indexPath.row < templateArr.count {
cell.templateModel = templateArr[indexPath.row]
......
......@@ -203,7 +203,7 @@ extension YHResignTemplateSheetView: UITableViewDelegate, UITableViewDataSource
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateTemplateCell.cellReuseIdentifier, for: indexPath) as! YHCertificateTemplateCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateTemplateCell.cellReuseIdentifier, for: indexPath) as? YHCertificateTemplateCell else { return UITableViewCell() }
cell.update(bottomMargin: 14)
if 0 <= indexPath.row && indexPath.row < templateArr.count {
cell.templateModel = templateArr[indexPath.row]
......
......@@ -209,12 +209,12 @@ class YHResignMaterialViewModel: YHBaseViewModel {
func updateMaterials(material: YHMaterialModel, addInfoArr: [YHMaterialModelItemModel], callback: ((_ success: Bool, _ error: YHErrorModel?) -> Void)?) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.ResignMaterial.uploadMaterials
var params = [
guard var params = [
"material_id": "\(material.id)",
"template_id": "\(material.template_id)",
"status": material.status,
"audit_remark": material.audit_remark
] as! [String: Any]
] as? [String: Any] else { return }
var info: [[String: Any]] = []
......
......@@ -254,7 +254,7 @@ extension YHResignUploadDocDetailViewController: UITableViewDelegate, UITableVie
if indexPath.section == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateTemplateCell.cellReuseIdentifier, for: indexPath) as! YHCertificateTemplateCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateTemplateCell.cellReuseIdentifier, for: indexPath) as? YHCertificateTemplateCell else { return UITableViewCell() }
cell.update(bottomMargin: 15)
if 0 <= indexPath.row && indexPath.row < templateArr.count {
cell.resignUploadDetailTemplateListModel = templateArr[indexPath.row]
......
......@@ -206,7 +206,7 @@ extension YHResignUploadDocListViewController: UITableViewDelegate, UITableViewD
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if self.viewModel.mainModel.supplement_voucher_url.count == 0 {
let approveCell = tableView.dequeueReusableCell(withIdentifier: YHResignUploadDocListCell.cellReuseIdentifier, for: indexPath) as! YHResignUploadDocListCell
guard let approveCell = tableView.dequeueReusableCell(withIdentifier: YHResignUploadDocListCell.cellReuseIdentifier, for: indexPath) as? YHResignUploadDocListCell else { return UITableViewCell() }
approveCell.section = indexPath.section
if indexPath.section == 0 {
approveCell.title = "资料上传"
......
......@@ -126,7 +126,7 @@ class YHResignUploadDocListCell: UITableViewCell {
make.right.equalTo(-18)
}
}
total = total + 1
total += 1
let itemView = YHResignUploadDocItemView()
itemView.clickBlock = {[weak self] model in
guard let self = self else { return }
......@@ -148,7 +148,7 @@ class YHResignUploadDocListCell: UITableViewCell {
make.height.equalTo(height + 31)
make.right.equalTo(-18)
}
total = total + Int(height + 31)
total += Int(height + 31)
}
}
......
......@@ -157,7 +157,9 @@ extension YHResignUploadTravelCardListViewController: UITableViewDelegate, UITab
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let approveCell = tableView.dequeueReusableCell(withIdentifier: YHResignUploadTravelCardListTableViewCell.cellReuseIdentifier, for: indexPath) as! YHResignUploadTravelCardListTableViewCell
guard let approveCell = tableView.dequeueReusableCell(withIdentifier: YHResignUploadTravelCardListTableViewCell.cellReuseIdentifier, for: indexPath) as? YHResignUploadTravelCardListTableViewCell else {
return UITableViewCell()
}
approveCell.dataModel = viewModel.arrTravelDocs.list[indexPath.section]
return approveCell
}
......
......@@ -237,13 +237,13 @@ extension YHResignUploadTravelHKViewController: UITableViewDelegate, UITableView
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section == 0 {
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() }
cell.userName = self.dataModel.name
cell.tipsArr = tipsArr
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: YHResignUploadTravelHKTableViewCell.cellReuseIdentifier, for: indexPath) as! YHResignUploadTravelHKTableViewCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHResignUploadTravelHKTableViewCell.cellReuseIdentifier, for: indexPath) as? YHResignUploadTravelHKTableViewCell else { return UITableViewCell() }
cell.firstImageName = "service_adopter_card_travel_front"
cell.lastImageName = "service_adopter_card_travel_back"
cell.firstLabelName = "港澳通行证正面"
......
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