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 public intializer to PresentationDesignable #402

Merged
merged 7 commits into from
Feb 22, 2017

Conversation

tbaranes
Copy link
Member

@tbaranes tbaranes commented Feb 21, 2017

Follow up of #401
Since the philosophy of IBAnimatable is to use protocols for everything in order to reuse them in our own components, it's quite sad that we are blocking that usage for PresentationDesignable.

I think we just missed that case, and it's probably an implementation error.

@tbaranes
Copy link
Member Author

tbaranes commented Feb 21, 2017

@mikhailmulyar Let's continue the discussion here.

I changed a bit my mind, instead of putting everything public... I prefer abstract the setupPresenter in the protocol, which means PresentationDesignable is now usable from anywhere. AnimatableModalViewController doesn't have anymore any private properties... used to do a presentation.

Can you give it a try and let me know if that's ok for you?

@tbaranes
Copy link
Member Author

tbaranes commented Feb 21, 2017

I'm even wondering if it would be worth to add a viewWillAppear to the protocol in order to abstract the dismissal animation setup in order to avoid bug cases.

@mikhailmulyar
Copy link

Looks like it will work. Gonna check it soon

@IBAnimatableBot
Copy link

IBAnimatableBot commented Feb 21, 2017

1 Warning
⚠️ Consider adding supporting documentation to this change. Documentation can be found in the docs directory.

Generated by 🚫 danger

@mikhailmulyar
Copy link

Still not able to fully use it since those errors if i'm trying to adopt PresentationDesignable as in AnimatableModalViewController.
Error: 'transitionDuration' is inaccessible due to 'internal' protection level
Error: 'presentationConfiguration' is inaccessible due to 'internal' protection level

@tbaranes
Copy link
Member Author

tbaranes commented Feb 21, 2017

This time, it compiles! I test it to make sure it was ok 😆

@mikhailmulyar
Copy link

Yes, now it works. Thanks!

Copy link
Member

@JakeLin JakeLin left a comment

Choose a reason for hiding this comment

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

👍 Good one, thanks


public extension PresentationDesignable where Self: UIViewController {

public func configurePresenter() {
Copy link
Member

Choose a reason for hiding this comment

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

Great idea for having an extension method 👍

public var modalSize: (PresentationModalSize, PresentationModalSize) = (.half, .half)
public var keyboardTranslation = ModalKeyboardTranslation.none

public init() {}
Copy link
Member

Choose a reason for hiding this comment

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

Do we need that? since it is a struct, we may omit it.

@tbaranes tbaranes merged commit c22ddde into master Feb 22, 2017
@tbaranes tbaranes deleted the feature/public_presentationconfiguration branch February 22, 2017 13:55
@tbaranes
Copy link
Member Author

@mikhailmulyar The next release will include that feature, until then, you can target master directly :)

@mikhailmulyar
Copy link

Ok. Thanks!

@JakeLin
Copy link
Member

JakeLin commented Feb 22, 2017

Hey, @mikhailmulyar release 3.1.3 is up, you don't have to use master for the Cocoapods now, thanks.

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