07-21-2023, 10:23 PM
Here is another use case which worked well for me.
1. User tap a button/cell.
2. Scroll to a position just enough to make a target view visible.
Code: **Swift 5.3**
```swift
// Assuming you have a view named "targeView"
scrollView.scroll(to: CGPoint(x:targeView.frame.minX, y:targeView.frame.minY), animated: true)
```
As you can guess if you want to scroll to make a bottom part of your target view visible then use maxX and minY.
1. User tap a button/cell.
2. Scroll to a position just enough to make a target view visible.
Code: **Swift 5.3**
```swift
// Assuming you have a view named "targeView"
scrollView.scroll(to: CGPoint(x:targeView.frame.minX, y:targeView.frame.minY), animated: true)
```
As you can guess if you want to scroll to make a bottom part of your target view visible then use maxX and minY.