 		
 	}
 	
-	@available(iOS 11.0, *)
-	private var boundsWithZeroOriginInSafeArea: CGRect {
-		
-		let bounds = self.boundsWithZeroOrigin
-		let insets = self.safeAreaInsets
-		let frame = bounds.inside(insets)
-		
-		return frame
-		
-	}
-	
-
-	func frame(in targetView: UIView, ignoresTransform shouldIgnoreTransform: Bool = false) -> CGRect {
-
-		switch targetView {
-		case self:
-			return self.boundsWithZeroOrigin
-			
-		default:
-			let checkingFrame: CGRect = {
-				if shouldIgnoreTransform {
-					return self.nal.identityFrame
-				} else {
-					return self.frame
-				}
-			}()
-			
-			let convertedFrame: CGRect = {
-				if let superview = self.superview {
-					return superview.convert(checkingFrame, to: targetView)
-				} else {
-					return checkingFrame
-				}
-			}()
-			
-			return convertedFrame
-		}
-
-	}
-	
-	@available(iOS 11.0, *)
-	func frame(in targetView: UIView, ignoresTransform shouldIgnoreTransform: Bool = false, safeAreaOnly shouldOnlyIncludeSafeArea: Bool) -> CGRect {
+	private func frame(in targetView: UIView, ignoresTransform shouldIgnoreTransform: Bool, safeAreaOnly shouldOnlyIncludeSafeArea: Bool) -> CGRect {
 		
 		switch targetView {
 		case self:
-			if shouldOnlyIncludeSafeArea {
-				return self.boundsWithZeroOriginInSafeArea
+			if shouldOnlyIncludeSafeArea, #available(iOS 11.0, *) {
+				return self.boundsWithZeroOrigin.inside(self.safeAreaInsets)
 			} else {
 				return self.boundsWithZeroOrigin
 			}


extension UIView {
	
	func horizontalReference(_ reference: CGRect.HorizontalBasePoint, of referenceView: @escaping () -> UIView?, offsetBy offset: CGFloat = 0, ignoresTransform: Bool = false) -> CGRect.Float {
		
		let reference = CGRect.Float.closure { [unowned self] (_) -> CGFloat in
			

				return offset
			}
			
			let frame = referenceView.frame(in: self, ignoresTransform: shouldIgnoreTransform, safeAreaOnly: shouldOnlyIncludeSafeArea)
			
			let reference = reference.value(in: frame)
			
