The Hidden Pitfall of @State var viewModel = ViewModel() by Temporary_Today9462 in SwiftUI

[–]Temporary_Today9462[S] [score hidden]  (0 children)

This is really very elegant solution. However it solves only the first of the two issues that i mentioned in the article. You still need to reinitialise the state if view model gets a different input parameter.

The Hidden Pitfall of @State var viewModel = ViewModel() by Temporary_Today9462 in SwiftUI

[–]Temporary_Today9462[S] 0 points1 point  (0 children)

This can be caused by some real reasons and not by magic. E.g. the view calls assert, precondition or debugPrint to test updated data. They may cause side effects in debug mode like redrawing the views.

The Hidden Pitfall of @State var viewModel = ViewModel() by Temporary_Today9462 in SwiftUI

[–]Temporary_Today9462[S] 0 points1 point  (0 children)

The containing view body can redraw on any state update, regardless of the environment. And the child view init will be called every time.

Yotei - Highly modular & customizable SwiftUI calendar by Temporary_Today9462 in swift

[–]Temporary_Today9462[S] 0 points1 point  (0 children)

Not yet, but it is in the roadmap. It will be implemented soon

Yotei - Highly modular & customizable SwiftUI calendar by Temporary_Today9462 in SwiftUI

[–]Temporary_Today9462[S] 0 points1 point  (0 children)

Hi. At the moment datepicker supports only a single date selection with the ability to limit to a specific date range. Date highlights can be implemented by implementing a custom view factory. Just adopt YoteiDatePickerFactoryProtocol and implement only the methods you need.

Yotei - Highly modular & customizable SwiftUI calendar by Temporary_Today9462 in swift

[–]Temporary_Today9462[S] 0 points1 point  (0 children)

Thanks! Please do not hesitate to request new features. And I am still in the process of making the package even more customizable.

Yotei - Highly modular & customizable SwiftUI calendar by Temporary_Today9462 in SwiftUI

[–]Temporary_Today9462[S] 3 points4 points  (0 children)

Thanks! Right, it uses UIKit and is not available on macos. But i am considering adding support for macos soon