<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.tiffa.net/w/index.php?action=history&amp;feed=atom&amp;title=Swift%2Favailability_condition</id>
	<title>Swift/availability condition - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.tiffa.net/w/index.php?action=history&amp;feed=atom&amp;title=Swift%2Favailability_condition"/>
	<link rel="alternate" type="text/html" href="https://wiki.tiffa.net/w/index.php?title=Swift/availability_condition&amp;action=history"/>
	<updated>2026-06-14T15:27:25Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://wiki.tiffa.net/w/index.php?title=Swift/availability_condition&amp;diff=2175&amp;oldid=prev</id>
		<title>imported&gt;Fire: Created page with &quot;[https://www.swiftlangjp.com/language-reference/statements.html#%E3%82%A2%E3%83%99%E3%82%A4%E3%83%A9%E3%83%93%E3%83%AA%E3%83%86%E3%82%A3%E6%9D%A1%E4%BB%B6availability-condition Availability Condition] を使うと実行時にOSの種類によって、制御を変えることができる。（conditional compilation blockは、コンパイル時に判断され、バイナリに反映される。）  == Syntax == platform-name は...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.tiffa.net/w/index.php?title=Swift/availability_condition&amp;diff=2175&amp;oldid=prev"/>
		<updated>2022-11-08T10:53:04Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;[https://www.swiftlangjp.com/language-reference/statements.html#%E3%82%A2%E3%83%99%E3%82%A4%E3%83%A9%E3%83%93%E3%83%AA%E3%83%86%E3%82%A3%E6%9D%A1%E4%BB%B6availability-condition Availability Condition] を使うと実行時にOSの種類によって、制御を変えることができる。（&lt;a href=&quot;/w/index.php?title=/Swift/conditional_compilation_block&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;/Swift/conditional compilation block (page does not exist)&quot;&gt;conditional compilation block&lt;/a&gt;は、コンパイル時に判断され、バイナリに反映される。）  == Syntax == platform-name は...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[https://www.swiftlangjp.com/language-reference/statements.html#%E3%82%A2%E3%83%99%E3%82%A4%E3%83%A9%E3%83%93%E3%83%AA%E3%83%86%E3%82%A3%E6%9D%A1%E4%BB%B6availability-condition Availability Condition] を使うと実行時にOSの種類によって、制御を変えることができる。（[[/Swift/conditional compilation block|conditional compilation block]]は、コンパイル時に判断され、バイナリに反映される。）&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
platform-name は、&amp;quot;iOS&amp;quot;, &amp;quot;macOS&amp;quot;, &amp;quot;macCatalyst&amp;quot;, &amp;quot;watchOS&amp;quot;, &amp;quot;tvOS&amp;quot; が指定できる。複数並べることができるが、orやand条件にはできない。&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;をつけないと怒られる（将来のバージョンも対応する印)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Swift&amp;quot;&amp;gt;&lt;br /&gt;
if #available(platform-name version, ..., *) {&lt;br /&gt;
  ...&lt;br /&gt;
} else {&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== External Link ==&lt;br /&gt;
[https://software.small-desk.com/development/2022/04/25/swift-explain-ifavailables/#available_availability_condition #if os, #available, @available をつかった、コードの切り分け]&lt;br /&gt;
&lt;br /&gt;
[[Category:Swift|availability condition]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Fire</name></author>
	</entry>
</feed>