Skip to content
This repository was archived by the owner on Oct 30, 2018. It is now read-only.

Added correct nullability values for initializers #528

Merged
merged 1 commit into from
Oct 12, 2016
Merged

Added correct nullability values for initializers #528

merged 1 commit into from
Oct 12, 2016

Conversation

clementpadovani
Copy link
Contributor

  • I’ve read and understood the Contributing guidelines and have done my best effort to follow them.
  • I’ve read and agree to the Code of Conduct.
  • I’ve been mindful about doing atomic commits, adding documentation to my changes, not refactoring too much.
  • I’ve a descriptive title and added any useful information for the reviewer. Where appropriate, I've attached a screenshot and/or screencast (gif preferrably).
  • I’ve written tests to cover the new code and functionality included in this PR.
  • I’ve read, agree to, and signed the Contributor License Agreement (CLA).

PR Summary

Based on the documentation, I’ve added nullability qualifiers.

Related Issues

N/A

Test strategy

N/A

Based on the documentation, I’ve added nullability qualifiers.
Copy link

@dzenbot dzenbot left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks!

@dzenbot dzenbot merged commit 28c015e into slackhq:master Oct 12, 2016
@wlisac
Copy link

wlisac commented Dec 14, 2017

@clementpadovani @dzenbot The comment says these initializers may return nil, but looking at the implementation, I don't see why these should be nullable.

- (instancetype)initWithTableViewStyle:(UITableViewStyle)style
{
    NSAssert([self class] != [SLKTextViewController class], @"Oops! You must subclass SLKTextViewController.");
    NSAssert(style == UITableViewStylePlain || style == UITableViewStyleGrouped, @"Oops! You must pass a valid UITableViewStyle.");

    if (self = [super initWithNibName:nil bundle:nil])
    {
        self.scrollViewProxy = [self tableViewWithStyle:style];
        [self slk_commonInit];
    }
    return self;
}

The super designated initializer is not nullable / failable: [super initWithNibName:nil bundle:nil]

Maybe I'm missing something, but it would be nice if we could make these non-failable initializers 🙂

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

Successfully merging this pull request may close these issues.

3 participants