Skip to content

YLTableView 2.0 - YLTableViewCell as protocol #10

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

Merged
merged 19 commits into from
Jan 8, 2016

Conversation

Ushhud
Copy link
Contributor

@Ushhud Ushhud commented Dec 9, 2015

Change YLTableViewCell to a protocol from an interface.
Add caching mechanism for estimated heights.
Remove code used for iOS 7.

…iewDataSource can use estimated heights provided by the cells, if the cells conform to the protocol (+ an alternative method to gather the height from a subclasses table view data source).

Add caching mechanism for estimated heights.
env:
- PROJECT=YLTableView.xcodeproj
- BUILD_SCHEME=YLTableView
- TEST_SCHEME=YLTableViewTests
Copy link
Member

Choose a reason for hiding this comment

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

These variables need to be under a global key: https://docs.travis-ci.com/user/environment-variables/#Global-Variables

Otherwise it'll matrix this and split it into 3 separate builds, one for each environment variable.

@SSheldon
Copy link
Member

A travis configuration was added in #11, could you update this branch with master to get the build working?

@interface YLTableViewBaseTestCase : XCTestCase

//! Redeclaring to add the compiler warning if super is missing
-(void)setUp NS_REQUIRES_SUPER;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add this for + (void)setUp and + (void)tearDown

}

-(void)tearDown {
_tableView.delegate = nil;
Copy link
Contributor

Choose a reason for hiding this comment

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

i don't think you need to do this, if the @property references are cleaned up across test runs

… and used constant ints instead, removed unnecessary -tearDown in YLTableViewDataSourceTests.m
#import <XCTest/XCTestCase.h>

//! New tests should subclass from this class as it contains contains all common test methods/properties.
@interface YLTableViewBaseTestCase : XCTestCase
Copy link
Member

Choose a reason for hiding this comment

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

I'd recommend against having a base test case class here. A base test case makes sense in our codebase and the super warnings are pretty convenient, but for a small open-source project that we want people to be able to pick up quickly and contribute to I feel like this just might add confusion. Especially since we only have one test case now, for now I'd say YAGNI (you ain't gonna need it)!

they can override this method.
For more information, see tableView:estimatedHeightForRowAtIndexPath.
*/
return -1;
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's just have this return UITableViewAutomaticDimension and get rid of the branching done in the calling method

@Ushhud Ushhud changed the title Introduce YLTableViewCellEstimatedRowHeight protocol and add caching mechanism YLTableView 2.0 - YLTableViewCell as protocol Jan 6, 2016
@benasher44
Copy link
Contributor

@Ushhud can you set s.ios.deployment_target in the podspec to 8.0? Other than that, this looks good. @bmelts mind giving this a once over?

#import "YLTableViewDataSource.h"

@class YLTableViewCell;
Copy link
Contributor

Choose a reason for hiding this comment

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

this can be replaced with @protocol YLTableViewCell; and thus avoid the extra #import, if you're so inclined

@bmelts
Copy link
Contributor

bmelts commented Jan 8, 2016

A few very, very minor issues, but overall looks good – this is much lighter-weight than the previous version and I'm super excited for that. Fix and ship!

benasher44 added a commit that referenced this pull request Jan 8, 2016
YLTableView 2.0 - YLTableViewCell as protocol
@benasher44 benasher44 merged commit 23ff205 into master Jan 8, 2016
@jawwad jawwad deleted the YLTableViewCellEstimatedRowHeight branch April 12, 2018 21:17
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.

4 participants