Wooji Juice Profile picture
May 19, 2020 3 tweets 1 min read Read on X
Am I right in saying #SwiftUI doesn't really have undo/redo support? It does make an UndoManager available in the Environment, but if you (say) hook up a Toggle, Slider, Picker etc to a binding, it won't support undo/redo and doesn't seem to have any built-in mechanism to do so?
This is my attempt to fill in the gap, but I wouldn't be suprised if there are better ways. If instead of binding a widget to $someItem.someProperty you bind it to UndoableBinding(target: someItem, undoManager: undoManager).someProperty (you can cache this struct & reuse it…) Image
…then undo & redo should work as expected. Surprisingly, sliders don't seem to spam the undo stack with continuous updates, even tho the binding itself updates continuously? This seems to suggest something, somewhere is context-aware, but not sure what...

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Wooji Juice

Wooji Juice Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @wooji

Sep 29, 2020
Ferrite 2.6 can record in stereo with the built-in mics on some iPhones. There’s a little confusion out there about how it works, which is understandable, since iPhones don’t have mics set up for stereo recording! Here’s a thread about it, if you’re interested:
(For clarity: Ferrite has always been able to record in stereo when using an external stereo microphone, or with a stereo USB Audio Interface. This is just about the mics built into the iPhone itself.)
iPhones have many mics in them, but they’re designed for other stuff — mainly improving the quality of voice calls and Siri’s ability to hear you in noisy environments. So they’re positioned for those tasks, not stereo. For stereo recording, the iPhone has to do some… tricks.
Read 10 tweets
May 14, 2020
Displacement activity: During R&D phases, I often end up with a bunch of testbed apps on my devices, trying out different tech & so on. Since they all have the same default template icon, it can be hard to pick them apart at a glance. So: A screenshot of a Mac app s...
…I procrastinated my way into hacking together a quick SwiftUI-based Mac app, where I can drag-and-drop any glyph from the Mac's Character Viewer palette & it’ll instantly blueprint-ify it. Can then export a single 1024px image, or complete set of sizes ready to drop into Xcode.
(Fun fact: you can also drag any glyph from SF Symbols, and it’ll work — but you probably shouldn’t, as shipping an app with an icon made from an SF Symbol is likely to violate their T&Cs.)
Read 5 tweets
Apr 20, 2020
Ferrite 2.5 is now rolling out across the App Store. The three most visible changes? Enhanced trackpad/mouse support, Presentation Mode, and Deleted Items.

(Ferrite continues to work on iOS 12.4 for now, but you’ll need iOS 13.4 to take advantage of all the latest features)
Presentation Mode is a new feature to help folks teaching others how to use the app. It can be tricky to show gestures & keyboard shortcuts, especially when teaching via video (e.g. due to social distancing…). So Presentation Mode shows them on-screen. Customisable too:
The support for the new mouse, trackpad and keyboard features in iOS 13.4 is extensive. Not just a few hover states, it’s deep integration that makes it more desktop-like but with iOS flair and feeling. e.g. hold Option key & the pointer morphs into a selection bar:
Read 6 tweets
Jan 27, 2020
New update to Ferrite has been released — mostly minor fixes, performance improvements, that sort of thing. It does also include a big update to the User Guide, now featuring a full search facility: A screenshot of the app Fer...
You can just type some text and it'll search for it throughout the guide — but it'll also suggest chapters or keywords you might be interested in: Another screenshot of Ferri...
The User Guide used to be written in raw HTML, but that got increasingly difficult to manage due to all the variations (iPhone/iPad, iOS 12/13, print version etc). Now, it's written in an unusual way — in #SwiftLang of all things, using some similar techniques to SwiftUI: A partial screenshot of Xco...
Read 5 tweets
Nov 21, 2019
If you want to make a Mac app, there are _4_ primary APIs you could be using, in a sorta 2x2 grid: AppKit, UIKit (w/Catalyst), SwiftUI-in-AppKit, SwiftUI-in-UIKit. It’s a complex mess of what each does/doesn’t support — figuring out which to use for any given UI is trial & error
I’ve been trying to make one relatively simple bit of UI (in a standalone testbed app) for days. Every time I think I’m on a roll, I bump into a different wall of missing functionality. I try different implementations. I try different designs that don’t need same features.
It’s not even like you can say “Screw it, I’ll do everything old-school pure native AppKit and get access to everything”, cuz you'll still be missing some things (e.g. SF Symbols aren’t supported, even tho they are all available on Mac since Catalyst apps can use them).
Read 4 tweets
Sep 3, 2019
Trying to get stuff ready for the iOS 13 launch that’s (probably?) going to happen in the next week or so. Going through mopping up text translations. And I find that, wow, localised text in "static cells" table views seems to be broken when built against iOS 13 SDK
Even when running on iOS 12. Other text translates fine, but table cell text is ignored. Created a minimal repro project, previews A-OK in Xcode, broken on-device.

FB7198417 Image
Not-shipping isn’t an option, so AFAICT my only way forward is to spend a day or two writing a hand-coded translation system for table views, manually Cmd+C/Cmd+V text from built-in system to workaround (in languages I don't speak) & hope nothing gets mixed up 🎉 WCGW?
Read 6 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(