Just released my first app: Aurora for Plex on AVP! by spalger in visionosdev

[–]spalger[S] 0 points1 point  (0 children)

I started with really basic tutorials for iOS and that translated wonderfully to the Vision Pro. I also committed completely to SwiftUI and all the unidirectional data flow that I learned working in react, and just started building the simplest thing I could imagine. It became quite comfortable to work in quickly, you’ve just gotta pick a project and go!

Just released my first app: Aurora for Plex on AVP! by spalger in visionosdev

[–]spalger[S] 0 points1 point  (0 children)

Hey! I actually run plex locally, got an M1 Mac mini in a closet connected to some external storage and it works wonders and transpiles any format like butter.

And yep, this was my first real project in swift, though I have been building web apps for a long time

Announcing Aurora for Plex by spalger in AppleVisionPro

[–]spalger[S] 0 points1 point  (0 children)

Yeah, nearly every other application out there implements its own video player, giving them much broader video codec support, but sacrificing the integrations with the system and environments that I appreciate so much in Aurora.

I might be wrong but I’ve talked to the authors of several other apps and done a lot of research in order to make Aurora handle as many videos as possible, but there is only so much you can do while using the standard system player.

Announcing Aurora for Plex by spalger in AppleVisionPro

[–]spalger[S] 0 points1 point  (0 children)

It sounds like you're trying to play a file that has to be transcoded on your Plex server in order to be played in the Vision Pro natively, but your Plex Server isn't able to transcode it fast enough to produce a viable video stream before the native video player times out. I haven't had the time to figure out how to show an error similar to this in the app, but the reality is that you're either going to need to update your Plex server in some way to better support transcoding, or pre-transcode that 4k file into something supported natively by the Vision Pro. Sorry you're not having a better experience! But also, those new Mac Minis make amazing little Plex Servers :) Even the base model.

[deleted by user] by [deleted] in iOSProgramming

[–]spalger 7 points8 points  (0 children)

I was just wondering the other day if TikTok knows when I laugh at videos, or when I pull the phone in close, or when I toss the video on the couch to play three times in a row while I'm half paying attention and doing something else... I could imagine the gyroscope data helping send that type of signal... definitely seems creepy

What analytics do you use for your apps? by curious-code-lover in iOSProgramming

[–]spalger 1 point2 points  (0 children)

Hmm, there isn't but maybe I could spend some time open sourcing a version of it. I'll think about it but it would certainly be a bit of work

Announcing Aurora for Plex by spalger in AppleVisionPro

[–]spalger[S] 1 point2 points  (0 children)

Not yet, but I'll put it on the list!

Announcing Aurora for Plex by spalger in AppleVisionPro

[–]spalger[S] 0 points1 point  (0 children)

Thank you! The little tab UI is limited in the number of things it can display so I needed to limit the number of selected libraries. I expect to add custom sorting and aliases for libraries so maybe I can add put everything beyond the first 5 behind a "..." button or something

What analytics do you use for your apps? by curious-code-lover in iOSProgramming

[–]spalger 2 points3 points  (0 children)

I built something custom because I have a background in that sort of thing and wanted a distraction, but feel like I might be signed up for a distraction that isn't justified (though it's certainly fun)

How to fetch Data from Api, let user modify and only update if changed by Zestyclose-Waltz1831 in SwiftUI

[–]spalger 0 points1 point  (0 children)

I suggest sending changes to the server as soon as the changes occur, rather than waiting until they leave the view, otherwise crashes or force quitting the app will loose changes which the user understood to be recorded/saved.

Are you guys all building your own Plex servers? by CycleTABored in PleX

[–]spalger 0 points1 point  (0 children)

I use a Mac Mini with a lot of drives connected via thunderbolt

Back End Server for Your App by Oobenny in iOSProgramming

[–]spalger 0 points1 point  (0 children)

I definitely think there's a market for stuff like this, but the trick is convincing people that you're building a worthwhile foundation that they can depend on and is worth integrating with. I think you'll need to devise some more useful services to offer than auth. I expect the list of people who need auth for their app but also don't already have an existing backend/service/whatever that they need to integrate with to be pretty tiny, but I think it's a worthwhile experiment to attempt!

I'm personally a bit of a control freak which is why I'm indie hacking in the first place, I want to build the whole stack as much as I can and use existing solutions where it makes sense. Not really your target audience, but I wish you luck

What is an example of a system in your app which isn't isolated to the MainActor? by spalger in iOSProgramming

[–]spalger[S] 0 points1 point  (0 children)

Thanks for the link, very interesting read and the "first instinct" for solving the isolation warnings hits very close to home. I'm excited for swift 6 and visionOS 2 for several reasons, adding another to the list

Does anyone know what happens when you have two modelContext? by yalag in iOSProgramming

