Swift version: 5.0
Interface Builder is the standard tool for making iOS interfaces using drag and drop, but it does make it remarkably easy to make a mistake – moving a view by accident, adjusting a property with a typo, or perhaps embedding one view inside another by dragging.
Fortunately, there’s a quick and easy fix: you can select any control then lock it so that no more changes can happen. To try it out, select something (e.g. a button), then go to the Class inspector and look for the Lock property. It’s set to “Inherited – (Nothing)” by default, but you can change it to “All Properties” to ensure that it can’t be moved or have any of its settings adjusted.
Available from iOS
This is part of the Swift Knowledge Base, a free, searchable collection of solutions for common iOS questions.