Every now and then, I’m frustrated that SwiftUI is missing an obvious environment variable.I really expected it to have @Environment(.keyboardShowing) var keyboardShowing It doesn’t. But you can make your own.Simple example of how you use it here: In this example, we show a ‘keyboard down’ button if the keyboard is showing. The button clears focus
I’m building an app which needs to load Objective C files.If the user gives me access to the ‘.m’ file, I need to be able to open the ‘.h’ file. You don’t get this ability without a bit of a dance. I didn’t find any clear tutorial or example, so I’m adding one now. Firstly
I’m going to have a shot at defining what @MainActor does, and what it does not guarantee. Why? I keep seeing tutorials and talks explaining @MainActor with something like the following quote Isolation to the main actor is expressed with the MainActor attribute. This attribute can be applied to a function or closure to indicate
At this stage, I’m just riffing on different ways to ‘break’ swift concurrency. I wondered if protocols would provide an opportunity, and indeed they do! Take this scenario. We have a simple protocol – but the class implements it with an @MainActor annotation. If you do this all within the main class definition, then you
I really like Swift Concurrency. I just wish Apple would clearly document what it actually guarantees Generally, sites (including Apple) explain that marking a function with @MainActor guarantees that it will always run on main. By adding the new @MainActor annotation to Photos, the compiler will guarantee that the properties and methods on Photos are
tldr – marking methods with @MainActor does not guarantee that they run on the main thread. Swift has a magical new structured concurrency model. ‘using Swift’s language-level support for concurrency in code that needs to be concurrent means Swift can help you catch problems at compile time’ -the swift programming language One of the new
About a year ago, I decided to give up reporting bugs to Apple. Like many others, I got fed up of them simply being ignored. At WWDC in in June of 2021, I signed up for a SwiftUI lab, and showed the two Apple engineers a bug that had been annoying me. The bug is
tldr; Multi Monitor Wallpaper can give you the daytime images for your dynamic wallpaper even if you use dark mode. One of the trickier things that Multi Monitor Wallpaper does is pull apart dynamic wallpapers so that it can build separate ones for each of your monitors. It then puts them back together again. These
tl;dr – Apple policy may now say they won’t hold up your urgent bugfix, but that doesn’t stop them holding it ‘in review’ for an unusually long time so that it is never actually released… I have had plenty of ‘robust discussions’ with App Review. Sometimes they come round to my way of thinking –
tl;dr – in the name of security, you encourage me to share passwords. Both the Apple App Store, and the Google Play store allow business accounts to have multiple users. This means that my client (the app owner) can own their account, and they can let me (the developer) do what I need to to