Live data from Hacker News

Apple's API's Are Awful (At Least Some of Them)

mzfit.app

11–19 of 19 posts

Re: Apple's API's Are Awful (At Least Some of Them)

#11
The couple comments and then paragraph about having to restart the simulator:

... restart the simulator every 3rd try or so. Because if you don’t the workout will still be running in the background and everything just silently fails and you will think you have a bug in your code until you finally find the correct stack overflow reference that just explains this is the way life is.

Doesn't seem to happen to me in the standalone simulator or on a connected device. For me it seems to happen in the Preview, which is not the same thing. It seems to start when you manage to get the main app and the preview version out of sync, usually during a code edit and preview refresh.

The problem seems to go away if you handle previews and preview provider concurrency more explicitly:

https://developer.apple.com/documentation/swiftui/previewpro...

Re: Apple's API's Are Awful (At Least Some of Them)

#12

If you think this is bad, try an Apple TV app! A lot of the platform APIs, like the one mentioned in the article, are still in objective C and really beginning to show their age. The worst is when you want to do something in SwiftUI but the platform APIs are UIKit (‘:

Sheesh, it's not that bad! 10 years ago the same things were considered the nicest app APIs to work with in the biz, spawning the whole ZIRP app ecosystem. I guess if people feel like you do, I'll stay employed.

[flagged]

Re: Apple's API's Are Awful (At Least Some of Them)

#13
post #5

> And so Apple, I say, whoever had a hand in this should be ashamed of themselves. You can and should do better. I love SwiftUI. I love building iOS apps. But please clean this up. As a recent macbook convert (work gave me one) I have to remind myself every day: Apple is not a software company. Their business is to sell hardware at a premium. Software is an afterthought, and if they could offload software, they would…

[flagged]

Re: Apple's API's Are Awful (At Least Some of Them)

#14
Also a current funny bug with SwiftUI, if you left out a “dot”, it will compile but crashes the app during runtime.

VStack { } navigationDestination(isPresented: $goToSettings) { }

There should be a dot before navigationDestination and this should not compile ever.

Re: Apple's API's Are Awful (At Least Some of Them)

#15
post #5

> And so Apple, I say, whoever had a hand in this should be ashamed of themselves. You can and should do better. I love SwiftUI. I love building iOS apps. But please clean this up. As a recent macbook convert (work gave me one) I have to remind myself every day: Apple is not a software company. Their business is to sell hardware at a premium. Software is an afterthought, and if they could offload software, they would…

[flagged]

what trade off is not being able interleave two dialogue boxes from different apps? or losing keyboard focus when in (mission control? exposé?) for tools such as raycast?

Pretty much everyone at work agrees the window manager sucks, so I'm surprised this is getting downvoted as much. I think I'm sitting against HN here, you've got the HN brain fart

Re: Apple's API's Are Awful (At Least Some of Them)

#16

Earlier quoted context omitted.

[flagged]

what trade off is not being able interleave two dialogue boxes from different apps? or losing keyboard focus when in (mission control? exposé?) for tools such as raycast? Pretty much everyone at work agrees the window manager sucks, so I'm surprised this is getting downvoted as much. I think I'm sitting against HN here, you've got the HN brain fart

There are some half-baked things about Mac OS, for sure. I hate when I get a Facetime / call alert and it grabs my focus. There is no way to fix this. Why can I use arrow keys with Expose / App Windows, but not Mission Control (all windows) ?

Re: Apple's API's Are Awful (At Least Some of Them)

#17

Also a current funny bug with SwiftUI, if you left out a “dot”, it will compile but crashes the app during runtime. VStack { } navigationDestination(isPresented: $goToSettings) { } There should be a dot before navigationDestination and this should not compile ever.

That's not a bug. It's just calling `self.navigationDestination(isPresented:)`, which is a valid thing that exists. The same thing can happen anywhere that you're calling a method on an object which also exists on `self`.

Re: Apple's API's Are Awful (At Least Some of Them)

#18

Also a current funny bug with SwiftUI, if you left out a “dot”, it will compile but crashes the app during runtime. VStack { } navigationDestination(isPresented: $goToSettings) { } There should be a dot before navigationDestination and this should not compile ever.

That's not a bug. It's just calling `self.navigationDestination(isPresented:)`, which is a valid thing that exists. The same thing can happen anywhere that you're calling a method on an object which also exists on `self`.

It crashes the app on runtime.

Re: Apple's API's Are Awful (At Least Some of Them)

#19

Earlier quoted context omitted.

Sheesh, it's not that bad! 10 years ago the same things were considered the nicest app APIs to work with in the biz, spawning the whole ZIRP app ecosystem. I guess if people feel like you do, I'll stay employed.

[flagged]

We've banned this account for repeatedly breaking the site guidelines and ignoring our request to stop.

Please don't create accounts to break HN's rules with.

https://news.ycombinator.com/newsguidelines.html

Post reply on HN