I'm passing selectedIndex binding to PageView and using dynamic items. In initial load the items is not yet loaded with 0 items, the app crash because there is no safety check in func select(index: Int, animated: Bool = false).
Another occurrence is when I dismiss the view selectedIndex is out of bound, not sure why but should check for item count and do safety check.