diff --git a/Examples/Maps/Maps/MainViewController.swift b/Examples/Maps/Maps/MainViewController.swift index b4b614d..8518fce 100644 --- a/Examples/Maps/Maps/MainViewController.swift +++ b/Examples/Maps/Maps/MainViewController.swift @@ -215,17 +215,10 @@ class SearchPanelLandscapeLayout: FloatingPanelLayout { .tip: FloatingPanelLayoutAnchor(absoluteInset: 69.0, edge: .bottom, referenceGuide: .safeArea), ] func prepareLayout(surfaceView: UIView, in view: UIView) -> [NSLayoutConstraint] { - if #available(iOS 11.0, *) { - return [ - surfaceView.leftAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leftAnchor, constant: 8.0), - surfaceView.widthAnchor.constraint(equalToConstant: 291), - ] - } else { - return [ - surfaceView.leftAnchor.constraint(equalTo: view.leftAnchor, constant: 8.0), - surfaceView.widthAnchor.constraint(equalToConstant: 291), - ] - } + return [ + surfaceView.leftAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leftAnchor, constant: 8.0), + surfaceView.widthAnchor.constraint(equalToConstant: 291), + ] } func backdropAlpha(for state: FloatingPanelState) -> CGFloat { return 0.0 diff --git a/Examples/Maps/Maps/SearchViewController.swift b/Examples/Maps/Maps/SearchViewController.swift index 5dd40c8..ce071a0 100644 --- a/Examples/Maps/Maps/SearchViewController.swift +++ b/Examples/Maps/Maps/SearchViewController.swift @@ -81,9 +81,6 @@ class SearchViewController: UIViewController, UITableViewDataSource { var items: [LocationItem] = [] - // For iOS 10 only - private lazy var shadowLayer: CAShapeLayer = CAShapeLayer() - override func viewDidLoad() { super.viewDidLoad() tableView.dataSource = self @@ -92,29 +89,6 @@ class SearchViewController: UIViewController, UITableViewDataSource { hideHeader(animated: false) } - override func viewDidLayoutSubviews() { - super.viewDidLayoutSubviews() - if #available(iOS 11, *) { - } else { - // Exmaple: Add rounding corners on iOS 10 - visualEffectView.layer.cornerRadius = 9.0 - visualEffectView.clipsToBounds = true - - // Exmaple: Add shadow manually on iOS 10 - view.layer.insertSublayer(shadowLayer, at: 0) - let rect = visualEffectView.frame - let path = UIBezierPath(roundedRect: rect, - byRoundingCorners: [.topLeft, .topRight], - cornerRadii: CGSize(width: 9.0, height: 9.0)) - shadowLayer.frame = visualEffectView.frame - shadowLayer.shadowPath = path.cgPath - shadowLayer.shadowColor = UIColor.black.cgColor - shadowLayer.shadowOffset = CGSize(width: 0.0, height: 1.0) - shadowLayer.shadowOpacity = 0.2 - shadowLayer.shadowRadius = 3.0 - } - } - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return items.count } diff --git a/Examples/Samples/Sources/ContentViewControllers/DebugTextViewController.swift b/Examples/Samples/Sources/ContentViewControllers/DebugTextViewController.swift index 82d7d87..60d5291 100644 --- a/Examples/Samples/Sources/ContentViewControllers/DebugTextViewController.swift +++ b/Examples/Samples/Sources/ContentViewControllers/DebugTextViewController.swift @@ -11,9 +11,7 @@ final class DebugTextViewController: UIViewController, UITextViewDelegate { textView.delegate = self print("viewDidLoad: TextView --- ", textView.contentOffset, textView.contentInset) - if #available(iOS 11.0, *) { - textView.contentInsetAdjustmentBehavior = .never - } + textView.contentInsetAdjustmentBehavior = .never } override func viewWillLayoutSubviews() { @@ -32,9 +30,7 @@ final class DebugTextViewController: UIViewController, UITextViewDelegate { func scrollViewDidScroll(_ scrollView: UIScrollView) { print("TextView --- ", scrollView.contentOffset, scrollView.contentInset) - if #available(iOS 11.0, *) { - print("TextView --- ", scrollView.adjustedContentInset) - } + print("TextView --- ", scrollView.adjustedContentInset) } @IBAction func toggleTopMargin(_ sender: UISwitch) { diff --git a/Examples/Samples/Sources/ContentViewControllers/ImageViewController.swift b/Examples/Samples/Sources/ContentViewControllers/ImageViewController.swift index 503e29a..1742e63 100644 --- a/Examples/Samples/Sources/ContentViewControllers/ImageViewController.swift +++ b/Examples/Samples/Sources/ContentViewControllers/ImageViewController.swift @@ -37,7 +37,6 @@ final class ImageViewController: UIViewController { case withHeaderFooter } - @available(iOS 11.0, *) func layoutGuideFor(mode: Mode) -> UILayoutGuide { switch mode { case .onlyImage: diff --git a/Examples/Samples/Sources/ContentViewControllers/SettingsViewController.swift b/Examples/Samples/Sources/ContentViewControllers/SettingsViewController.swift index c19f4c9..5db870e 100644 --- a/Examples/Samples/Sources/ContentViewControllers/SettingsViewController.swift +++ b/Examples/Samples/Sources/ContentViewControllers/SettingsViewController.swift @@ -14,21 +14,17 @@ final class SettingsViewController: InspectableViewController { override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() - if #available(iOS 11.0, *) { - let prefersLargeTitles = navigationController!.navigationBar.prefersLargeTitles - largeTitlesSwitch.setOn(prefersLargeTitles, animated: false) - } else { - largeTitlesSwitch.isEnabled = false - } + let prefersLargeTitles = navigationController!.navigationBar.prefersLargeTitles + largeTitlesSwitch.setOn(prefersLargeTitles, animated: false) + let isTranslucent = navigationController!.navigationBar.isTranslucent translucentSwitch.setOn(isTranslucent, animated: false) } @IBAction func toggleLargeTitle(_ sender: UISwitch) { - if #available(iOS 11.0, *) { - navigationController?.navigationBar.prefersLargeTitles = sender.isOn - } + navigationController?.navigationBar.prefersLargeTitles = sender.isOn } + @IBAction func toggleTranslucent(_ sender: UISwitch) { // White non-translucent navigation bar, supports dark appearance if #available(iOS 15, *) { diff --git a/Examples/Samples/Sources/ContentViewControllers/TabBarViewController.swift b/Examples/Samples/Sources/ContentViewControllers/TabBarViewController.swift index 6253e86..a6e1770 100644 --- a/Examples/Samples/Sources/ContentViewControllers/TabBarViewController.swift +++ b/Examples/Samples/Sources/ContentViewControllers/TabBarViewController.swift @@ -238,13 +238,8 @@ class ThreeTabBarPanelLayout: FloatingPanelLayout { } func prepareLayout(surfaceView: UIView, in view: UIView) -> [NSLayoutConstraint] { - if #available(iOS 11.0, *) { - leftConstraint = surfaceView.leftAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leftAnchor, constant: 0.0) - rightConstraint = surfaceView.rightAnchor.constraint(equalTo: view.safeAreaLayoutGuide.rightAnchor, constant: 0.0) - } else { - leftConstraint = surfaceView.leftAnchor.constraint(equalTo: view.leftAnchor, constant: 0.0) - rightConstraint = surfaceView.rightAnchor.constraint(equalTo: view.rightAnchor, constant: 0.0) - } + leftConstraint = surfaceView.leftAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leftAnchor, constant: 0.0) + rightConstraint = surfaceView.rightAnchor.constraint(equalTo: view.safeAreaLayoutGuide.rightAnchor, constant: 0.0) return [ leftConstraint, rightConstraint ] } } diff --git a/Examples/Samples/Sources/Extensions.swift b/Examples/Samples/Sources/Extensions.swift index d93b62a..547c7ba 100644 --- a/Examples/Samples/Sources/Extensions.swift +++ b/Examples/Samples/Sources/Extensions.swift @@ -33,22 +33,10 @@ class CustomLayoutGuide: LayoutGuideProvider { extension UIViewController { var layoutInsets: UIEdgeInsets { - if #available(iOS 11.0, *) { - return view.safeAreaInsets - } else { - return UIEdgeInsets(top: topLayoutGuide.length, - left: 0.0, - bottom: bottomLayoutGuide.length, - right: 0.0) - } + return view.safeAreaInsets } var layoutGuide: LayoutGuideProvider { - if #available(iOS 11.0, *) { - return view!.safeAreaLayoutGuide - } else { - return CustomLayoutGuide(topAnchor: topLayoutGuide.bottomAnchor, - bottomAnchor: bottomLayoutGuide.topAnchor) - } + return view.safeAreaLayoutGuide } } diff --git a/Examples/Samples/Sources/MainViewController.swift b/Examples/Samples/Sources/MainViewController.swift index e51de0c..98cae3e 100644 --- a/Examples/Samples/Sources/MainViewController.swift +++ b/Examples/Samples/Sources/MainViewController.swift @@ -15,14 +15,11 @@ extension MainViewController { tableView.dataSource = self tableView.delegate = self tableView.register(UITableViewCell.self, forCellReuseIdentifier: "Cell") - automaticallyAdjustsScrollViewInsets = false let searchController = UISearchController(searchResultsController: nil) - if #available(iOS 11.0, *) { - navigationItem.searchController = searchController - navigationItem.hidesSearchBarWhenScrolling = false - navigationItem.largeTitleDisplayMode = .automatic - } + navigationItem.searchController = searchController + navigationItem.hidesSearchBarWhenScrolling = false + navigationItem.largeTitleDisplayMode = .automatic var insets = UIEdgeInsets.zero insets.bottom += 69.0 tableView.contentInset = insets @@ -33,12 +30,10 @@ extension MainViewController { override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) - if #available(iOS 11.0, *) { - if let observation = navigationController?.navigationBar.observe(\.prefersLargeTitles, changeHandler: { (bar, _) in - self.tableView.reloadData() - }) { - observations.append(observation) - } + if let observation = navigationController?.navigationBar.observe(\.prefersLargeTitles, changeHandler: { (bar, _) in + self.tableView.reloadData() + }) { + observations.append(observation) } } @@ -56,12 +51,8 @@ extension MainViewController { extension MainViewController: UITableViewDataSource { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - if #available(iOS 11.0, *) { - if navigationController?.navigationBar.prefersLargeTitles == true { - return UseCase.allCases.count + 30 - } else { - return UseCase.allCases.count - } + if navigationController?.navigationBar.prefersLargeTitles == true { + return UseCase.allCases.count + 30 } else { return UseCase.allCases.count } diff --git a/Examples/Samples/Sources/UseCases/UseCaseController.swift b/Examples/Samples/Sources/UseCases/UseCaseController.swift index a8fd6f6..268f277 100644 --- a/Examples/Samples/Sources/UseCases/UseCaseController.swift +++ b/Examples/Samples/Sources/UseCases/UseCaseController.swift @@ -323,7 +323,7 @@ extension UseCaseController { extension UseCaseController: FloatingPanelControllerDelegate { func floatingPanel(_ vc: FloatingPanelController, contentOffsetForPinning trackingScrollView: UIScrollView) -> CGPoint { - if useCase == .showNavigationController, #available(iOS 11.0, *) { + if useCase == .showNavigationController { // 148.0 is the SafeArea's top value for a navigation bar with a large title. return CGPoint(x: 0.0, y: 0.0 - trackingScrollView.contentInset.top - 148.0) } diff --git a/FloatingPanel.podspec b/FloatingPanel.podspec index 7ec36b1..cd729be 100644 --- a/FloatingPanel.podspec +++ b/FloatingPanel.podspec @@ -7,12 +7,12 @@ Pod::Spec.new do |s| FloatingPanel is a clean and easy-to-use UI component for a new interface introduced in Apple Maps, Shortcuts and Stocks app. The new interface displays the related contents and utilities in parallel as a user wants. DESC - s.homepage = "https://github.com/SCENEE/FloatingPanel" + s.homepage = "https://github.com/scenee/FloatingPanel" s.author = "Shin Yamamoto" s.social_media_url = "https://twitter.com/scenee" - s.platform = :ios, "10.0" - s.source = { :git => "https://github.com/SCENEE/FloatingPanel.git", :tag => s.version.to_s } + s.platform = :ios, "11.0" + s.source = { :git => "https://github.com/scenee/FloatingPanel.git", :tag => s.version.to_s } s.source_files = "Sources/*.swift" s.swift_version = '5.0' diff --git a/FloatingPanel.xcodeproj/project.pbxproj b/FloatingPanel.xcodeproj/project.pbxproj index 48ae752..b6417da 100644 --- a/FloatingPanel.xcodeproj/project.pbxproj +++ b/FloatingPanel.xcodeproj/project.pbxproj @@ -462,7 +462,7 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Sources/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -493,7 +493,7 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Sources/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -627,7 +627,7 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Sources/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/Package.swift b/Package.swift index ccfbb5f..41f701e 100644 --- a/Package.swift +++ b/Package.swift @@ -6,7 +6,7 @@ import PackageDescription let package = Package( name: "FloatingPanel", platforms: [ - .iOS(.v10) + .iOS(.v11) ], products: [ // Products define the executables and libraries produced by a package, and make them visible to other packages. diff --git a/README.md b/README.md index 30770aa..e30820c 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,6 @@ Please see also [the API reference](https://floatingpanel.github.io/2.7.0/docume - [Notes](#notes) - ['Show' or 'Show Detail' Segues from `FloatingPanelController`'s content view controller](#show-or-show-detail-segues-from-floatingpanelcontrollers-content-view-controller) - [UISearchController issue](#uisearchcontroller-issue) - - [FloatingPanelSurfaceView's issue on iOS 10](#floatingpanelsurfaceviews-issue-on-ios-10) - [Maintainer](#maintainer) - [License](#license) @@ -93,8 +92,6 @@ Examples can be found here: FloatingPanel is written in Swift 5.0+ and compatible with iOS 11.0+. -While it still supports iOS 10, it is recommended to use this library on iOS 11+. - :pencil2: If you'd like to use Swift 4.0, please use FloatingPanel v1. ## Installation @@ -703,21 +700,6 @@ It's a great way to decouple between a floating panel and the content VC. Because `UISearchController` automatically presents itself modally when a user interacts with the search bar, and then it swaps the superview of the search bar to the view managed by itself while it displays. As a result, `FloatingPanelController` can't control the search bar when it's active, as you can see from [the screen shot](https://github.com/SCENEE/FloatingPanel/issues/248#issuecomment-521263831). -### FloatingPanelSurfaceView's issue on iOS 10 - -* On iOS 10, `FloatingPanelSurfaceView.cornerRadius` isn't not automatically masked with the top rounded corners because of `UIVisualEffectView` issue. See https://forums.developer.apple.com/thread/50854. -So you need to draw top rounding corners of your content. Here is an example in Examples/Maps. -```swift -override func viewDidLayoutSubviews() { - super.viewDidLayoutSubviews() - if #available(iOS 10, *) { - visualEffectView.layer.cornerRadius = 9.0 - visualEffectView.clipsToBounds = true - } -} -``` -* If you sets clear color to `FloatingPanelSurfaceView.backgroundColor`, please note the bottom overflow of your content on bouncing at full position. To prevent it, you need to expand your content. For example, See Example/Maps App's Auto Layout settings of `UIVisualEffectView` in Main.storyboard. - ## Maintainer Shin Yamamoto | [@scenee](https://twitter.com/scenee) diff --git a/Sources/Controller.swift b/Sources/Controller.swift index 151a156..7e98f92 100644 --- a/Sources/Controller.swift +++ b/Sources/Controller.swift @@ -120,7 +120,7 @@ open class FloatingPanelController: UIViewController { } /// The delegate of a panel controller object. - @objc + @objc public weak var delegate: FloatingPanelControllerDelegate?{ didSet{ didUpdateDelegate() @@ -201,7 +201,7 @@ open class FloatingPanelController: UIViewController { /// The behavior for determining the adjusted content offsets. /// /// This property specifies how the content area of the tracking scroll view is modified using ``adjustedContentInsets``. The default value of this property is FloatingPanelController.ContentInsetAdjustmentBehavior.always. - @objc + @objc public var contentInsetAdjustmentBehavior: ContentInsetAdjustmentBehavior = .always /// A Boolean value that determines whether the removal interaction is enabled. @@ -301,16 +301,9 @@ open class FloatingPanelController: UIViewController { open override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() - if #available(iOS 11.0, *) { - // Ensure to update the static constraint of a panel after rotating a device in static mode - if contentMode == .static { - floatingPanel.layoutAdapter.updateStaticConstraint() - } - } else { - // Because {top,bottom}LayoutGuide is managed as a view - if floatingPanel.isAttracting == false { - self.update(safeAreaInsets: fp_safeAreaInsets) - } + // Ensure to update the static constraint of a panel after rotating a device in static mode + if contentMode == .static { + floatingPanel.layoutAdapter.updateStaticConstraint() } } @@ -445,28 +438,23 @@ open class FloatingPanelController: UIViewController { // Must apply the current layout here activateLayout(forceLayout: true) - if #available(iOS 11.0, *) { - // Must track the safeAreaInsets of `self.view` to update the layout. - // There are 2 reasons. - // 1. This or the parent VC doesn't call viewSafeAreaInsetsDidChange() on the bottom - // inset's update expectedly. - // 2. The safe area top inset can be variable on the large title navigation bar(iOS11+). - // That's why it needs the observation to keep `adjustedContentInsets` correct. - safeAreaInsetsObservation = self.view.observe(\.safeAreaInsets, options: [.initial, .new, .old]) { [weak self] (_, change) in - // Use `self.view.safeAreaInsets` because `change.newValue` can be nil in particular case when - // is reported in https://github.com/SCENEE/FloatingPanel/issues/330 - guard let self = self, change.oldValue != self.view.safeAreaInsets else { return } + // Must track the safeAreaInsets of `self.view` to update the layout. + // There are 2 reasons. + // 1. This or the parent VC doesn't call viewSafeAreaInsetsDidChange() on the bottom + // inset's update expectedly. + // 2. The safe area top inset can be variable on the large title navigation bar(iOS11+). + // That's why it needs the observation to keep `adjustedContentInsets` correct. + safeAreaInsetsObservation = self.view.observe(\.safeAreaInsets, options: [.initial, .new, .old]) { [weak self] (_, change) in + // Use `self.view.safeAreaInsets` because `change.newValue` can be nil in particular case when + // is reported in https://github.com/SCENEE/FloatingPanel/issues/330 + guard let self = self, change.oldValue != self.view.safeAreaInsets else { return } - // Sometimes the bounding rectangle of the controlled view becomes invalid when the screen is rotated. - // This results in its safeAreaInsets change. In that case, `self.update(safeAreaInsets:)` leads - // an unsatisfied constraints error. So this method should not be called with those bounds. - guard self.view.bounds.height > 0 && self.view.bounds.width > 0 else { return } + // Sometimes the bounding rectangle of the controlled view becomes invalid when the screen is rotated. + // This results in its safeAreaInsets change. In that case, `self.update(safeAreaInsets:)` leads + // an unsatisfied constraints error. So this method should not be called with those bounds. + guard self.view.bounds.height > 0 && self.view.bounds.width > 0 else { return } - self.update(safeAreaInsets: self.view.safeAreaInsets) - } - } else { - // KVOs for topLayoutGuide & bottomLayoutGuide are not effective. - // Instead, update(safeAreaInsets:) is called at `viewDidLayoutSubviews()` + self.update(safeAreaInsets: self.view.safeAreaInsets) } move(to: floatingPanel.layoutAdapter.initialState, @@ -598,18 +586,12 @@ open class FloatingPanelController: UIViewController { switch contentInsetAdjustmentBehavior { case .always: - if #available(iOS 11.0, *) { - scrollView.contentInsetAdjustmentBehavior = .never - } else { - children.forEach { (vc) in - vc.automaticallyAdjustsScrollViewInsets = false - } - } + scrollView.contentInsetAdjustmentBehavior = .never default: break } } - + /// [Experimental] Allows the panel to move as its tracking scroll view bounces. /// /// This method must be called in the delegate method, `UIScrollViewDelegate.scrollViewDidScroll(_:)`, diff --git a/Sources/Core.swift b/Sources/Core.swift index 161e991..61b55e9 100644 --- a/Sources/Core.swift +++ b/Sources/Core.swift @@ -294,8 +294,7 @@ class Core: NSObject, UIGestureRecognizerDelegate { return true } } - if #available(iOS 11.0, *), - otherGestureRecognizer.name == "_UISheetInteractionBackgroundDismissRecognizer" { + if otherGestureRecognizer.name == "_UISheetInteractionBackgroundDismissRecognizer" { // The dismiss gesture of a sheet modal should not begin until the pan gesture fails. return true } @@ -350,8 +349,7 @@ class Core: NSObject, UIGestureRecognizerDelegate { is UIRotationGestureRecognizer, is UIScreenEdgePanGestureRecognizer, is UIPinchGestureRecognizer: - if #available(iOS 11.0, *), - otherGestureRecognizer.name == "_UISheetInteractionBackgroundDismissRecognizer" { + if otherGestureRecognizer.name == "_UISheetInteractionBackgroundDismissRecognizer" { // Should begin the pan gesture without waiting the dismiss gesture of a sheet modal. return false } @@ -1135,9 +1133,9 @@ class Core: NSObject, UIGestureRecognizerDelegate { case .left: return CGPoint(x: scrollView.fp_contentOffsetMax.x, y: 0.0) case .bottom: - return CGPoint(x: 0.0, y: 0.0 - scrollView.fp_contentInset.top) + return CGPoint(x: 0.0, y: 0.0 - scrollView.adjustedContentInset.top) case .right: - return CGPoint(x: 0.0 - scrollView.fp_contentInset.left, y: 0.0) + return CGPoint(x: 0.0 - scrollView.adjustedContentInset.left, y: 0.0) } } @@ -1163,9 +1161,7 @@ public final class FloatingPanelPanGestureRecognizer: UIPanGestureRecognizer { init() { super.init(target: nil, action: nil) - if #available(iOS 11.0, *) { - name = "FloatingPanelPanGestureRecognizer" - } + name = "FloatingPanelPanGestureRecognizer" } public override func touchesBegan(_ touches: Set, with event: UIEvent) { diff --git a/Sources/Extensions.swift b/Sources/Extensions.swift index 0b780a8..1848106 100644 --- a/Sources/Extensions.swift +++ b/Sources/Extensions.swift @@ -47,65 +47,16 @@ protocol LayoutGuideProvider { extension UILayoutGuide: LayoutGuideProvider {} extension UIView: LayoutGuideProvider {} -private class CustomLayoutGuide: LayoutGuideProvider { - let topAnchor: NSLayoutYAxisAnchor - let leftAnchor: NSLayoutXAxisAnchor - let bottomAnchor: NSLayoutYAxisAnchor - let rightAnchor: NSLayoutXAxisAnchor - let widthAnchor: NSLayoutDimension - let heightAnchor: NSLayoutDimension - init(topAnchor: NSLayoutYAxisAnchor, - leftAnchor: NSLayoutXAxisAnchor, - bottomAnchor: NSLayoutYAxisAnchor, - rightAnchor: NSLayoutXAxisAnchor, - widthAnchor: NSLayoutDimension, - heightAnchor: NSLayoutDimension) { - self.topAnchor = topAnchor - self.leftAnchor = leftAnchor - self.bottomAnchor = bottomAnchor - self.rightAnchor = rightAnchor - self.widthAnchor = widthAnchor - self.heightAnchor = heightAnchor - } -} - extension UIViewController { + /// The proxy property to be used in `LayoutAdapter` + /// + /// This property is to allow the safe area inset to change in unit testing @objc var fp_safeAreaInsets: UIEdgeInsets { - if #available(iOS 11.0, *) { - return view.safeAreaInsets - } else { - return UIEdgeInsets(top: topLayoutGuide.length, - left: 0.0, - bottom: bottomLayoutGuide.length, - right: 0.0) - } - } - - var fp_safeAreaLayoutGuide: LayoutGuideProvider { - if #available(iOS 11.0, *) { - return view!.safeAreaLayoutGuide - } else { - return CustomLayoutGuide(topAnchor: topLayoutGuide.bottomAnchor, - leftAnchor: view.leftAnchor, - bottomAnchor: bottomLayoutGuide.topAnchor, - rightAnchor: view.rightAnchor, - widthAnchor: view.widthAnchor, - heightAnchor: topLayoutGuide.bottomAnchor.anchorWithOffset(to: bottomLayoutGuide.topAnchor)) - } + return view.safeAreaInsets } } -// The reason why UIView has no extensions of safe area insets and top/bottom guides -// is for iOS10 compatibility. extension UIView { - var fp_safeAreaLayoutGuide: LayoutGuideProvider { - if #available(iOS 11.0, *) { - return safeAreaLayoutGuide - } else { - return self - } - } - var presentationFrame: CGRect { return layer.presentation()?.frame ?? frame } @@ -164,16 +115,9 @@ extension UIScrollView { var isLooselyLocked: Bool { return !showsVerticalScrollIndicator && isDirectionalLockEnabled } - var fp_contentInset: UIEdgeInsets { - if #available(iOS 11.0, *) { - return adjustedContentInset - } else { - return contentInset - } - } var fp_contentOffsetMax: CGPoint { - return CGPoint(x: max((contentSize.width + fp_contentInset.right) - bounds.width, 0.0), - y: max((contentSize.height + fp_contentInset.bottom) - bounds.height, 0.0)) + return CGPoint(x: max((contentSize.width + adjustedContentInset.right) - bounds.width, 0.0), + y: max((contentSize.height + adjustedContentInset.bottom) - bounds.height, 0.0)) } } diff --git a/Sources/Layout.swift b/Sources/Layout.swift index 45e6b14..f49a7d4 100644 --- a/Sources/Layout.swift +++ b/Sources/Layout.swift @@ -45,8 +45,8 @@ open class FloatingPanelBottomLayout: NSObject, FloatingPanelLayout { open func prepareLayout(surfaceView: UIView, in view: UIView) -> [NSLayoutConstraint] { return [ - surfaceView.leftAnchor.constraint(equalTo: view.fp_safeAreaLayoutGuide.leftAnchor, constant: 0.0), - surfaceView.rightAnchor.constraint(equalTo: view.fp_safeAreaLayoutGuide.rightAnchor, constant: 0.0), + surfaceView.leftAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leftAnchor, constant: 0.0), + surfaceView.rightAnchor.constraint(equalTo: view.safeAreaLayoutGuide.rightAnchor, constant: 0.0), ] } @@ -424,13 +424,13 @@ class LayoutAdapter { switch position { case .top, .bottom: surfaceConstraints = [ - surfaceView.leftAnchor.constraint(equalTo: vc.fp_safeAreaLayoutGuide.leftAnchor, constant: 0.0), - surfaceView.rightAnchor.constraint(equalTo: vc.fp_safeAreaLayoutGuide.rightAnchor, constant: 0.0), + surfaceView.leftAnchor.constraint(equalTo: vc.view.safeAreaLayoutGuide.leftAnchor, constant: 0.0), + surfaceView.rightAnchor.constraint(equalTo: vc.view.safeAreaLayoutGuide.rightAnchor, constant: 0.0), ] case .left, .right: surfaceConstraints = [ - surfaceView.topAnchor.constraint(equalTo: vc.fp_safeAreaLayoutGuide.topAnchor, constant: 0.0), - surfaceView.bottomAnchor.constraint(equalTo: vc.fp_safeAreaLayoutGuide.bottomAnchor, constant: 0.0), + surfaceView.topAnchor.constraint(equalTo: vc.view.safeAreaLayoutGuide.topAnchor, constant: 0.0), + surfaceView.bottomAnchor.constraint(equalTo: vc.view.safeAreaLayoutGuide.bottomAnchor, constant: 0.0), ] } } @@ -538,7 +538,7 @@ class LayoutAdapter { let layoutGuideProvider: LayoutGuideProvider switch anchor.referenceGuide { case .safeArea: - layoutGuideProvider = vc.fp_safeAreaLayoutGuide + layoutGuideProvider = vc.view.safeAreaLayoutGuide case .superview: layoutGuideProvider = vc.view } diff --git a/Sources/LayoutProperties.swift b/Sources/LayoutProperties.swift index 8f2355c..c33b410 100644 --- a/Sources/LayoutProperties.swift +++ b/Sources/LayoutProperties.swift @@ -37,7 +37,7 @@ extension FloatingPanelLayoutReferenceGuide { func layoutGuide(vc: UIViewController) -> LayoutGuideProvider { switch self { case .safeArea: - return vc.fp_safeAreaLayoutGuide + return vc.view.safeAreaLayoutGuide case .superview: return vc.view } @@ -57,7 +57,7 @@ extension FloatingPanelLayoutContentBoundingGuide { case .superview: return fpc.view case .safeArea: - return fpc.fp_safeAreaLayoutGuide + return fpc.view.safeAreaLayoutGuide case .none: return nil } diff --git a/Sources/SurfaceView.swift b/Sources/SurfaceView.swift index fd2e92a..31d1d63 100644 --- a/Sources/SurfaceView.swift +++ b/Sources/SurfaceView.swift @@ -383,29 +383,24 @@ public class SurfaceView: UIView { } containerView.layer.masksToBounds = true if position.inset(containerMargins) != 0 { - if #available(iOS 11, *) { - containerView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner, - .layerMinXMaxYCorner, .layerMaxXMaxYCorner] - } + containerView.layer.maskedCorners = [ + .layerMinXMinYCorner, .layerMaxXMinYCorner, + .layerMinXMaxYCorner, .layerMaxXMaxYCorner + ] return } - if #available(iOS 11, *) { - // Don't use `contentView.clipToBounds` because it prevents content view from expanding the height of a subview of it - // for the bottom overflow like Auto Layout settings of UIVisualEffectView in Main.storyboard of Example/Maps. - // Because the bottom of contentView must be fit to the bottom of a screen to work the `safeLayoutGuide` of a content VC. - switch position { - case .top: - containerView.layer.maskedCorners = [.layerMinXMaxYCorner, .layerMaxXMaxYCorner] - case .left: - containerView.layer.maskedCorners = [.layerMaxXMinYCorner, .layerMaxXMaxYCorner] - case .bottom: - containerView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner] - case .right: - containerView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMinXMaxYCorner] - } - } else { - // Can't use `containerView.layer.mask` because of a UIVisualEffectView issue in iOS 10, https://forums.developer.apple.com/thread/50854 - // Instead, a user should display rounding corners appropriately. + // Don't use `contentView.clipToBounds` because it prevents content view from expanding the height of a subview of it + // for the bottom overflow like Auto Layout settings of UIVisualEffectView in Main.storyboard of Example/Maps. + // Because the bottom of contentView must be fit to the bottom of a screen to work the `safeLayoutGuide` of a content VC. + switch position { + case .top: + containerView.layer.maskedCorners = [.layerMinXMaxYCorner, .layerMaxXMaxYCorner] + case .left: + containerView.layer.maskedCorners = [.layerMaxXMinYCorner, .layerMaxXMaxYCorner] + case .bottom: + containerView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner] + case .right: + containerView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMinXMaxYCorner] } } diff --git a/Tests/LayoutTests.swift b/Tests/LayoutTests.swift index 1adba1e..891c017 100644 --- a/Tests/LayoutTests.swift +++ b/Tests/LayoutTests.swift @@ -411,18 +411,18 @@ class LayoutTests: XCTestCase { for prop in [ // from top edge (anchor: FloatingPanelLayoutAnchor(absoluteInset: 0.0, edge: .top, referenceGuide: .safeArea), - result: (#line, constant: 0.0, firstAnchor: fpc.surfaceView.bottomAnchor, secondAnchor: fpc.fp_safeAreaLayoutGuide.topAnchor)), + result: (#line, constant: 0.0, firstAnchor: fpc.surfaceView.bottomAnchor, secondAnchor: fpc.view.safeAreaLayoutGuide.topAnchor)), (anchor: FloatingPanelLayoutAnchor(absoluteInset: 100.0, edge: .top, referenceGuide: .safeArea), - result: (#line, constant: 100.0, firstAnchor: fpc.surfaceView.bottomAnchor, secondAnchor: fpc.fp_safeAreaLayoutGuide.topAnchor)), + result: (#line, constant: 100.0, firstAnchor: fpc.surfaceView.bottomAnchor, secondAnchor: fpc.view.safeAreaLayoutGuide.topAnchor)), (anchor: FloatingPanelLayoutAnchor(absoluteInset: 0.0, edge: .top, referenceGuide: .superview), result: (#line, constant: 0.0, firstAnchor: fpc.surfaceView.bottomAnchor, secondAnchor: fpc.view.topAnchor)), (anchor: FloatingPanelLayoutAnchor(absoluteInset: 100.0, edge: .top, referenceGuide: .superview), result: (#line, constant: 100.0, firstAnchor: fpc.surfaceView.bottomAnchor, secondAnchor: fpc.view.topAnchor)), // from bottom edge (anchor: FloatingPanelLayoutAnchor(absoluteInset: 0.0, edge: .bottom, referenceGuide: .safeArea), - result: (#line, constant: 0.0, firstAnchor: fpc.fp_safeAreaLayoutGuide.bottomAnchor, secondAnchor: fpc.surfaceView.bottomAnchor)), + result: (#line, constant: 0.0, firstAnchor: fpc.view.safeAreaLayoutGuide.bottomAnchor, secondAnchor: fpc.surfaceView.bottomAnchor)), (anchor: FloatingPanelLayoutAnchor(absoluteInset: 100.0, edge: .bottom, referenceGuide: .safeArea), - result: (#line, constant: 100.0, firstAnchor: fpc.fp_safeAreaLayoutGuide.bottomAnchor, secondAnchor: fpc.surfaceView.bottomAnchor)), + result: (#line, constant: 100.0, firstAnchor: fpc.view.safeAreaLayoutGuide.bottomAnchor, secondAnchor: fpc.surfaceView.bottomAnchor)), (anchor: FloatingPanelLayoutAnchor(absoluteInset: 0.0, edge: .bottom, referenceGuide: .superview), result: (#line, constant: 0.0, firstAnchor: fpc.view.bottomAnchor, secondAnchor: fpc.surfaceView.bottomAnchor)), (anchor: FloatingPanelLayoutAnchor(absoluteInset: 100.0, edge: .bottom, referenceGuide: .superview), @@ -440,7 +440,7 @@ class LayoutTests: XCTestCase { (anchor: FloatingPanelLayoutAnchor(fractionalInset: 0.0, edge: .top, referenceGuide: .safeArea), result: (#line, multiplier: 1.0, secondAnchor: nil)), (anchor: FloatingPanelLayoutAnchor(fractionalInset: 0.5, edge: .top, referenceGuide: .safeArea), - result: (#line, multiplier: 0.5, secondAnchor: fpc.fp_safeAreaLayoutGuide.heightAnchor)), + result: (#line, multiplier: 0.5, secondAnchor: fpc.view.safeAreaLayoutGuide.heightAnchor)), (anchor: FloatingPanelLayoutAnchor(fractionalInset: 0.0, edge: .top, referenceGuide: .superview), result: (#line, multiplier: 1.0, secondAnchor: nil)), (anchor: FloatingPanelLayoutAnchor(fractionalInset: 0.5, edge: .top, referenceGuide: .superview), @@ -450,7 +450,7 @@ class LayoutTests: XCTestCase { (anchor: FloatingPanelLayoutAnchor(fractionalInset: 0.0, edge: .bottom, referenceGuide: .safeArea), result: (#line, multiplier: 1.0, secondAnchor: nil)), (anchor: FloatingPanelLayoutAnchor(fractionalInset: 0.5, edge: .bottom, referenceGuide: .safeArea), - result: (#line, multiplier: 0.5, secondAnchor: fpc.fp_safeAreaLayoutGuide.heightAnchor)), + result: (#line, multiplier: 0.5, secondAnchor: fpc.view.safeAreaLayoutGuide.heightAnchor)), (anchor: FloatingPanelLayoutAnchor(fractionalInset: 0.0, edge: .bottom, referenceGuide: .superview), result: (#line, multiplier: 1.0, secondAnchor: nil)), (anchor: FloatingPanelLayoutAnchor(fractionalInset: 0.5, edge: .bottom, referenceGuide: .superview), @@ -459,11 +459,7 @@ class LayoutTests: XCTestCase { let c = prop.anchor.layoutConstraints(fpc, for: position)[0] XCTAssertEqual(c.multiplier, CGFloat(prop.result.multiplier), line: UInt(prop.result.0)) XCTAssertTrue(c.firstAnchor is NSLayoutAnchor, line: UInt(prop.result.0)) - // On iOS 10, `c.secondAnchor` can't be equal object to `prop.result.secondAnchor` - // because there is no safe area on iOS 10 and `fp_safeAreaLayoutGuide` emulates it. - if #available(iOS 11, *) { - XCTAssertEqual(c.secondAnchor, prop.result.secondAnchor, line: UInt(prop.result.0)) - } + XCTAssertEqual(c.secondAnchor, prop.result.secondAnchor, line: UInt(prop.result.0)) } } func test_layoutAnchor_bottomPosition() { @@ -476,9 +472,9 @@ class LayoutTests: XCTestCase { for prop in [ // from top edge (anchor: FloatingPanelLayoutAnchor(absoluteInset: 0.0, edge: .top, referenceGuide: .safeArea), - result: (#line, constant: 0.0, firstAnchor: fpc.surfaceView.topAnchor, secondAnchor: fpc.fp_safeAreaLayoutGuide.topAnchor)), + result: (#line, constant: 0.0, firstAnchor: fpc.surfaceView.topAnchor, secondAnchor: fpc.view.safeAreaLayoutGuide.topAnchor)), (anchor: FloatingPanelLayoutAnchor(absoluteInset: 100.0, edge: .top, referenceGuide: .safeArea), - result: (#line, constant: 100.0, firstAnchor: fpc.surfaceView.topAnchor, secondAnchor: fpc.fp_safeAreaLayoutGuide.topAnchor)), + result: (#line, constant: 100.0, firstAnchor: fpc.surfaceView.topAnchor, secondAnchor: fpc.view.safeAreaLayoutGuide.topAnchor)), (anchor: FloatingPanelLayoutAnchor(absoluteInset: 0.0, edge: .top, referenceGuide: .superview), result: (#line, constant: 0.0, firstAnchor: fpc.surfaceView.topAnchor, secondAnchor: fpc.view.topAnchor)), (anchor: FloatingPanelLayoutAnchor(absoluteInset: 100.0, edge: .top, referenceGuide: .superview), @@ -486,9 +482,9 @@ class LayoutTests: XCTestCase { // from bottom edge (anchor: FloatingPanelLayoutAnchor(absoluteInset: 0.0, edge: .bottom, referenceGuide: .safeArea), - result: (#line, constant: 0.0, firstAnchor: fpc.fp_safeAreaLayoutGuide.bottomAnchor, secondAnchor: fpc.surfaceView.topAnchor)), + result: (#line, constant: 0.0, firstAnchor: fpc.view.safeAreaLayoutGuide.bottomAnchor, secondAnchor: fpc.surfaceView.topAnchor)), (anchor: FloatingPanelLayoutAnchor(absoluteInset: 100.0, edge: .bottom, referenceGuide: .safeArea), - result: (#line, constant: 100.0, firstAnchor: fpc.fp_safeAreaLayoutGuide.bottomAnchor, secondAnchor: fpc.surfaceView.topAnchor)), + result: (#line, constant: 100.0, firstAnchor: fpc.view.safeAreaLayoutGuide.bottomAnchor, secondAnchor: fpc.surfaceView.topAnchor)), (anchor: FloatingPanelLayoutAnchor(absoluteInset: 0.0, edge: .bottom, referenceGuide: .superview), result: (#line, constant: 0.0, firstAnchor: fpc.view.bottomAnchor, secondAnchor: fpc.surfaceView.topAnchor)), (anchor: FloatingPanelLayoutAnchor(absoluteInset: 100.0, edge: .bottom, referenceGuide: .superview), @@ -506,7 +502,7 @@ class LayoutTests: XCTestCase { (anchor: FloatingPanelLayoutAnchor(fractionalInset: 0.0, edge: .top, referenceGuide: .safeArea), result: (#line, multiplier: 1.0, secondAnchor: nil)), (anchor: FloatingPanelLayoutAnchor(fractionalInset: 0.5, edge: .top, referenceGuide: .safeArea), - result: (#line, multiplier: 0.5, secondAnchor: fpc.fp_safeAreaLayoutGuide.heightAnchor)), + result: (#line, multiplier: 0.5, secondAnchor: fpc.view.safeAreaLayoutGuide.heightAnchor)), (anchor: FloatingPanelLayoutAnchor(fractionalInset: 0.0, edge: .top, referenceGuide: .superview), result: (#line, multiplier: 1.0, secondAnchor: nil)), (anchor: FloatingPanelLayoutAnchor(fractionalInset: 0.5, edge: .top, referenceGuide: .superview), @@ -516,7 +512,7 @@ class LayoutTests: XCTestCase { (anchor: FloatingPanelLayoutAnchor(fractionalInset: 0.0, edge: .bottom, referenceGuide: .safeArea), result: (#line, multiplier: 1.0, secondAnchor: nil)), (anchor: FloatingPanelLayoutAnchor(fractionalInset: 0.5, edge: .bottom, referenceGuide: .safeArea), - result: (#line, multiplier: 0.5, secondAnchor: fpc.fp_safeAreaLayoutGuide.heightAnchor)), + result: (#line, multiplier: 0.5, secondAnchor: fpc.view.safeAreaLayoutGuide.heightAnchor)), (anchor: FloatingPanelLayoutAnchor(fractionalInset: 0.0, edge: .bottom, referenceGuide: .superview), result: (#line, multiplier: 1.0, secondAnchor: nil)), (anchor: FloatingPanelLayoutAnchor(fractionalInset: 0.5, edge: .bottom, referenceGuide: .superview), @@ -525,12 +521,7 @@ class LayoutTests: XCTestCase { let c = prop.anchor.layoutConstraints(fpc, for: position)[0] XCTAssertEqual(c.multiplier, CGFloat(prop.result.multiplier), line: UInt(prop.result.0)) XCTAssertTrue(c.firstAnchor is NSLayoutAnchor, line: UInt(prop.result.0)) - // On iOS 10, `c.secondAnchor` can't be equal object to `prop.result.secondAnchor` - // because there is no safe area on iOS 10 and `fp_safeAreaLayoutGuide` emulates it. - if #available(iOS 11, *) { - XCTAssertEqual(c.secondAnchor, prop.result.secondAnchor, line: UInt(prop.result.0)) - } - print(c) + XCTAssertEqual(c.secondAnchor, prop.result.secondAnchor, line: UInt(prop.result.0)) } } @@ -556,20 +547,20 @@ class LayoutTests: XCTestCase { for prop in [ (anchor: FloatingPanelIntrinsicLayoutAnchor(absoluteOffset: 0.0, referenceGuide: .safeArea), - result: (#line, constant: 420, firstAnchor: fpc.surfaceView.bottomAnchor, secondAnchor: fpc.fp_safeAreaLayoutGuide.topAnchor)), + result: (#line, constant: 420, firstAnchor: fpc.surfaceView.bottomAnchor, secondAnchor: fpc.view.safeAreaLayoutGuide.topAnchor)), (anchor: FloatingPanelIntrinsicLayoutAnchor(absoluteOffset: 42.0, referenceGuide: .safeArea), - result: (#line, constant: 420 - 42, firstAnchor: fpc.surfaceView.bottomAnchor, secondAnchor: fpc.fp_safeAreaLayoutGuide.topAnchor)), + result: (#line, constant: 420 - 42, firstAnchor: fpc.surfaceView.bottomAnchor, secondAnchor: fpc.view.safeAreaLayoutGuide.topAnchor)), (anchor: FloatingPanelIntrinsicLayoutAnchor(absoluteOffset: 0.0, referenceGuide: .superview), result: (#line, constant: 420, firstAnchor: fpc.surfaceView.bottomAnchor, secondAnchor: fpc.view.topAnchor)), (anchor: FloatingPanelIntrinsicLayoutAnchor(absoluteOffset: 42.0, referenceGuide: .superview), result: (#line, constant: 420 - 42, firstAnchor: fpc.surfaceView.bottomAnchor, secondAnchor: fpc.view.topAnchor)), (anchor: FloatingPanelIntrinsicLayoutAnchor(fractionalOffset: 0.0, referenceGuide: .safeArea), - result: (#line, constant: 420, firstAnchor: fpc.surfaceView.bottomAnchor, secondAnchor: fpc.fp_safeAreaLayoutGuide.topAnchor)), + result: (#line, constant: 420, firstAnchor: fpc.surfaceView.bottomAnchor, secondAnchor: fpc.view.safeAreaLayoutGuide.topAnchor)), (anchor: FloatingPanelIntrinsicLayoutAnchor(fractionalOffset: 0.5, referenceGuide: .safeArea), - result: (#line, constant: 210, firstAnchor: fpc.surfaceView.bottomAnchor, secondAnchor: fpc.fp_safeAreaLayoutGuide.topAnchor)), + result: (#line, constant: 210, firstAnchor: fpc.surfaceView.bottomAnchor, secondAnchor: fpc.view.safeAreaLayoutGuide.topAnchor)), (anchor: FloatingPanelIntrinsicLayoutAnchor(fractionalOffset: 1.0, referenceGuide: .safeArea), - result: (#line, constant: 0, firstAnchor: fpc.surfaceView.bottomAnchor, secondAnchor: fpc.fp_safeAreaLayoutGuide.topAnchor)), + result: (#line, constant: 0, firstAnchor: fpc.surfaceView.bottomAnchor, secondAnchor: fpc.view.safeAreaLayoutGuide.topAnchor)), (anchor: FloatingPanelIntrinsicLayoutAnchor(fractionalOffset: 0.0, referenceGuide: .superview), result: (#line, constant: 420, firstAnchor: fpc.surfaceView.bottomAnchor, secondAnchor: fpc.view.topAnchor)), (anchor: FloatingPanelIntrinsicLayoutAnchor(fractionalOffset: 0.5, referenceGuide: .superview), @@ -606,20 +597,20 @@ class LayoutTests: XCTestCase { for prop in [ (anchor: FloatingPanelIntrinsicLayoutAnchor(absoluteOffset: 0.0, referenceGuide: .safeArea), - result: (#line, constant: -420, firstAnchor: fpc.surfaceView.topAnchor, secondAnchor: fpc.fp_safeAreaLayoutGuide.bottomAnchor)), + result: (#line, constant: -420, firstAnchor: fpc.surfaceView.topAnchor, secondAnchor: fpc.view.safeAreaLayoutGuide.bottomAnchor)), (anchor: FloatingPanelIntrinsicLayoutAnchor(absoluteOffset: 42.0, referenceGuide: .safeArea), - result: (#line, constant: -420 + 42, firstAnchor: fpc.surfaceView.topAnchor, secondAnchor: fpc.fp_safeAreaLayoutGuide.bottomAnchor)), + result: (#line, constant: -420 + 42, firstAnchor: fpc.surfaceView.topAnchor, secondAnchor: fpc.view.safeAreaLayoutGuide.bottomAnchor)), (anchor: FloatingPanelIntrinsicLayoutAnchor(absoluteOffset: 0.0, referenceGuide: .superview), result: (#line, constant: -420, firstAnchor: fpc.surfaceView.topAnchor, secondAnchor: fpc.view.bottomAnchor)), (anchor: FloatingPanelIntrinsicLayoutAnchor(absoluteOffset: 42.0, referenceGuide: .superview), result: (#line, constant: -420 + 42, firstAnchor: fpc.surfaceView.topAnchor, secondAnchor: fpc.view.bottomAnchor)), (anchor: FloatingPanelIntrinsicLayoutAnchor(fractionalOffset: 0.0, referenceGuide: .safeArea), - result: (#line, constant: -420, firstAnchor: fpc.surfaceView.topAnchor, secondAnchor: fpc.fp_safeAreaLayoutGuide.bottomAnchor)), + result: (#line, constant: -420, firstAnchor: fpc.surfaceView.topAnchor, secondAnchor: fpc.view.safeAreaLayoutGuide.bottomAnchor)), (anchor: FloatingPanelIntrinsicLayoutAnchor(fractionalOffset: 0.5, referenceGuide: .safeArea), - result: (#line, constant: -210, firstAnchor: fpc.surfaceView.topAnchor, secondAnchor: fpc.fp_safeAreaLayoutGuide.bottomAnchor)), + result: (#line, constant: -210, firstAnchor: fpc.surfaceView.topAnchor, secondAnchor: fpc.view.safeAreaLayoutGuide.bottomAnchor)), (anchor: FloatingPanelIntrinsicLayoutAnchor(fractionalOffset: 1.0, referenceGuide: .safeArea), - result: (#line, constant: 0, firstAnchor: fpc.surfaceView.topAnchor, secondAnchor: fpc.fp_safeAreaLayoutGuide.bottomAnchor)), + result: (#line, constant: 0, firstAnchor: fpc.surfaceView.topAnchor, secondAnchor: fpc.view.safeAreaLayoutGuide.bottomAnchor)), (anchor: FloatingPanelIntrinsicLayoutAnchor(fractionalOffset: 0.0, referenceGuide: .superview), result: (#line, constant: -420, firstAnchor: fpc.surfaceView.topAnchor, secondAnchor: fpc.view.bottomAnchor)), (anchor: FloatingPanelIntrinsicLayoutAnchor(fractionalOffset: 0.5, referenceGuide: .superview),