Swift 5: How to programmatically dismiss a keyboard when return is clicked

  1. Make a new textField in your ViewController.swift file and add constraints

--

--

--

I make tutorials and articles on Programming, iOS Development, and Mathematics github.com/EricGustin

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

SwiftUI Basics: State

Make your coredata code thread safe

Getting Started with Apple HealthKit

Getting Started with Core Data

Images and SF Symbol Icons

Closures in Swift

Build a Navigation View, Inside a Tab View

RCNetworkClient

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Eric Gustin

Eric Gustin

I make tutorials and articles on Programming, iOS Development, and Mathematics github.com/EricGustin

More from Medium

Discover Active iOS Dev Blogs

Sending Message Error To Webhook Slack

How To Use UIView as NavigationBar Which Allow You to change NavigationBar Size

BigNav

Coordinator Pattern explained in simple steps