Moving position of UIView which already setted by constraints.

Photo by Brett Jordan on Unsplash

You can change the position of UIView using it.

myView.frame.origin.x
myView.frame.origin.y

But if you already setted the constraints with storyboard, that has a priority so, you can’t see the result as you expected.

With the option “Remove at build time”, you can prepare to the constraint as manually.

And specify the value of constraints like below

myButton.trailingAnchor.constraint(equalTo: self.view.safeAreaLayoutGuide.trailingAnchor, constant: 15).isActive = true

--

--

--

Majored in Physics, self-taught and worked in the IT industry as a Dev/Design/Planning for 11 years. And I had run my Startup for 3 years. I fancy a ☔️ 🇬🇧

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

Recommended from Medium

How to make UITextView’s height dynamically?

5/Upgrading Old Apps: The Dirty Job of IOS Developement

How to use the LPLinkView

Functional Programming in Swift

Swift UI — iOS Designing up a notch

SwiftUI: Choosing an Application Architecture

Flutter Demo by KBTG: Adding Apple Watch to Flutter App via Flutter Method Channel

iOS Custom Accessibility Actions

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
Fredric Cliver

Fredric Cliver

Majored in Physics, self-taught and worked in the IT industry as a Dev/Design/Planning for 11 years. And I had run my Startup for 3 years. I fancy a ☔️ 🇬🇧

More from Medium

How to show one view over another in SwiftUI

RevenueCat Offerings, Entitlements, and Products. Which to use?

Easy Gaze Scrolling for iOS App.

Carousel view rotation