@JTostitos@techhub.social
@JTostitos@techhub.social avatar

JTostitos

@JTostitos@techhub.social

Swift Developer. Creator of Snippets Studio & SHOUT - Text Cases

Creator of open source project Spectra. A Prime Video client for
Apple Vision Pro.

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

marcel, to SwiftUI
@marcel@mastodon.social avatar

It's me again, with another and problem.

I'm fetching all books using @Query in ContentView. I then give those books to LibraryView where you can see me tapping the button, which then perfectly shows the updated number for that book.

The BookDetailView doesn't update when I add a quote from there.

Why? I've been stuck on this for one and a half hours even though it should be pretty simple. 😞

video/mp4

JTostitos,
@JTostitos@techhub.social avatar

@marcel @Query have you tried making the book variable @ Bindable?

JTostitos, to macos
@JTostitos@techhub.social avatar

Can anyone point me in the right direction here?

In SwiftUI, I can do this from an iOS app to deeplink: UIApplication.shared.open(URL(string: "”))

However in macOS, NSApplication.shared has no equivalent. NSWorkspace.shared has an open(URL(””)) but it was not deeplinking properly. The view wouldn’t open. Maybe I was using it wrong though…

What is the expected way to deeplink on macOS?

JTostitos,
@JTostitos@techhub.social avatar

@pdarcey thanks for the suggestion. But unfortunately I don’t think this will work in my case. I need to deeplink to a url from a shortcuts action.

JTostitos, to random
@JTostitos@techhub.social avatar

My app has been plagued with sharing state across multiple windows again…

With StateObject I could place it one level deep in my view hierarchy and it wouldn’t share state across other windows. But for some reason when I switched to Observable using

  1. State var vm = vm.shared
    and
  2. ‘Environment(VM.self) var vm’

during my refactor, now it shares state between windows despite still being one level deep in the view hierarchy.

Not only that, giving the WindowGroup a unique ID doesn’t prevent state from being shared either. https://iosdev.space/@matt1corey/111177127676051223

This is basically opposite of how I remember it functioning when using StateObject and EnvironmentObject. Anyone have any ideas to prevent this from occurring? Or am I holding it wrong?

image/jpeg
image/jpeg

JTostitos,
@JTostitos@techhub.social avatar

Turns out that if I just remove the shared property and make an empty init, state is no longer shared. Interesting…

JTostitos, to random
@JTostitos@techhub.social avatar

yay...

davidbures, to swift
@davidbures@mstdn.social avatar

I finally did it.

Cork has gotten so advanced that the Xcode autocomplete stopped working completely.

JTostitos,
@JTostitos@techhub.social avatar

@davidbures welcome to the club

JTostitos, to random
@JTostitos@techhub.social avatar

Thanks @revenuecat 🎉

JTostitos, to random
@JTostitos@techhub.social avatar

Apple, your corner radius is a little off 😂

patro85, to swift

Hey devs! Anyone have a fix or workaround for errors like this when trying to port an iOS app to macOS?

I set my minimum macOS version to 13.6 and I keep getting these errors that my version supports something that is too old.

JTostitos,
@JTostitos@techhub.social avatar

@patro85
Add
platforms: [.iOS(.v17), .macOS(.v14), ],
to your package.swift file. Just replace .v17 and/or .v14 with the version you are supporting.

JTostitos,
@JTostitos@techhub.social avatar

@patro85 Yes, you would need to add that to each package you created in your project. However, if this is a package you imported from GitHub, then the dev needs to properly annotate each of their classes/structs/etc with @ available OR add the above line to their package.swift file.

JTostitos, to random
@JTostitos@techhub.social avatar

Yes, I know exactly what this does… Thanks Apple for informing me exactly of what modified extension is trying to run on my Mac so I have no doubt about what I am trying to “Open Anyway”.

JTostitos, to random
@JTostitos@techhub.social avatar

Really? Why is MultiDatePicker not available in macOS? Seems like a strange thing not to bring to SwiftUI on macOS…

JTostitos,
@JTostitos@techhub.social avatar

Switching to macCatalyst, MultiDatePicker is just broken in such a hilarious way.

This happens on scaled to match iPad and Optimize for macOS interface.

Even on iOS the behavior is confusing. You would think that holding SHIFT, it would select the dates between the two points you choose. But nope, it selects days by column instead of by row. Why?

Whats worse, is that on catalyst, holding SHIFT is the only way to select multiple dates. As selecting dates one by one is broken.

video/mp4
video/mp4

twostraws, to random
@twostraws@mastodon.social avatar

When your laptop says it has 10% battery remaining, do you:

a) Plug it in immediately
or
b) Think "I'd better plug it in soon" then wonder why it switches off an hour later, like I do basically every time.

