@christianselig@mastodon.social avatar

christianselig

@christianselig@mastodon.social

iOS developer, creator of Apollo and Pixel Pals. Previously at . he/him. i love animals. 🌱

This profile is from a federated server and may be incomplete. Browse more on the original instance.

christianselig, to random
@christianselig@mastodon.social avatar
christianselig,
@christianselig@mastodon.social avatar

@Mister_Eel Scratch!

christianselig,
@christianselig@mastodon.social avatar

@lkngrrr I picked up some 110/18 needles and nylon bonded thread per a video recommendation, I'm hoping this works haha

christianselig,
@christianselig@mastodon.social avatar

@lkngrrr Planning to use a mix of Cordura and Ecopac to hopefully have something nice and light

christianselig,
@christianselig@mastodon.social avatar

@MuseumShuffle Hahah I won't have it done by then unfortunately ;_; Maybe the following WWDC as this noob slowly learns

christianselig,
@christianselig@mastodon.social avatar

@shanie I mulled over it a bunch, but I don't really have the space for a vintage machine, nor the real desire to potentially restore/maintain them. But they look absolutely incredible performance wise, maybe some day haha

christianselig, to random
@christianselig@mastodon.social avatar

Choosing a travel backpack is really hard, and I still haven't found one I love, so mostly for my own reference I wrote a long post with thoughts on pretty much every travel backpack out there https://christianselig.com/2024/04/choosing-a-backpack-is-hard/

If you have other recommendations gimme

christianselig,
@christianselig@mastodon.social avatar

@phneutral No external water bottle holder is an immediate no go for me unfortunately :(

christianselig,
@christianselig@mastodon.social avatar

@phneutral That one is over 6 lb!

christianselig, to random
@christianselig@mastodon.social avatar

SwiftUI noob question: I understand why my ViewModel is being initialized twice, but why is it not being deinitialized?

It's created, then a second later when appState.show is changed, the view is recomputed, and view, and its ViewModel, are created anew. Cool! But why is the old one not deinitialized? What's holding onto it?

Sample code: https://gist.github.com/christianselig/d88b1a4d1989b973689ae62d4691162f

christianselig,
@christianselig@mastodon.social avatar

@shadowfacts @harshil The weird thing though is that the second initialization doesn’t even appear to be used. Is that part expected? Or given that it’s not deduped the expectation is just to ignore unnecessary allocations?

christianselig,
@christianselig@mastodon.social avatar

@shadowfacts @harshil Ah ha, so on consecutive (say, fifth, sixth, seventh invocations), it just would overwrite the "second" one, while the "true" first one continues to be the de facto instance that is actually used?

christianselig,
@christianselig@mastodon.social avatar

@BenRiceM how do you block in ivory

christianselig,
@christianselig@mastodon.social avatar

@tclementdev With more digging it seems like it's weirdly intended behavior? https://iosdev.space/@alpennec/112472185803890091

christianselig,
@christianselig@mastodon.social avatar

@tjadejong Seems like weirdly intended behavior ;_; https://iosdev.space/@alpennec/112472185803890091

christianselig,
@christianselig@mastodon.social avatar

So basically it seems like a weird choice of the new Observation framework, in that @​State doesn't use an autoclosure like @​StateObject (which allows it to be smarter about duplicates), which is unfortunate design and causes @​State to create instances without really needing to, but it’s at least documented with a weird workaround

My ViewModel is a bit heavy so having them be randomly allocated is kinda rough

So, back to StateObject I go (for this at least)!

https://iosdev.space/@alpennec/112472185803890091

christianselig,
@christianselig@mastodon.social avatar

@kenryall @tclementdev @alpennec I'm fine with the view being created willy nilly, but I didn't expect the State objects that are supposed to persist between recreations to also be recreated

christianselig,
@christianselig@mastodon.social avatar

@groue @alpennec I will not attempt to trivialize the work Apple does internally because I'm sure this stuff is complicated with a lot of moving parts

Butttttttttt… damn I wish this was how Apple did it 😅

christianselig,
@christianselig@mastodon.social avatar

@mikaelacaron It's definitely possible. It seems the secondary (and tertiary…) creations are just created and never do anything, so it's not like your initial state/creation is thrown out or anything, but if your initializer modifies global state or something it could be causing something nasty D:

christianselig,
@christianselig@mastodon.social avatar

@Drarok The opposite! State should be able to do everything StateObject does and replace it as of iOS 17 with the new Observation framework. It brings niceties like nested observation, so unlike StateObject if a property of your observed object changes internally that can also trigger a change in your view, which is really handy

christianselig,
@christianselig@mastodon.social avatar

@mikaelacaron Ahh, sign in issues are my least favorite bugs to work with, I feel for you 😢 I'd be peppering print statements everywhere lol

christianselig,
@christianselig@mastodon.social avatar

@malhal @alpennec @rockbart @shadowfacts @harshil Ah nice! @groue did something similar, nice to see people in the community fixing holes in the framework :D https://hachyderm.io/@groue/112320846092536694

christianselig, to random
@christianselig@mastodon.social avatar

iPhone 15 Pro’s been my best battery performer by a mile, damn. All MagSafe charging too pretty much

christianselig,
@christianselig@mastodon.social avatar

@justindumlao Dang, nice, I hope to still be at that 100% in another 30 charging cycles

christianselig, to random
@christianselig@mastodon.social avatar

Dumb question, but if I bought one of those "MagSafe stickers" on Amazon, that are traditionally used to give an Android phone MagSafe-like-stickiness, could I instead use it in reverse, and stick it to a non-MagSafe accessory so it would stick to my iPhone?

For instance, say I want to stick it to a banana so the banana magnets to my phone

christianselig,
@christianselig@mastodon.social avatar

@dwineman Damn, this is the ultimate answer! Thank you!

christianselig, to random
@christianselig@mastodon.social avatar

Does launching a build with the debugger attached on Vision Pro take forever for anyone else? It's near instant on the simulator, but even after the data is transferred to the device, the actual launch screen hangs out for like 10 seconds (so I don't think dev strap would help?)

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • mdbf
  • InstantRegret
  • ethstaker
  • magazineikmin
  • GTA5RPClips
  • rosin
  • modclub
  • Youngstown
  • ngwrru68w68
  • slotface
  • osvaldo12
  • kavyap
  • DreamBathrooms
  • Leos
  • thenastyranch
  • everett
  • cubers
  • cisconetworking
  • normalnudes
  • Durango
  • anitta
  • khanakhh
  • tacticalgear
  • tester
  • provamag3
  • megavids
  • lostlight
  • All magazines