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

Fade out dim while the centered view is going out of screen #216

Open
Jasperav opened this issue Sep 2, 2018 · 4 comments
Open

Fade out dim while the centered view is going out of screen #216

Jasperav opened this issue Sep 2, 2018 · 4 comments

Comments

@Jasperav
Copy link

Jasperav commented Sep 2, 2018

I am using the new feature with the centered view which can be pushed away by the user. It look amazing. However, I have one little request. When the user 'pushes' the view away, the dim mode stays dark (does not fade out) while the view is going out of screen (by the physics).

So the user sees the UIView flying away with a dimmed background. I think for appearance it would be great that the dim mode will fade out while the UIView is flying out out of the screen. Else I think the user just needs to wait a little to long to use the screen again. It looks more like he is forced to see the animation and can not continue using the app.

It looks like it can be partly solved by changing this line: animator.delegate?.hide(animator: animator) that is around line 122 in PhysicsPanHandler.swift. If it gets moved a few lines down under if energy > 200 && speed > 600 {, it looks a bit better. However, now the UIView gets dismissed to soon and makes weird movements.

The further away the user drags the UIView from the middle (starting point), the lighter the dimmode should be, that would look amazing :)

@wtmoose
Copy link
Member

wtmoose commented Sep 3, 2018

Thanks for the suggestion. I'll look into it when I get a chance.

@Jasperav
Copy link
Author

Jasperav commented Sep 3, 2018

@wtmoose Thank you very much. Maybe you can also have a look ad adding the dragging at the eventListeners enum. I got the following issue:

I got a tableview inside the centered view. When the user taps on one of the cells, the cell gets highlighted. If the user now drag around his finger, the tableview will drag with his finger (which is great). However, when the user stops dragging and releases his finger, the tableview bounces back but the cell is still highlighted. If an event case gets added like: startedDrag, endedDrag, I can tackle this problem easy :). I can make a separate issue for this though.

Thanks!

Above issue isn't valid anymore

@wtmoose
Copy link
Member

wtmoose commented Sep 4, 2018

I'm a little confused by your last comment. Scroll views have their own gesture recognizers, so I don't see why you'd want your table view's behavior to depend on SwiftMessages.

@Jasperav
Copy link
Author

Jasperav commented Sep 4, 2018

@wtmoose Nvm, I subclasses a UIButton, with custom touch down events. They were not called anymore after dragging around the centered view. After I added a UIControlEvent with type 'touchCancel', it worked. So last comment isn't valid anymore.

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

No branches or pull requests

2 participants