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

Add image to table cell #20

Merged
merged 5 commits into from
Nov 30, 2015
Merged

Add image to table cell #20

merged 5 commits into from
Nov 30, 2015

Conversation

rxcai
Copy link

@rxcai rxcai commented Nov 15, 2015

Hey Zeyu,

I am using CZPicker in my application, appreciate it since you make it simple to use. Because I need to present an image for each cell as well, I've added this into your classes ;)

@chenzeyu
Copy link
Owner

@rxcai Thanks! I'll review it shortly.

@@ -308,7 +308,11 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
cell.accessoryType = UITableViewCellAccessoryCheckmark;
}
}
if ([self.dataSource respondsToSelector:@selector(czpickerView:attributedTitleForRow:)]) {
if([self.dataSource respondsToSelector:@selector(czpickerView:titleForRow:)] && [self.dataSource respondsToSelector:@selector(czpickerView:titleForRow:)]){
Copy link
Owner

Choose a reason for hiding this comment

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

Two checks for czpickerView:titleForRow:? you may want to check czpickerView:imageForRow: right?

Copy link
Author

Choose a reason for hiding this comment

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

Because I think that normally there are two situations:

  1. only text
  2. image + text
    it rarely happens only image for each table cell.
    In order to make sure that text and image are all set, I choose to make two checks.
    What's your opinion?

Copy link
Owner

Choose a reason for hiding this comment

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

True, therefore you should check dataSource responds to czpickerView:titleForRow: AND czpickerView:imageForRow: right?

You are actually checking czpickerView:titleForRow: twice.

Copy link
Owner

Choose a reason for hiding this comment

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

Perhaps people should be able to use image + attributedTitle right?

Copy link
Author

Choose a reason for hiding this comment

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

Sorry... it's a type error... I'll correct it and re-push to you, sorry for it.
image + attributedTitle Yes, I'll add it and re-push to you ;)

@rxcai rxcai closed this Nov 20, 2015
@rxcai rxcai reopened this Nov 20, 2015
@chenzeyu
Copy link
Owner

@rxcai the code looks good, before merging your PR, can you please do 3 more things?

1. Make a demo with image in the demo project, like what I did for demo.
2. Bump version number to 0.3.7
3. Update README.md and CHANGELOG.md

Thanks, we need these things to sort out so that people will know how to use the new feature.

@rxcai
Copy link
Author

rxcai commented Nov 26, 2015

I'll do it this weekend ;)

2. Bump version number to 0.3.7
3. Update README.md and CHANGELOG.md
+
make a new .gif to show demo with pictures
@rxcai
Copy link
Author

rxcai commented Nov 29, 2015

Normally I've finished what you required and added a new demon gif with items' pictures ;)

@chenzeyu chenzeyu merged commit 07f2031 into chenzeyu:master Nov 30, 2015
@chenzeyu
Copy link
Owner

Hi @rxcai, your PR has been merged! Thanks for your patch, you're the first contributor of this project :D. Also, if you would like to continuing working on CZPicker, issue 18 would be a good one.

@rxcai
Copy link
Author

rxcai commented Nov 30, 2015

;) I'll keep working on it

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.

2 participants