Posts
1568
Following
137
Followers
876
I'm a bit of an eclectic mess 🙂 I've been a programmer, journalist, editor, TV producer, and a few other things.

I'm currently working on my second novel which is complete, but is in the edit stage. I wrote my first novel over 20 years ago but then didn't write much till now.

I post about #Coding, #Flutter, #Writing, #Movies and #TV. I'll also talk about #Technology, #Gadgets, #MachineLearning, #DeepLearning and a few other things as the fancy strikes ...

Lived in: 🇱🇰🇸🇦🇺🇸🇳🇿🇸🇬🇲🇾🇦🇪🇫🇷🇪🇸🇵🇹🇶🇦🇨🇦
@stevengharris The implementation I created works fine for closing using the close button. Originally, if I quit the app then the frame would be saved but not if I used the close button and then re-launched the (unterminated) app from the dock icon.

In implementing a solution, what I noticed (at least the way I did it) was that if I kept a reference to the AppKit bridging plugin, the state would be saved correctly. But if I didn’t, then the state would not be saved on using the Close button. However, this could just be the way I implemented things …

Would be happy to share the code if it would help …
@stroughtonsmith
0
0
0
@mikaelacaron But are the other posts with GIFs posted from @IceCubesApp? It might be that they were posted from a different app maybe? 🙂
1
0
0
@rascalking Interesting, I think one of the things I missed was lists. So will definitely want to give it a look once that comes out. Thanks 🙂
0
0
0
@stevengharris There’s a solution provided by @stroughtonsmith in this same thread that worked for me. Just letting you know.

If you’d prefer to see the code in action, I can always send you the final code that worked for me. Let me know.
1
0
0
@stroughtonsmith I tested out your code and it works beautifully — thank you 🙂

I could have sworn I tried something similar before and it didn’t work but, I’m too lazy to go hunting for the code that didn’t work to see what the difference is …

On the plus side, your solution is way less code than my original code too. So a win overall. Thanks again!
0
0
1
@troz Maybe? I don’t know … Some of the Xcode stuff is rather annoying.

I guess what I’d normally try in this situation is uninstall the beta, reboot, install a fresh copy of the beta, reboot, then restart the beta copy, and if something goes wrong, restart again and try again 😛

Oh yeah, I also liberally sprinkle this with deleting the whole DerivedData folder since cached modules sometimes seems to interfere with things too … Or at least, that’s what it feels like.
0
0
1
@troz I was able to open an existing macOS playground and run it fine under Xcode 15 beta 3 …

Also tried creating a brand new macOS playground and that too works fine.
1
0
0

Digital sundial

4
13
0
@rascalking I ran it for a while on a VPS and it did run without any issues whatsoever. So easy to install too 🙂

The only reason I switched away was because I wanted more features. But that was at least half a year ago. They probably have added a lot more functionality now. I guess I should go look …
0
0
0
@mikaelacaron Does @IceCubesApp support GIFs? I’m using a custom fork of it, on macOS, and with a non-Mastodon server, so this might be a different experience due to multiple different things, but I can’t add GIFs on my version at all. It just shows an error message when I try to drag and drop a GIF in ...

I haven’t explored the code to see what is going on though …
1
0
0
@stevengharris Glad to highlight issues, even though I have no solutions 😛

I found one possible answer but it involves bridging to AppKit as mentioned here:

https://betterprogramming.pub/how-to-access-the-appkit-api-from-mac-catalyst-apps-2184527020b5

Haven’t tried it out yet though. I have small test app set up where I’ve been trying out different things. Haven’t had the chance to try the above approach yet, but if I do figure something out today, will let you know …
0
0
1
@stroughtonsmith Thanks for the answer. I do have that (or similar mechanism) in place but that appears to work only for new launches.

If you close all windows after launching (and saving the frame properly) if you re-launch from the dock icon (where the app itself has not terminated), the new app window appears in the center of the screen instead of the last saved location.

But will try your specific code and get back on this since I might have missed a nuance and maybe your code does work for all cases? I hate to say something doesn’t work without trying it out … So will update once I have tested.
2
0
0
@marksmith Thank you 🙂 Will take a look see …
0
0
0
@trode I used to follow @stroughtonsmith on Twitter but had no idea that he was on the Fediverse 🙂 Thanks for the pointer, Blake!
1
0
1

Fahim Farook

Has anybody had luck getting a Catalyst app to restore window frame (size & position) after closing all windows of the app and then tapping the dock icon to launch the app again?

If I quit the app and re-launch, it remembers the frame fine using my current mechanism, but if I close all windows and re-launch from dock, it places the app at the default position rather than the previously remembered position.

I got this to work correctly for a #SwiftUI app under macOS after a bit of tinkering but that was using `NSApplicationDelegate` methods. Haven’t had much luck with `UIApplicationDelegate` methods for the Catalyst app so far because my previous method involved using `applicationShouldHandleReopen` which is not there in `UIApplicationDelegate` ….

So wondering if anybody has run into this before and fixed it before I do a deeper dive …

#macOS #Swift #Coding #Catalyst #SwiftUI
2
0
1
@vyr Oh, cool! Thanks for that 🙂Will look into it … @joforselldev @finestructure
0
0
1
@dimsumthinking Yeah, I couldn’t get my project to even compile with a relationship, if I recall correctly 🙂 So you’re already further ahead than I am …
0
0
0
@dimsumthinking I really couldn’t make relationships work with beta 1. Meant to try again later but have not gone back yet ….
1
0
0
Show older