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

Incorrect behavior in iOS 8.1 #6

Open
ryanmeisters opened this issue Jan 15, 2015 · 3 comments
Open

Incorrect behavior in iOS 8.1 #6

ryanmeisters opened this issue Jan 15, 2015 · 3 comments
Labels

Comments

@ryanmeisters
Copy link
Owner

It looks like this category is behaving incorrectly under iOS 8.1. This can be seen in the example project.

Incorrect behavior:

  • All test views are snapping back to their original positions immediately upon touching the drop view.
  • View 2 is returning to its starting position when dragging ends.

Correct behavior:

  • Test views 1, 3, 4 should return to their starting positions (animated) when dropped (on the drop view or not), but only when dropped.
  • View 2 should not return to it's starting position.

I will see if I can get some time to look more closely at this.

@slangley
Copy link

So I looked into this quite a bit, and figured out that it was due to the UILabel's being changed in the middle of the delegate calls.

For some reason in iOS 8, Apple modified behaviour of UILabel such that when you change the text of a label, the constraints for it's superview are updated. Likely due to content hugging, size changes, etc.

Since we are dragging the UIView around without updating the constraints, as soon as the constraint system kicks in and updates, the view that is being dragged reverts back to it's original position.

@mps
Copy link

mps commented Apr 23, 2015

@ryanmeisters @slangley did you all ever make any progress on this behavior in iOS 8.1+? Thanks!

@slangley
Copy link

The behaviour works in 8.1 as long as you don't do something mid drag that forces a constraint update. The sample updates the label in the middle of the drag that forces a re layout, causing the view being dragged to have its frame reset.

I have used this category successfully in an app which is fully auto layout based by ensuring I am avoiding the above caveat.

App is here and is drag heavy:
http://itunes.apple.com/ca/app/gummii/id669982848?mt=8

On Apr 23, 2015, at 8:59 AM, Matthew Strickland notifications@github.com wrote:

@ryanmeisters @slangley did you all ever make any progress on this behavior in iOS 8.1+? Thanks!


Reply to this email directly or view it on GitHub.

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

No branches or pull requests

3 participants