Skip to content

Commit

Permalink
fix:bug修复
Browse files Browse the repository at this point in the history
  • Loading branch information
hekang1992 committed Apr 19, 2024
1 parent de800da commit d331d10
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DanaCatatan/Home/HomeOneCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class HomeOneCell: UITableViewCell {
}

@objc func applyClick() {
self.block!()
self.block?()
}

var model: DrawingModel! {
Expand Down
6 changes: 3 additions & 3 deletions DanaCatatan/Home/HomeOneView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import UIKit
import Kingfisher
import GKCycleScrollView

typealias IndexHomeBlock = (_ index: NSInteger) -> Void
typealias IndexHomeBlock = (_ str: String) -> Void
class HomeOneView: UIView,UITableViewDelegate,UITableViewDataSource, GKCycleScrollViewDataSource {

var dataSourceArray = ["ban123","ban124","ban125"]
Expand Down Expand Up @@ -96,7 +96,7 @@ class HomeOneView: UIView,UITableViewDelegate,UITableViewDataSource, GKCycleScro
let imageUrl = URL(string: model?.auctions ?? "")
self.iconImageView.kf.setImage(with: imageUrl, placeholder: UIImage(named: "qweerc"))
cell.block = { [weak self] in
self?.blcok!(indexPath.row)
self?.blcok?(model?.tradition ?? "")
}
return cell
}
Expand Down Expand Up @@ -149,7 +149,7 @@ class HomeOneView: UIView,UITableViewDelegate,UITableViewDataSource, GKCycleScro
}

func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
self.blcok!(indexPath.row)
self.blcok!(String(indexPath.row))
}

func numberOfCells(in cycleScrollView: GKCycleScrollView!) -> Int {
Expand Down
2 changes: 1 addition & 1 deletion DanaCatatan/Home/HomeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class HomeViewController: BaseViewController {
locationInfo()
}
homeOneView.blcok = { [weak self] index in
self?.applyClick(index)
self?.applyClick(Int(index) ?? 0)
}
homeTwoView.block = { [weak self] productID in
self?.applyClick(Int(productID) ?? 0)
Expand Down

0 comments on commit d331d10

Please sign in to comment.