> ## Content Index
> Fetch the complete content index at: https://blogs.remobjects.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Elements Tips: if #available
- URL: https://blogs.remobjects.com/2019/06/09/elements-tip-if-available/
- Published: 2019-06-09T22:16:11.000Z
- Updated: 2019-06-11T19:47:30.000Z
- Author: marc hoffman
- Tags: #Import 2026-08-17 20:17

If you're using the Elements compiler for your iOS development, you can take advantage of a special additional behavior of the `if #available` syntax in Elements' Swift implementation: in addition to making any code surrounded by the check execute conditionally at *runtime*, in Elements the check *also* implies a compile-time `#if` check for the specified SDK.

What this means is that you can start using new APIs available only in the latest version of an SDK, but still compile your codebase against an *older SDK*, if needed. That's especially helpful during the beta period, as it allows you to play around with new APIs in, say, iOS 13 in your local builds and TestFlight deployment, while maintaining the ability to still ship updates to the app store based on iOS 12.2.

So for example, if you want to replace some images in your app with the excellent new SF Symbols APIs Apple introduced last week, you could write:

```swift
if #available(iOS 13.0) {
    imageView.image = UIImage.systemImageNamed("mail") // use SF Symbols
} else {
    imageView.image = UIImage.imageNamed("mail-icon") // use old icon in iOS 12
}

```

Then, simply select a different *Target SDK* version for your Release configuration vs. the Debug one. You can get your app ready for the fall in Debug, but if at any time you want to ship an interim update to your users before iOS 13 is out, just build Release and you'll be save to submit to the app store:

![](https://blogs.remobjects.com/content/images/2019/06/Screen-Shot-2019-06-09-at-3.40.49-PM.png)

Of course the same functionality is also available in the other four Elements languages, [Oxygene](https://www.elementscompiler.com/elements/oxygene?ref=blogs.remobjects.com), C#, Java and Go, via the [available() System Function](https://docs.elementscompiler.com/API/SystemFunctions/Available/?ref=blogs.remobjects.com). The feature is available for both Cocoa and Android.

```oxygene
if available("iOS 13.0") then
  imageView.image := UIImage.systemImageNamed("mail") // use SF Symbols
else
  imageView.image := UIImage.imageNamed("mail-icon") // use old icon in iOS 12

```

Read more about Elements at [elementscompiler.com](https://www.elementscompiler.com/elements?ref=blogs.remobjects.com).