The identifier of a child view to scroll to.
Instance Method
インスタンスメソッド
scroll
scrollTo(_:anchor:)
Scans all scroll views contained by the proxy for the first with a child view with identifier
id
, and then scrolls to that view.Availability 有効性
- iOS 14.0+
- iPadOS 14.0+
- macOS 11.0+
- Mac Catalyst 14.0+
- tvOS 14.0+
- watchOS 7.0+
Technology
- Swift
UI
Declaration 宣言
Parameters パラメータ
id
anchor
The alignment behavior of the scroll action.
Discussion 議論
If anchor
is nil
, this method finds the container of the identified view, and scrolls the minimum amount to make the identified view wholly visible.
If anchor
is non-nil
, it defines the points in the identified view and the scroll view to align. For example, setting anchor
to top
aligns the top of the identified view to the top of the scroll view. Similarly, setting anchor
to bottom
aligns the bottom of the identified view to the bottom of the scroll view, and so on.