Describe the bug
iOS 17 crashes when String.paragraphRange(for:) is called when the range passed in is for a single paragraph separator character: \u{2029}
To Reproduce
Steps to reproduce the behavior:
Run the AztecExample demo app in the Simulator or on a real device
Tap "Standard Demo"
Place the cursor at the end of the top line "Welcome to Aztec"
Erase characters until the app crashes
Expected behavior
The app to erase the characters without crashing.
Screenshots
Video
Exception
Smartphone (please complete the following information):
The following Playground in Xcode 16 will reproduce the crash:
import Foundation
/// Fails when using Xcode 16.0 beta 8 Playground and when running on iOS 17 beta.
let paragraphSeparator = "\u{2029}"
/// Try adding a character before or after the separator - it should not crash.
let string = paragraphSeparator
let range = string.startIndex ..< string.endIndex
/// Throws an exception.
let outRange = string.paragraphRange(for: range)
/// Success if this was reached.
print(string)
Describe the bug iOS 17 crashes when
String.paragraphRange(for:)
is called when the range passed in is for a single paragraph separator character:\u{2029}
To Reproduce Steps to reproduce the behavior:
Expected behavior The app to erase the characters without crashing.
Screenshots
Smartphone (please complete the following information):
Additional context
FB13142115
The following Playground in Xcode 16 will reproduce the crash: