I actually work on a app in Swift
.
I have my main ViewController
with a ScrollView
only.
In my swift file i add 3 view (3 subview controller) into the ScrollView
in order to have a special navigation (horizontal navigation like a View Pager
).
The problem is that each view has his swift file and therefore i don't find the solution to communicate with the ScrollView
of the main ViewController
from a subview
.
For example a SubViewController
(one of the three) have button on it.
And i would put a listener on this button and On click move the position of the screen in the ScrollView
(which is on the main view controller
), thanks to the method setContentOffset
of the scrollview
.