Open shahedhossain opened 4 years ago
I have not built it for SwiftUI, that is true. If however you would like to add this support and do a Pull Request I would be forever grateful ;-)
@shahedhossain It works with SwiftUI. The common problem is having keyboard on screen, when presenting UIViewRepresented view (or any other actually). Zero or negative size assertion seems not to cause problems.
Hello @suvov. Good day! Actually we are stacked on it. It would be best if you share your code snippet to the community to resolve such issues.
Hello @shahedhossain ! What I do is resign first responders (if any) before presenting the calendar. It might look like this in code:
// Resign first responder, using UIKit (
UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
// Present view with calendar
self.isCalendarPresented = true
Might look like this in context:
Button(action: {
UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
self.isCalendarPresented = true
}, label: {
Image(systemName: "calendar")
}).sheet(isPresented: $isCalendarPresented, content: {
self.calendarView()
})
Hope this helps, have a good day!
MyCalendar
structure for getting support inSwiftUI
as following:It's shows only the week name and other parts of this calendar omitted from view and following errors occurred:
Please find the details in StackOverflow