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

Commit 359fbbc

Browse files
Fixing some constraints for iPhone X
1 parent 06a2c61 commit 359fbbc

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

ALCameraViewController/ViewController/CameraViewControllerConstraint.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ extension CameraViewController {
4646

4747
let attribute : NSLayoutAttribute = {
4848
switch statusBarOrientation {
49-
case .portrait: return .bottom
50-
case .landscapeRight: return .right
51-
case .landscapeLeft: return .left
52-
default: return .top
49+
case .portrait: return .bottomMargin
50+
case .landscapeRight: return .rightMargin
51+
case .landscapeLeft: return .leftMargin
52+
default: return .topMargin
5353
}
5454
}()
5555

@@ -60,7 +60,7 @@ extension CameraViewController {
6060
toItem: view,
6161
attribute: attribute,
6262
multiplier: 1.0,
63-
constant: attribute == .right || attribute == .bottom ? -8 : 8)
63+
constant: -8)
6464
view.addConstraint(cameraButtonEdgeConstraint!)
6565
}
6666

@@ -184,8 +184,8 @@ extension CameraViewController {
184184

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

0 commit comments

Comments
 (0)