JTostitos,
@JTostitos@techhub.social avatar

@twostraws at least 10% lasts an hour on Apple Silicon. Us intel users get about 15 minutes 😂

JTostitos, to random
@JTostitos@techhub.social avatar

TIL that if you want to share an @ AppStorage variable with a widget, it isn’t enough to just add an app group. You need to initialize the property wrapper with ‘store’:

@ AppStorage(“someProperty", store: .init(suiteName: "group.com.name.app”)) public var someProperty = false

Only then will a widget react to any changes made to this variable.

pwa, to iOS German
@pwa@norden.social avatar

Is there someone Using a NavigationSplitView in SwiftUI? I have got the following problem:

https://stackoverflow.com/questions/76017818/swiftui-navigationsplitview-title-bar-issues

And there seems to be no solution. I just want to open a View with a Navigationbar in the detail view and it just creates a fugly animation on iOS..

There must be some misunderstanding or something 🤔

JTostitos,
@JTostitos@techhub.social avatar

@pwa left a reply to your question on SO.

JTostitos,
@JTostitos@techhub.social avatar

@pwa hmm I would suggest trying to find Apples sample projects like the Fruita app or the Donut Shop app and seeing how they handle navigation and see if it experiences similar problem.

JTostitos, to random
@JTostitos@techhub.social avatar

Hi everyone! I created an account for @SnippetsStudio

If anyone would like to follow, that would be awesome! I’ll be posting updates and announcements on that account. 🚀😀

Chuck_ORourke, to swift
@Chuck_ORourke@mastodon.social avatar

What is it called when you preface a variable with $? Such as
List($users, if: …
I have tried to figure out how to google for this so many times and got nowhere ! 🤬

JTostitos,
@JTostitos@techhub.social avatar

@Chuck_ORourke Well in swiftUI it is a binding when used like that. Theres other uses though like when you want to use .map {}, .filter {} or .sorted {}.

Example:
$users.sorted(by: {$0.date < $1.date})

This example would work if users was an @ FetchRequest and the entity had a property called date. This example would sort dates from current to oldest.

marcel, to SwiftUI
@marcel@mastodon.social avatar

There's a way to show big buttons, horizontally aligned, in a Menu, right? How is it called? I can't find anything, but I'm sure I've seen that somewhere.

JTostitos,
@JTostitos@techhub.social avatar

@marcel @villeheikkila woah really? I’ll have to try this later! I didn’t think this was possible in SwiftUI.

JTostitos,
@JTostitos@techhub.social avatar

@christianselig weren’t you trying to do this a while ago? Here’s the answer in case you still need it.

mlysons, to random
@mlysons@iosdev.space avatar

What are the best ways of creating all the screenshots for App Store Connect? Do you just use your iPhone to capture a screen and then have something resize the images to the 7654x234.567 or whatever ASC wants?

JTostitos,
@JTostitos@techhub.social avatar

@mlysons I make a new file in Affinity Photo at the right dimensions for each size and then do custom imagery with only one sized device:

https://apps.apple.com/us/app/snippets-studio/id1639537757

JTostitos,
@JTostitos@techhub.social avatar

@mlysons Thanks :)

thatvirtualboy, to macos
@thatvirtualboy@techhub.social avatar

If you're an Intel-based Mac user today that relies on Windows virtualization for your productivity, be cautions swapping out your current setup for a new M3 before fully testing your Windows-based apps on Windows 11 Arm. You may very well find yourself having to return that hot new Mac. And that would be pretty scary.
https://thatvirtualboy.com/mac-windows-scary/

JTostitos,
@JTostitos@techhub.social avatar

@thatvirtualboy yeah I keep seeing them on sale. But now that M3 is out maybe some M2s will go on sale soon to make room for inventory of M3s

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