Post

Replies

Boosts

Views

Created

SwiftUI Preview Sheet w/o Running Live Preview?
(Cross post from: Stack Overflow - https://stackoverflow.com/questions/64096402/swiftui-preview-sheet-w-o-running-live-preview) Is it possible to create a SwiftUI preview of a presented sheet without running the Live Preview? For example: struct Sheet_Previews: PreviewProvider { static var previews: some View { Text("Background").sheet(isPresented: .constant(true)) { Text("Sheet") } } } The above results in the following preview: (See image 1 on Stack Overflow - https://stackoverflow.com/questions/64096402/swiftui-preview-sheet-w-o-running-live-preview) In order for the sheet content to be presented in the preview, you must run the Live Preview: (See image 2 on Stack Overflow - https://stackoverflow.com/questions/64096402/swiftui-preview-sheet-w-o-running-live-preview)
2
0
3.1k
Sep ’20
Get SectionIdentifier from DiffableDataSource using IndexPath
When using either UICollectionViewDiffableDataSource or UITableViewDiffableDataSource, what is the "correct/safe" way to get the section identifier from an index path?snapshot().sectionIdentifiers[indexPath.section]orguard let item = itemIdentifier(for: indexPath) else { return } snapshot().sectionIdentifier(containingItem: item)?
Topic: UI Frameworks SubTopic: UIKit Tags:
3
0
2.3k
Jan ’20