Discussion
Loading...

#Tag

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Hacker News
@h4ckernews@mastodon.social  ·  activity timestamp 5 days ago

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 last month

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 last month

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 last month

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.0-rc.3.21 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login