Claude31 - thanks very much for the response. Apologies for not responding earlier, but I've been doing some investigation.Your solution worked perfectly for the dummy app as well as for the amended dummy with sections and section headers.Sadly, it didn't work when it came to the app I'm working on. And I think it has something to do with the NavigationController I'm using.That appears to be nudging the tableView down and hence the scrolling does not appear to be going to the top.Have you come across this before? And is there a way around this?Many thanks
Post
Replies
Boosts
Views
Activity
Claude31 - Many, many thanks for your responses. Because I had assumed that the problem lay with the scrollToRow call (which to the extent of the viewWillAppear solution, it did), I had over simplied my dummy app. The moment I introduced a NavigationController into the dummay app, this also then started to behave strangely. But it is the original TableViewController that sits inside the NavigationController, not the Test2TVC.The full structure (of the actual app) is as follows: - A TabBar Controller with four tabs. - Each tab has its own NavigationController stack, in order to link screens in that app that are linked by use. - One of the these four tabs is a Settings tab, which has a NavigationController and the Settings screen as its Root View Controller. - There is then a segue set up in the Storyboard to link the Settings screen with the Location screen.Tab Bar Controller -> Navigation Controller -> Settings TableView Controller -(segue)-> Locations TableView Controller.Many apologies if in trying to simplify things, I've lead you down the wrong path!Thanks
The first print test doesn't print out anything, but nor does the second. The segue is between two UIViewControllers and, as such, the segue.destination is also a UIViewController.Do have a dummy app that highlights the problem, but would need to pare down the data somewhat. Also, as I'm a little new to all this, how do I set up a temporary email address?Thanks
@Max - thanks, that solved my issue too.
I had "guard let path = path else { return }" , which when changed to "guard let goodPath = path else { return }" solved the problem.
Strange, as there are loads of examples online/tutorials/books that use that form, but for some reason Swift doesn't like it.
(Xcode 12.5.1, Swift 5)