uias / Pageboy

📖 A simple, highly informative page view controller
MIT License
1.99k stars 154 forks source link

Add default value ( nil ) for Pageboy default page datasource #210

Closed Aymenworks closed 5 years ago

Aymenworks commented 5 years ago

It seems to me that for most people, they will return nil as a default page, so I was thinking how about doing that for them?

For other people who are using a default page, they will not notice the difference.

What do you think?

uias-bot commented 5 years ago
1 Warning
:warning: Looks like you changed some source files, should there have been some tests added?

SwiftLint found issues

Warnings

File Line Reason
PageViewController.swift 137 Files should have a single trailing newline. (trailing_newline)

Errors

File Line Reason
PageViewController.swift 79 Force casts should be avoided. (force_cast)
PageViewController.swift 28 Variable name should be between 3 and 40 characters long: 'i' (identifier_name)

Generated by :no_entry_sign: Danger

msaps commented 5 years ago

@Aymenworks sorry it took so long to respond - thanks for the PR.

We used to have default implementations for PageboyViewControllerDelegate functions, and they weren't that well received - especially when we made breaking changes in major version. So I'd prefer to keep the protocols without them, I think the inconvenience of having to return nil is a better than reducing visibility of the function.

👍

Aymenworks commented 5 years ago

Make sense!

Thanks 👍