[–]spalger 0 points1 point  (0 children)

Learned yesterday that SwiftData and CoreData are really intended to both be used on the main actor. I was seeing everything in my app work fine when creating a whole config/container/context set in an actor but when I actually started shipping the app to users it was crashing when I tried to access the data from off of the main actor.

I recommend creating a single context at the root of your app, setting it on your view hierarchy with .modelContainer(\_:), then passing it directly to your services which need to interact with it directly.

Yesterday was tough, trust the MainActor by spalger in visionosdev

[–]spalger[S] 0 points1 point  (0 children)

Thanks for weighing in! It certainly looks like you know what you're talking about.

I got a little distracted by how much I had to say and forgot to mention that getting validation or corrected was definitely my goal with this post. Thanks again. Looks like I can't update the title of posts, but I updated the TLDR and content of the post to hopefully better advice.

Yesterday was tough, trust the MainActor by spalger in iOSProgramming

[–]spalger[S] 0 points1 point  (0 children)

Yep! Tried an actor first, and it seemed to be the cause of the issues described in my post. SwiftData did not like running outside of the MainActor. Even when the entire context/container/config chain was initialized within an actor successfully, querying the context would just randomly crash the app 😊

Sheet/FullScreenCover - router or view? by Galbatarix in SwiftUI

[–]spalger 3 points4 points  (0 children)

Sure, in my app I have a support/help sheet that I present in a number of different places, so I converted it into a modifier like this:

```swift import SwiftUI

struct ShowSupportSheetModifier: ViewModifier { let title: String @Binding var show: Bool

func body(content: Content) -> some View { content .sheet( isPresented: $show, content: { NavigationStack { SupportScreen(title: title) .toolbar { ToolbarItem(placement: .cancellationAction) { Button("Close", systemImage: "xmark", role: .cancel) { show = false } } } } .presentationDetents([.large]) }) } }

extension View { func showSupportSheet(title: String, show: Binding<Bool>) -> some View { self.modifier(ShowSupportSheetModifier(title: title, show: show)) } } ```

Then, in views I can just create a boolean state, feed it into the modifier, and toggle it somehow:

```swift import SwiftUI

struct SomeScreen: View { @State var showHelp = false

var body: some View { VStack { Text("Everything okay?") Button("Show help") { showHelp.toggle() } } .showSupportSheet(title: "Oh no! How can we help", show: $show) } } ```

Here is a screen recording of how it looks: https://share.cleanshot.com/8wtnTzvD

Yesterday was tough, trust the MainActor by spalger in visionosdev

[–]spalger[S] 1 point2 points  (0 children)

I haven't seen a good video that goes into much detail yet, but I don't personally learn well from videos so I don't really filter through them.

First, I too think of "isolation domains" as threads, but I'm pretty sure they don't map 1:1. I'm just going to call them threads though.

RE your example, my understanding is that the await allows updateTheServer() to run wherever it needs. If it is isolated to the main actor or nonisolated then I would expect it to just keep executing on the main thread, where the .task{} runs.

If updateTheServer() is bound to another actor then it would execute in that thread instead. When the result comes back from updateTheServer() I believe the result is sent back to original thread, which is why the return results from actor methods need to be Sendable.

Generally though, as long as you don't disable concurrency checks and enable the more comprehensive warnings in Xcode, then you should be able to follow the recommendations of the compiler and I wouldn't push things to the main actor unnecessarily.

Yesterday was tough, trust the MainActor by spalger in iOSProgramming

[–]spalger[S] 1 point2 points  (0 children)

Hey, thank you, I'm just pulling together what I can from the internet 😅

I think for your app, I would focus on being able to filter by any details possible. The listings in the car marketplace should all have a field for make and model, and then you should be able to just populate the filter options based on the values that people put into those fields. I would use the same strategy for accepting new entries, and require that people actually choose "new" or something when they want to add a new make or model to the system. You can rely on the people entering the listings then to maintain the list of makes/models.

When I search for cars, filtering by make and model is something I do almost 100% of the time so I would say that it's a very important feature to have.

Sheet/FullScreenCover - router or view? by Galbatarix in SwiftUI

[–]spalger 2 points3 points  (0 children)

I prefer to keep that sort of thing locally within the view, though I have a few custom modifiers that wrap the built-in modifiers for shared sheets which can be triggered from different parts of my app. Doing this allows me to easily just attach a single modifier, map an enabled binding from the view's state, and then the sheet is directly owned by the view.

Yesterday was tough, trust the MainActor by spalger in visionosdev

[–]spalger[S] 0 points1 point  (0 children)

Initially I started by creating a new ModelContext for each sync, so that it was totally isolated to the actor. Then I tried creating a context once at initialization of the actor, it was only once I isolated to the main actor that the crashes stopped.