How to implement bullet and numbered list functionality in ios26 attributed string text editor

I'm looking to support toggleable bullet and numbered lists in my IOS 26 app. currently my text editor looks like this

    @Binding var text: AttributedString
    var requestFocus: Bool = false
    @State private var selection = AttributedTextSelection()
    @FocusState private var isFocused: Bool

    var body: some View {
        TextEditor(text: $text, selection: $selection)
            .scrollContentBackground(.hidden)
            .background(Color.clear)
            .focused($isFocused)
            .safeAreaInset(edge: .bottom) {
                if isFocused {
                    FormattingToolbar(text: $text, selection: $selection)
                        .padding(.horizontal)
                        .padding(.vertical, 8)
                        .background(Color(UIColor.systemBackground))
                }
            }
            .onChange(of: requestFocus) { _, newValue in
                if newValue {
                    isFocused = true
                }
            }
    }
}

i cant find any useful docs on how to best implement this. anything helps, thanks

Hello natanbiley,

Thanks for your question and sample code. What are you looking to do in terms of support for toggled bullet and numbered lists, in terms of app experience? Do you mean that when a user types into your TextEditor, the string is automatically converted into list format? Or are you asking for something else? Also, what is the FormattingToolbar in this case?

Thank you for your patience,

Richard Yeh  Developer Technical Support

I would like it to work like the iOS notes app text editor, where there is a toolbar above the keyboard on which I can click buttons to toggle a numbered list and bullet list where the cursor position is

Hello natanbiley,

TextEditor does not currently support lists, either parsed from Markdown or otherwise. You could potentially mutate the selection binding to 'manually' insert list symbols and newlines to format selected text into a list. However, this requires implementing your own list structure and formatting, since this workaround does not give you access to the native iOS formatting of lists.

Thank you for your patience,

Richard Yeh  Developer Technical Support

How to implement bullet and numbered list functionality in ios26 attributed string text editor
 
 
Q