Added fixes for issues that caused quite frequent crashes in our app.
Removed forced position unwrapping.
Added check whether startIndex offset by position is still between bounds (less than endIndex).
Added check for ... range iteration so that start is less than finish.
Added fixes for issues that caused quite frequent crashes in our app.
Removed forced
position
unwrapping. Added check whetherstartIndex
offset byposition
is still between bounds (less thanendIndex
). Added check for ... range iteration so thatstart
is less thanfinish
.