@@ -124,62 +124,58 @@ class UIFloatMenuHelper {
124124 return " "
125125 }
126126
127- }
128-
129- // MARK: - Layout
130- struct Layout {
131-
132- enum LayoutStyle : String {
133- case iPadFullScreen = " iPad Full Screen "
134- case iPadHalfScreen = " iPad 1/2 Screen "
135- case iPadTwoThirdScreen = " iPad 2/3 Screen "
136- case iPadOneThirdScreen = " iPad 1/3 Screen "
137- case iPhoneFullScreen = " iPhone "
138- }
139-
140- static func determineLayout( ) -> LayoutStyle {
141- if UIDevice . current. userInterfaceIdiom == . phone {
142- return . iPhoneFullScreen
143- }
144-
145- let screenSize = UIScreen . main. bounds. size
146- let appSize = UIApplication . shared. windows [ 0 ] . bounds. size
147- let screenWidth = screenSize. width
148- let appWidth = appSize. width
149-
150- if screenSize == appSize {
151- return . iPadFullScreen
127+ // MARK: - Layout
128+ struct Layout {
129+ enum LayoutStyle : String {
130+ case iPadFullScreen = " iPad Full Screen "
131+ case iPadHalfScreen = " iPad 1/2 Screen "
132+ case iPadTwoThirdScreen = " iPad 2/3 Screen "
133+ case iPadOneThirdScreen = " iPad 1/3 Screen "
134+ case iPhoneFullScreen = " iPhone "
152135 }
153136
154- let persent = CGFloat ( appWidth / screenWidth) * 100.0
155-
156- if persent <= 55.0 && persent >= 45.0 {
157- return . iPadHalfScreen
158- } else if persent > 55.0 {
159- return . iPadTwoThirdScreen
160- } else {
161- return . iPadOneThirdScreen
137+ static func determineLayout( ) -> LayoutStyle {
138+ if UIDevice . current. userInterfaceIdiom == . phone {
139+ return . iPhoneFullScreen
140+ }
141+
142+ let screenSize = UIScreen . main. bounds. size
143+ let appSize = UIApplication . shared. windows [ 0 ] . bounds. size
144+ let screenWidth = screenSize. width
145+ let appWidth = appSize. width
146+
147+ if screenSize == appSize {
148+ return . iPadFullScreen
149+ }
150+
151+ let persent = CGFloat ( appWidth / screenWidth) * 100.0
152+
153+ if persent <= 55.0 && persent >= 45.0 {
154+ return . iPadHalfScreen
155+ } else if persent > 55.0 {
156+ return . iPadTwoThirdScreen
157+ } else {
158+ return . iPadOneThirdScreen
159+ }
162160 }
163161 }
164-
165- }
166162
167- // MARK: - Orientation
168- struct Orientation {
169-
170- static var isLandscape : Bool {
171- get {
172- return UIDevice . current. orientation. isValidInterfaceOrientation
173- ? UIDevice . current . orientation . isLandscape
174- : ( UIApplication . shared . windows . first ? . windowScene ? . interfaceOrientation . isLandscape ) !
163+ // MARK: - Orientation
164+ struct Orientation {
165+ static var isLandscape : Bool {
166+ get {
167+ return UIDevice . current . orientation . isValidInterfaceOrientation
168+ ? UIDevice . current. orientation. isLandscape
169+ : ( UIApplication . shared . windows . first ? . windowScene ? . interfaceOrientation . isLandscape) !
170+ }
175171 }
176- }
177-
178- static var isPortrait : Bool {
179- get {
180- return UIDevice . current. orientation. isValidInterfaceOrientation
181- ? UIDevice . current . orientation . isPortrait
182- : ( UIApplication . shared . windows . first ? . windowScene ? . interfaceOrientation . isPortrait ) !
172+
173+ static var isPortrait : Bool {
174+ get {
175+ return UIDevice . current . orientation . isValidInterfaceOrientation
176+ ? UIDevice . current. orientation. isPortrait
177+ : ( UIApplication . shared . windows . first ? . windowScene ? . interfaceOrientation . isPortrait) !
178+ }
183179 }
184180 }
185181
0 commit comments