Browse Source

AppCoordinator: Fix round corners

For some unknown reason, reading tabBarController anchors
sets round corners for the entire app.
A workaround is to set cornerRadius to 0 for the topmost layer
so there are no round corners anymore.

Closes #662
Edgar Fouillet 5 years ago
parent
commit
6478c4be82
1 changed files with 7 additions and 0 deletions
  1. 7 0
      Sources/Coordinators/AppCoordinator.swift

+ 7 - 0
Sources/Coordinators/AppCoordinator.swift

@@ -49,6 +49,13 @@ class Services: NSObject {
                                                            right: 0)
         playerDisplayController.realBottomAnchor = tabBarController.tabBar.topAnchor
         playerDisplayController.didMove(toParent: tabBarController)
+
+        // Set app cornerRadius back to 0
+        // For some unknown reason, reading tabBarController anchors sets round corners for the entire app.
+        // We set cornerRadius to 0 for the topmost layer so there are no round corners anymore.
+        if #available(iOS 13, *) {
+            tabBarController.view.layer.superlayer?.cornerRadius = 0
+        }
     }
 
     @objc func start() {