Discussion
Loading...

#Tag

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
obrhoff
@obrhoff@mastodon.social  ·  activity timestamp last month

@konstantin Dont post it! The SwiftUI Mob on Mastodon will hang you for it. 😭

https://mastodon.social/@pakkito/115314355147173532

Konstantin 🔭
@konstantin@hachyderm.io replied  ·  activity timestamp last month

@obrhoff Let them come ☺️. I have a reproducible case where `if #available(iOS 26.0, *) {}` in a conditional modifier will absolutely break reactivity on iOS 18.6 but not on iOS 26. No amount of "team discipline" can protect against undefined behaviour in the SDK. (or rather, it's well defined but the side effects are so far reaching it may as well be undefined, as explained in that post by Chris Eidhof)

  • Copy link
  • Flag this comment
  • Block
Hacker News
@h4ckernews@mastodon.social  ·  activity timestamp last month

JetKVM Is Now Available for Retail Purchase

https://jetkvm.com/products

#HackerNews #JetKVM #Retail #Purchase #JetKVM #Now #Available #Tech #News #Virtualization

JetKVM

JetKVM Products - KVM over IP Devices & Extensions

Professional KVM over IP solutions including the main JetKVM device and extension modules. Ultra-low latency remote server management.
  • Copy link
  • Flag this post
  • Block
John Siracusa
@siracusa@mastodon.social  ·  activity timestamp 2 months ago

The if #available(macOS 26, 😉 { … } checks required to call newer APIs from apps that still run on older OSes are really cumbersome to use in SwiftUI.

This technique from @davedelong makes this much nicer and easier: https://davedelong.com/blog/2021/10/09/simplifying-backwards-compatibility-in-swift/

You might still have to do some manual mapping of enums and constants, but that ugliness is contained, leaving your call sites clean.

Dave DeLong

Simplifying Backwards Compatibility in Swift

Every year as new OS and Swift versions are released, the question comes up over and over again: “how do I use this new thing while also supporting older versions?”. While we have a bunch of “availability” tools at our disposal (and I’ll be using them in this post), they always come across as somewhat cumbersome: we need to do inline checks, or we have conditional logic flow that obfuscates the intent of some of our code, and so on.
John Siracusa
@siracusa@mastodon.social replied  ·  activity timestamp 2 months ago

Since the dawn of SwiftUI, I've been using the (ill-advised, for multiple reasons) custom `if` view modifier as a last resort, which uses basically the same technique as the @davedelong's "Backport" system (with the same downsides, I imagine).

But you can't put an #available(…) check inside an `if` view modifier, and I've been annoyed by this for years. It turns out I just needed to make a slight change to make this work. 🙏

  • Copy link
  • Flag this comment
  • Block
John Siracusa
@siracusa@mastodon.social  ·  activity timestamp 2 months ago

The if #available(macOS 26, 😉 { … } checks required to call newer APIs from apps that still run on older OSes are really cumbersome to use in SwiftUI.

This technique from @davedelong makes this much nicer and easier: https://davedelong.com/blog/2021/10/09/simplifying-backwards-compatibility-in-swift/

You might still have to do some manual mapping of enums and constants, but that ugliness is contained, leaving your call sites clean.

Dave DeLong

Simplifying Backwards Compatibility in Swift

Every year as new OS and Swift versions are released, the question comes up over and over again: “how do I use this new thing while also supporting older versions?”. While we have a bunch of “availability” tools at our disposal (and I’ll be using them in this post), they always come across as somewhat cumbersome: we need to do inline checks, or we have conditional logic flow that obfuscates the intent of some of our code, and so on.
  • Copy link
  • Flag this post
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.1-alpha.7 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login