Skip to content

Commit bc1dde4

Browse files
committed
Addressed Xcode warnings.
1 parent 8dee560 commit bc1dde4

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

StackViewController/SeparatorView.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ open class SeparatorView: UIView {
5656
switch axis {
5757
case .horizontal: return .height
5858
case .vertical: return .width
59+
@unknown default:
60+
assertionFailure("Unknown axis. Assuming it should behave the same as vertical.")
61+
return .width
5962
}
6063
}()
6164
sizeConstraint = NSLayoutConstraint(
@@ -81,6 +84,9 @@ open class SeparatorView: UIView {
8184
switch axis {
8285
case .horizontal: return .minXEdge
8386
case .vertical: return .maxYEdge
87+
@unknown default:
88+
assertionFailure("Unknown axis. Assuming it should behave the same as vertical.")
89+
return .maxYEdge
8490
}
8591
}()
8692
let (_, separatorRect) = bounds.divided(atDistance: separatorInset, from: edge)

StackViewController/StackViewContainer.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ open class StackViewContainer: UIView, UIScrollViewDelegate {
6969
switch axis {
7070
case .horizontal: return .vertical
7171
case .vertical: return .horizontal
72+
@unknown default:
73+
assertionFailure("Unknown axis. Assuming it should behave the same as vertical.")
74+
return .horizontal
7275
}
7376
}()
7477
let separatorView = SeparatorView(axis: separatorAxis)
@@ -141,6 +144,9 @@ open class StackViewContainer: UIView, UIScrollViewDelegate {
141144
switch axis {
142145
case .horizontal: return .height
143146
case .vertical: return .width
147+
@unknown default:
148+
assertionFailure("Unknown axis. Assuming it should behave the same as vertical.")
149+
return .width
144150
}
145151
}()
146152
stackViewSizeConstraint =

StackViewController/UIStackViewExtensions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import UIKit
1010

1111
public extension UIStackView {
12-
@objc public func removeAllArrangedSubviews() {
12+
@objc func removeAllArrangedSubviews() {
1313
arrangedSubviews.forEach {
1414
$0.removeFromSuperview()
1515
}

StackViewController/UIViewExtensions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import UIKit
1010

1111
public extension UIView {
12-
@objc public func activateSuperviewHuggingConstraints(insets: UIEdgeInsets = UIEdgeInsets.zero) -> [NSLayoutConstraint] {
12+
@objc func activateSuperviewHuggingConstraints(insets: UIEdgeInsets = UIEdgeInsets.zero) -> [NSLayoutConstraint] {
1313
translatesAutoresizingMaskIntoConstraints = false
1414
let views = ["view": self]
1515
let metrics = ["top": insets.top, "left": insets.left, "bottom": insets.bottom, "right": insets.right]

0 commit comments

Comments
 (0)