× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

NSDictionary representation in Swift

Antonio Bello
Apr 22, 2015
<p>NSTextAlignment.Center is an enum, internally represented as an integer - but you are passing it as a string:</p> <pre><code>options[kCRToastTextAlignmentKey] = "\(NSTextAlignment.Center)" </code></pre> <p>whereas you should use the enum raw value:</p> <pre><code>options[kCRToastTextAlignmentKey] = NSTextAlignment.Center.rawValue </code></pre> <p>This tip was originally posted on <a href="http://stackoverflow.com/questions/29679017/NSDictionary%20representation%20in%20Swift/29679338">Stack Overflow</a>.</p>
comments powered by Disqus