-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merging infinite scrolling and improved CellViewController into main #2
base: main
Are you sure you want to change the base?
Conversation
} | ||
|
||
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { | ||
return 30 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not needed if you create the layout of the cells correctly. they can draw themselves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works if i comment the code out, but it looks better with the function. Did you mean that i should make constraints for the cell instead of using this function?
tmp.text = "Status: " + txt | ||
return tmp | ||
lazy var header: UIView = { | ||
let c = UIView(frame: CGRect(x: 0, y: 0, width: view.frame.size.width, height: 450)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use constraints instead of setting frame
forCellReuseIdentifier: "character") | ||
tableView.delegate = self | ||
tableView.dataSource = self | ||
tableView.separatorStyle = .none |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all the tableView related things should be in the table view lazy initializer
|
||
override func viewDidLayoutSubviews() { | ||
super.viewDidLayoutSubviews() | ||
tableView.frame = view.bounds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for setting frames, use constraints
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
init(person: CharacterModel){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
always put spaces between ")" and "{"
let c = UIImageView()//must have this argument | ||
c.sd_setImage(with: URL(string: self.person.image)) | ||
c.snp.makeConstraints{ | ||
make in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
definition of properties in blocks should go one line above, after "{"
lazy var image: UIImageView = { | ||
let c = UIImageView()//must have this argument | ||
c.sd_setImage(with: URL(string: self.person.image)) | ||
c.snp.makeConstraints{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
space before "{"
No description provided.