TSMessages icon indicating copy to clipboard operation
TSMessages copied to clipboard

TSMessages reseting view position

Open cytryn opened this issue 11 years ago • 7 comments

I have reported this problem before, but so far so good it was not affecting me since I was using an older version of TSMessages. But now that I have updated it is really annoying me =/

I have a navigationViewController with a textfield on it. I use TSMessages to validade the textfield content. When the textfield have focus, I slide the view up so the user can see what he is actually typing.

The thing is that when I have a TSMEssage active while the keyboard is on, if the message gets dismissed, it resets the view as shown in this video: http://screencast.com/t/FXz2VCwj3KWa

I was taking a look at your code and I found that the problem was in line 343 of TSMessage.m inside the completion block of the animation: [currentView removeFromSuperview];

I debugged to see if this removal was really necessary. I found out that I always have the same amount of subviews, so for me it is not affecting, but since I didn't check the whole code, I will leave it to out to see if this is really necessary or not.

cytryn avatar Mar 14 '14 14:03 cytryn

So the old version didn't have this problem? That looks really odd. This is caused by TSMessages?

All TSMessages does is create a new view, add it as a subview of your given view(controller) and display it there.

[currentView removeFromSuperView]; is a valid command: It is used to clean itself up and remove itself from the super view.

Are you sure this problem is not caused by some of your code (e.g. hacky way to receive or modify an other view?)

Maybe you could provide an example, it's difficult to guess.

KrauseFx avatar Mar 17 '14 18:03 KrauseFx

I created this simple app to show this issue:

https://github.com/cytryn/MyTSMessageTest

I tried to stay simple but using the code that I currently have in my project.

Pods: TSMessages and BSKeyboardControl

cytryn avatar Mar 17 '14 19:03 cytryn

i will look into this.

mRs- avatar Apr 03 '14 12:04 mRs-

@KrauseFx @mRs- any updates on this?

cytryn avatar Apr 16 '14 14:04 cytryn

Sorry, I had no time to look into it yet.

KrauseFx avatar Apr 16 '14 19:04 KrauseFx

just looked into this, can't find the bug so far :/

mRs- avatar Apr 18 '14 14:04 mRs-

@mRs- it does not happen to you?

1 - press the button. The TSMessage will appear. 2 - while the TSMessage is still there, tap the textField. 3 - wait for the TSMessage to be dismissed and then you will the view resets the position. 4 - tap the done button to dismiss the keyboard and the view gap will be created.

Let me know if it happens or not.

cytryn avatar Apr 19 '14 04:04 cytryn