Skip to content
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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

NikolaBlagoevski
Copy link
Collaborator

No description provided.

@NikolaBlagoevski
Copy link
Collaborator Author

}

func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 30

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.

Copy link
Collaborator Author

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))

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

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

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){

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

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{

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space before "{"

@NikolaBlagoevski
Copy link
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants