Group Group Group Group Group Group Group Group Group

Scroll(to:at:animated:) not working

#1

Hi, I’m currently at the end of the chapter 6 of watchOS by Tutorials, where we use the scrollTo function to make the interface scrolling to see the entire label, but I can’t make it work… It worked perfectly for the previous project, but not on this one (and the Final project for this chapter does not work neither :confused:). Could you help me on this issue please ?

#2

Hello @ericlm,
My apologies for the “very” late reply.
The problem is there in the final project actually, I’m trying on watchOS 5 and Xcode 10, I’m quite sure that it works normally on watchOS 4 but I don’t have older simulators installed right now.
I managed to get something to work after several trial and error:
I created a reference on the button itself (which is directly under the interface controller) and the scrolling worked but not correctly.
The best outcome I managed to do is: scroll to the button and not the label inside it and use a delay. Code looks like this:
if expanded { DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { self.scroll(to: self.moreButton, at: .top, animated: true) } }

1 Like
#3

No problem @ehabamer ! Thank you very much for the little workaround, it makes the trick ! Still a strange issue though…

#4

Hello, I ran into the same problem and it seems that scroll does not work when the control is within a group (other than the main interface) any news on that? Is that a watchOS 5 bug or feature?

#5

@ehabamer Can you please help with this when you get a chance? Thank you - much appreciated! :]

#6

Hello @letatas, I tried it again directly on a device (incase its just a simulator issue) but it is still the case.
It’s very unlikely that it is a feature :] so I can safely bet its on the bug side.
I can’t find anyone discussing this issue, or know if this has been reported before.
but scrolling to an element just under the root seems to be working fine.
If I notice any updates concerning this issue in any further updates on watchOS I’ll post it here.

closed #7

This topic was automatically closed after 166 days. New replies are no longer allowed.