I have a scroll view which scrolls horizontally. I just added images, labels and a webview in it and there are many objects in it. I want to directly scroll to the first object in the scroll view. How do I do this?
Use the following code:
scrollView.contentOffset = CGPoint(x: 0, y: 0)
To animate your scrolling do this:
CGRect frame = CGRectMake(0, 768, 1024, 748); //wherever you want to scroll [self.scrollView scrollRectToVisible:frame animated:YES];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With