BendingSpoons/tempura-swift

use topLayoutGuide instead of topInset

smaramba opened this issue · 1 comments

 +  
 +  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

we are now using iOS 11 safeArea and layoutGuides as a fallback in iOS 10