get the width of device swift ui code example Example: swift get device screen size let screenSize: CGRect = UIScreen.main.bounds