<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>xyk</author_name>
  <author_url>https://blog.hatena.ne.jp/xyk/</author_url>
  <blog_title>xyk blog</blog_title>
  <blog_url>https://xyk.hatenablog.com/</blog_url>
  <categories>
    <anon>swift</anon>
  </categories>
  <description>環境: Swift2.2 タプルとcaseを組み合わせて使うと便利だったのでメモ。 Switch(case)文で使う オプショナル型な複数の値の組み合わせで場合分けしたい場合に使う。 また値はアンラップして取り出して変数にバインドする。 ポイントはcase部分で「?」をつけること。これでオプショナル型でnilでない場合にマッチする。 let num: Int? = ... let str: String? = ... switch(num, str) { case let (num?, str?): // num, strともオプショナル型でnil以外にマッチ // case let (.So…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fxyk.hatenablog.com%2Fentry%2F2016%2F08%2F07%2F102459&quot; title=&quot;SwiftでTupleとCaseを組み合わせて使う - xyk blog&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2016-08-07 10:24:59</published>
  <title>SwiftでTupleとCaseを組み合わせて使う</title>
  <type>rich</type>
  <url>https://xyk.hatenablog.com/entry/2016/08/07/102459</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
