Skip to content
This repository was archived by the owner on Jul 1, 2022. It is now read-only.

Commit 06a2c61

Browse files
Use margins for layout
1 parent 49be5f2 commit 06a2c61

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ALCameraViewController/ViewController/CameraViewControllerConstraint.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ extension CameraViewController {
184184

185185
switch statusBarOrientation {
186186
case .portrait:
187-
attributeOne = .top
188-
attributeTwo = .bottom
187+
attributeOne = .topMargin
188+
attributeTwo = .bottomMargin
189189
break
190190
case .landscapeRight:
191191
attributeOne = .left
@@ -196,8 +196,8 @@ extension CameraViewController {
196196
attributeTwo = .left
197197
break
198198
default:
199-
attributeOne = .bottom
200-
attributeTwo = .top
199+
attributeOne = .bottomMargin
200+
attributeTwo = .topMargin
201201
break
202202
}
203203

@@ -401,7 +401,7 @@ extension CameraViewController {
401401
view.autoRemoveConstraint(flashButtonEdgeConstraint)
402402

403403
let constraintRight = statusBarOrientation == .portrait || statusBarOrientation == .landscapeRight
404-
let attribute : NSLayoutAttribute = constraintRight ? .top : .bottom
404+
let attribute : NSLayoutAttribute = constraintRight ? .topMargin : .bottomMargin
405405

406406
flashButtonEdgeConstraint = NSLayoutConstraint(
407407
item: flashButton,

0 commit comments

Comments
 (0)