How to get Integer from button title
<p>I have a Button labeled "3x3" now I want to create an Int variable with the value "3" in button click function.</p>

<p>I have tried </p>

<pre><code>let newBoardSizeString = String.localizedStringWithFormat("\(sender.currentTitle?.characters.first)")
let newBoardSize = Int(newBoardSizeString)
</code></pre>

<p>The string i get is like this </p>

<pre><code>"Optional(\"3\")"
</code></pre>

<p>and Int I get is </p>

<pre><code>nil
</code></pre>

<p>I want only 3</p>