Swift Array – Check if an index exists October 23, 2022 by Tarik An elegant way in Swift: let isIndexValid = array.indices.contains(index)