Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make it usable for macOS and iOS #2

Merged
merged 2 commits into from Mar 25, 2023
Merged

make it usable for macOS and iOS #2

merged 2 commits into from Mar 25, 2023

Conversation

sakrist
Copy link
Contributor

@sakrist sakrist commented Mar 24, 2023

I've added SwiftUI view. Can be used for prototyping on macOS.
Screenshot 2023-03-24 at 22 58 55

@heckj heckj self-requested a review March 24, 2023 23:06
@heckj heckj self-assigned this Mar 24, 2023
Copy link
Owner

@heckj heckj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @sakrist, this generally looks great, thank you!

I've got a few changes I'd prefer you make before merging it, to keep things clean, docs accurate, etc. And in a few places, I've asked for details so that I can back-fill in documentation on the added RealityView. I don't expect you to update all the docs, but I would like details about what all the pieces are and their intentions so that I can do so after merging this addition to support iOS as well as macOS.

Sources/CameraControlARView/ARViewContainer.swift Outdated Show resolved Hide resolved
Sources/CameraControlARView/ARViewContainer.swift Outdated Show resolved Hide resolved
Sources/CameraControlARView/ARViewContainer.swift Outdated Show resolved Hide resolved
var cancellables = [Cancellable]()

public struct RealityKitView: View {
public typealias UpdateBlock = () -> Void
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this (UpdateBlock) is public, give me some detail of what it's being used for, and why a developer would include an updateBlock closure in their RealityKitView initializer. (Ideally, this would have documentation to explain it - but I'm happy to write it up if you can detail what the intent is for me)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to remove alias :)

self.update = update

if let update = self.update {
let updateCa = arContainer.arView.scene.subscribe(to: SceneEvents.Update.self) { event in
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we name updateCa a more descriptive variable? I'm a little confused on this point - it makes sense to get the various SceneEvents as they're triggered, but you're not passing them down into the closure, so I'm not understanding the purpose of this all.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will rename updateCa to updateCancellable probably forget to finish typing :)

Idea with update is that we can do something each frame. Update is optional argument.

Copy link
Owner

@heckj heckj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for the detail!

@heckj heckj merged commit 199e0f7 into heckj:main Mar 25, 2023
@sakrist
Copy link
Contributor Author

sakrist commented Feb 4, 2024

@heckj should we rename RealityKitView to RealityView? 😉

@heckj
Copy link
Owner

heckj commented Feb 4, 2024

As a lower level component, I think keeping it named for the renderer that it presents (and not shortening it) makes a lot more sense.

@sakrist
Copy link
Contributor Author

sakrist commented Feb 4, 2024

I might redesign it and will make proposal request. This actually inspired me at the time :)
https://developer.apple.com/documentation/realitykit/realityview/

@heckj
Copy link
Owner

heckj commented Feb 4, 2024

Sounds great - it's an interesting design. And all the more reason (IMO) to not call it RealityView to keep from confusing it with a (new) extant Apple class for SwiftUI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants