SwiftUI DatePicker Binding optional Date, valid nil

I’m experimenting code from https://alanquatermain.me/programming/swiftui/2019-11-15-CoreData-and-bindings/ my goal is to have DatePicker bind to Binding< Date? > which allow for nil value instead of initiate to Date(); this is useful, if you have Date attribute in your core data model entity which accept nil as valid value. Here is my swift playground code: extension Binding {…

RxSwift: Pass actual observable to another view controller?

I have a view controller that needs to know about a boolean variable headerCollapsed that is set from another view controller. In vc1 I have: headerCollapsed = ReplaySubject<Bool>.create(bufferSize: 1) collapsedObservable = headerCollapsed.asObservable() and a function that sets the boolean to true: func updateHeader self.headerCollapsed.onNext(true) end Then, to avoid creating further dependencies and calling vc1 directly,…

Get X-WP-Total headers with Swift

In WordPress REST API Hanbdook is written what: To determine how many pages of data are available, the API returns two header fields with every paginated response: X-WP-Total: the total number of records in the collection X-WP-TotalPages: the total number of pages encompassing all available records https://developer.wordpress.org/rest-api/using-the-rest-api/pagination/#pagination-parameters How I can get this data with Swift?