Hitting this too and wondering how much longer Apple is going to subject us to this awful project file stuff.
For heaven sake, adopt a declarative syntax like SPM. One that we can actually use with git effectively.
Post
Replies
Boosts
Views
Activity
Well this works, even though it seems odd to stick the picker inside the menu.
Menu {
Picker("Sleep Timer", selection: $sleepTimerDuration) {
Text("Off").tag(0)
Text("5 Minutes").tag(5)
Text("10 Minutes").tag(10)
Text("15 Minutes").tag(15)
Text("30 Minutes").tag(30)
Text("45 Minutes").tag(45)
Text("1 Hour").tag(60)
}
} label: {
Image(systemName: "moon.zzz.fill")
.resizable()
.tint(.white)
.frame(width: 34, height: 34)
.padding()
}
Ok seems I have to change presentDocument to:
func presentDocument(at documentURL: URL) {
let navVC = UINavigationController()
let doc = Document(fileURL: documentURL)
let docVC = UIDocumentViewController(document: doc)
navVC.modalPresentationStyle = .fullScreen
navVC.addChild(docVC)
present(navVC, animated: true, completion: nil)
}
So embed the UIDocumentViewController inside a UINavigationController.
I found the sample code for the WWDC video (https://developer.apple.com/documentation/uikit/app_and_environment/supporting_desktop-class_features_in_your_ipad_app), but having trouble figuring out which part actually creates the toolbar.
@julia_brockovich FB13439586
@julia_brockovich iOS. Seems to do the right thing on macOS (I just created a test project)
DTS confirmed that the rejection was an error.
Sorry, I don't have a sample project.
Feedback is FB12834920. Thanks!
@Graphics and Games Engineer I'm using this for my payload for both intersection functions:
typedef struct {
vector_float3 normal;
vector_float3 color;
} IntersectionPayload;
(sorry I can't seem to get the code block to render correctly). It just returns the surface normal and color from the intersection function. I think that's a trivial usage.
I'm guessing right now the best you can do is present the onboarding when the user opens/creates a document for the first time. Not so bad really.
And as far as my trails, the ReferenceFileDocument cannot trigger any write operation :(*. You have to call registerUndo on the UndoManager in the environment to trigger a save:
@Environment(\.undoManager) var undoManager
This seems to work, but I'm not sure how brittle it is:
for window in UIApplication.shared.windows where window.isKeyWindow {
		window.rootViewController?.dismiss(animated: true, completion: nil)
		break
}