klarna / klarna-mobile-sdk

Klarna Mobile SDK for iOS
https://docs.klarna.com/mobile-sdk/ios/
Apache License 2.0
29 stars 12 forks source link

Clear background and reusing window #119

Open Hoderu opened 3 years ago

Hoderu commented 3 years ago

Describe the bug It is a bug connected with transparent navigation bar color. And so we can see the layers below.

To Reproduce Steps to reproduce the behavior:

  1. Install version 2.1.0 of KlarnaMobileSDK
  2. Update Xcode to version 13.0
  3. Open Pay now option
  4. Choose "Terms for the Klarna Shopping Sevice"
  5. See clear UINavigationBar color inside ProgressNavigationController

Expected behavior A solid color, for example: white. Or color related with system theme.

Screenshots

Снимок экрана 2021-11-16 в 19 09 29

Device and version:

Merchant Name I'd rather not state this here unless absolutely necessary.

Impact Level This is an unpleasant mistake for which I had to make a workaround using UIAppearance.

Additional context While I was researching the problem, I found another minor issue. If we open and close the "Terms for the Klarna Shopping Sevice" multiple times we will see a lot of extra windows inside UIWindowScene.windows array: <__NSArrayM 0x600003dda250>( <KlarnaMobileSDK.KlarnaWindow: 0x7fd410f12590; baseClass = UIWindow; frame = (0 0; 428 926); hidden = YES; gestureRecognizers = <NSArray: 0x600003997e70>; layer = <UIWindowLayer: 0x6000039959b0>>,

<KlarnaMobileSDK.KlarnaWindow: 0x7fd41206c970; baseClass = UIWindow; frame = (0 0; 428 926); hidden = YES; gestureRecognizers = <NSArray: 0x600007a9fea0>; layer = <UIWindowLayer: 0x600007a9ec10>>,

<KlarnaMobileSDK.KlarnaWindow: 0x7fd3fa9977f0; baseClass = UIWindow; frame = (0 0; 428 926); hidden = YES; gestureRecognizers = <NSArray: 0x60000a7aa4c0>; layer = <UIWindowLayer: 0x60000a7a9cb0>>,

<KlarnaMobileSDK.KlarnaWindow: 0x7fd3cd631670; baseClass = UIWindow; frame = (0 0; 428 926); gestureRecognizers = <NSArray: 0x60000bcdc3c0>; layer = <UIWindowLayer: 0x60000bcde280>>, …

I think there is a bug that every time a new window is created instead of reusing the old one.