---
title: Deprecated initializers
framework: swiftui
role: collectionGroup
role_heading: API Collection
path: swiftui/textfield-deprecated
---

# Deprecated initializers

Review deprecated text field initializers.

## Overview

Overview Use view modifiers to specify change and commit behaviors for a text field when replacing these initializers. Use the onSubmit(of:_:) view modifier to get the behavior provided by the onCommit parameter. Use focused(_:equals:) and FocusState to get the behavior provided by the onEditingChanged parameter.

## Topics

### Creating a text field with a string

- [init(_:text:onEditingChanged:onCommit:)](swiftui/textfield/init(_:text:oneditingchanged:oncommit:).md)
- [init(_:text:onCommit:)](swiftui/textfield/init(_:text:oncommit:).md)
- [init(_:text:onEditingChanged:)](swiftui/textfield/init(_:text:oneditingchanged:).md)

### Creating a text field with a value

- [init(_:value:formatter:onEditingChanged:onCommit:)](swiftui/textfield/init(_:value:formatter:oneditingchanged:oncommit:).md)
- [init(_:value:formatter:onCommit:)](swiftui/textfield/init(_:value:formatter:oncommit:).md)
- [init(_:value:formatter:onEditingChanged:)](swiftui/textfield/init(_:value:formatter:oneditingchanged:).md)
