Swift version: 5.1
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.
SPONSORED Building in-app subscriptions are hard. RevenueCat makes it simple. With their open source SDKs, you can painlessly implement subscriptions for your app in hours, not months.
Available from iOS
This is part of the Swift Knowledge Base, a free, searchable collection of solutions for common iOS questions.
Link copied to your pasteboard.