Post

Replies

Boosts

Views

Activity

How to set the filename of Transferable according to each instance?
It seems that the modifier func suggestedFileName(_ fileName: String) -> some TransferRepresentation can only set the filename for the entire Transferable type. What I want is to set the filename for each instance. Every instance of a Transferable type shouldn't have the same filename. static var transferRepresentation: some TransferRepresentation { FileRepresentation(exportedContentType: .myType) { myTransferable in         let url = try await myTransferable.exportedFileUrl()         return SentTransferredFile(url) /* maybe set the specific filename on SentTransferredFile? */     } .suggestedFileName("Unnamed") // maybe this should be a fallback filename }
1
0
956
Jun ’22
.fistTextbaseline alignment does not work with LazyVStack
The second HStack's content cannot be correctly aligned. Is this a SwiftUI's bug? Text("Alignment with VStack") HStack(alignment: .firstTextBaseline) { Text("·") VStack { Text("LARGE TITLE") Text("LARGE TITLE") } .font(.largeTitle) } Divider() Text("Alignment with Lazy VStack") HStack(alignment: .firstTextBaseline) { Text("·") LazyVStack { Text("LARGE TITLE") Text("LARGE TITLE") } .font(.largeTitle) }
0
0
427
May ’22