Post

Replies

Boosts

Views

Activity

Reply to SwiftUI view printout on paper
Got it working. I wrapped my SwiftUI View to be printed(and displayed) in a local function like this: private func generateView() -> some View { VStack { .... } } Then I created a func to save the some View as a PDF in the document directory using ImageRenderer. The func also returns the PDF's URL which was created using URL.documentsDirectory.appending(path:) Then I created another func using UIPrintInteractionController and the PDF's URL to present the print controller for the saved pdf.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’24
Reply to SwiftUI view printout on paper
Got it working. I wrapped my SwiftUI View to be printed(and displayed) in a local function like this: private func generateView() -> some View { VStack { .... } } Then I created a func to save the some View as a PDF in the document directory using ImageRenderer. The func also returns the PDF's URL which was created using URL.documentsDirectory.appending(path:) Then I created another func using UIPrintInteractionController and the PDF's URL to present the print controller for the saved pdf.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’24
Reply to xcode 14 freezes when running multiple tests in xctestplan
I'm having the same problem. Is this only with Intel computers?
Replies
Boosts
Views
Activity
Nov ’22
Reply to Using print()
This works as well. let _ = print()
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to SwiftUI Previews - Disk space issue
Suggested by an Apple Frameworks engineer: xcrun simctl --set previews delete all My Previews folder was 110GB and went to 6GB. Everything seems to be working well.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to xib file
After selecting Xcode's menu File->New->File, select View in the User Interface group. View will create a .xib file. (This applies to iOS, MacOS and TVOS but not WatchOS.)
Replies
Boosts
Views
Activity
Jun ’22
Reply to Xcode 12 Beta "Cannot preview in this file"
I received the same error. In my case, closing and reopening the project fixed the problem.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’21