Skip to content

Commit

Permalink
Add availability check for safeAreaInsets on tvOS
Browse files Browse the repository at this point in the history
  • Loading branch information
andreamazz committed Jun 18, 2019
1 parent b2aadb5 commit d682ee7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion SwiftSpinner/SwiftSpinner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ public class SwiftSpinner: UIView {
if let subtitle = subtitleLabel {
subtitle.bounds.size = subtitle.sizeThatFits(bounds.insetBy(dx: 20.0, dy: 0.0).size)
var safeArea: CGFloat = 0
if #available(iOS 11.0, *) {
if #available(iOS 11.0, tvOS 11.0, *) {
safeArea = superview?.safeAreaInsets.bottom ?? 0
}
subtitle.center = CGPoint(x: bounds.midX, y: bounds.maxY - subtitle.bounds.midY - subtitle.font.pointSize - safeArea)
Expand Down

0 comments on commit d682ee7

Please sign in to comment.