SwiftUI: view modifier to set global (hole screen relative) position of the view

In some cases you may need to position your view according to the hole screen coordinate space, but in SwiftUI standard libriary you only have .position view modifier that position your view relative to it's parent coordinate space..

So let's create our custom ViewModifier to solve this problem!

--

--

--

iOS Developer

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

Recommended from Medium

So, Xcode doesn’t support your iPhone’s OS version. Here’s how to fix it.

Heap & Stack: What the heck?

iOS Fundamental: Networking with URLSession

Autofill OTP code in iOS

Getting Started with SwiftUI

macbook air repair, other service recomended to replace battery witch did not sorted the problem of…

macbook air repair, other service recomended to replace battery witch did not sorted the problem of not charging not turning on :)

The Ultimate Guide to Loops in Swift

FileMaker, Siri and Shortcuts

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
Ilya Ambrazhevich

Ilya Ambrazhevich

iOS Developer

More from Medium

Add Touch ID & Face ID in Swift

Start using Vapor 4 without Toolbox / Homebrew

Optional vs Implicitly Optional Unwrap in Swift

Solving “FriendFace” 100DaysOfSwiftUI Challenge (Day 60, 61)

Solving FriendFace Challenge