Difference between running an app through Xcode and running after installing through TestFlight or App Store?

So I've been dealing with an issue when my app where a bug happens only when the app has been downloaded from App Store or TestFlight, when compiled/run directly to the device from Xcode the function works exactly as it should. Could this be some sort of iOS bug?


The problem code is as follows:

extension UIApplication {
    public var isSplitOrSlideOver: Bool {
        guard let w = self.delegate?.window, let window = w else { return false }
        return !window.frame.equalTo(window.screen.bounds)
    }
}


The issue is it always returns false on a TestFlight or App Store build, but returns appropriately directly through Xcode to the device.


Any ideas?

Accepted Reply

Well, I figured this out. The self.delegate?.window.frame.height reports 980 when the build goes through TestFlight or App Store, but reports 1024 when ran directly on the device through Xcode. This definitelty isn't correct behavior, but the fix in this case was to check just the width's of the frame and screen.bounds.


Hopefully the right people will see this to look into this further.

Replies

Well, I figured this out. The self.delegate?.window.frame.height reports 980 when the build goes through TestFlight or App Store, but reports 1024 when ran directly on the device through Xcode. This definitelty isn't correct behavior, but the fix in this case was to check just the width's of the frame and screen.bounds.


Hopefully the right people will see this to look into this further.