use topLayoutGuide instead of topInset
smaramba opened this issue · 1 comments
smaramba commented
+
+ public var topInset: CGFloat {
+ let isTranslucent = self.navigationBar?.isTranslucent ?? false
+ var height: CGFloat = 0.0
+ if isTranslucent {
+ let statusBarHeight = UIApplication.shared.statusBarFrame.height
+ let navBarHeight: CGFloat = self.navigationBar?.bounds.size.height ?? 0.0
+ height = statusBarHeight + navBarHeight
+ }
+ return height
+ }
+}
si puo fare con self.viewController!.topLayoutGuide.length
smaramba commented
we are now using iOS 11 safeArea and layoutGuides as a fallback in iOS 10