I'm making a project and fighting with the problem with the black borders - I can't understand why my background is not on a full screen. It seems like the anchors are right, maybe the problem is in SceneDelegate, but I don't know exactly.
Here is my SceneDelegate code:
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let windowScene = (scene as? UIWindowScene) else { return }
self.window = UIWindow(frame: windowScene.coordinateSpace.bounds)
self.window?.windowScene = windowScene
window?.rootViewController = DetailsViewController()
window?.makeKeyAndVisible()
}
And here is my ViewController:
private let detailsView = DetailsView() // view where backgroundImage and cat picture exist
private func setupLayout() { // method for setting constraints for view
view.addSubview(detailsView)
detailsView.centerXAnchor.constraint(equalTo: view.safeAreaLayoutGuide.centerXAnchor).isActive = true
detailsView.centerYAnchor.constraint(equalTo: view.safeAreaLayoutGuide.centerYAnchor).isActive = true
}
If you know how to fix this problem, please share with me. I tried to Google it but failed.