Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rotation change current month #1

Open
a-Mo7 opened this issue May 5, 2022 · 1 comment
Open

Rotation change current month #1

a-Mo7 opened this issue May 5, 2022 · 1 comment

Comments

@a-Mo7
Copy link

a-Mo7 commented May 5, 2022

Hello,

I was trying to use your sample of Information+Selection in an iPad app, and I realized that the controller yearMonth is changing on device rotation.

Same thing happens on the sample project without any modification.

It is noticeable looking at the first day of the month.

@BootMaker
Copy link

It's a known problem of the tabview, during rotation the tabview rerenders again and change the selected tab.
Possible workaround:

.onReceive(NotificationCenter.default.publisher(for: UIDevice.orientationDidChangeNotification)) { info in
    let currentTab = selectedTab
    DispatchQueue.main.async {
       if currentTab != selectedTab {
          selectedTab = currentTab
       }
     }
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants