Gieta Laksmana
  • Blog
  • Profile
  • Projects
    • VR World Arcade
    • Punch For Fun
    • Spectrum
    • Dimension Battle
  • Resume

Xcode 8.1 and Swift 3.0.1 shenanigans

11/29/2016

0 Comments

 
When upgrading my xcode from 8.0 to 8.1 and Swift to 3.0.1, I found that I can no longer compare type with implicitly unwrapped optional in a switch statement. I need to explicitly unwrap the optional
// this no longer works
let a: String! = "asd"
let b: String = "asd"
switch a {
case b: // error: expression pattern of type 'String' cannot match values of type 'String!'
    break
default:
    break
}
0 Comments



Leave a Reply.

    Archives

    September 2018
    August 2018
    July 2018
    September 2017
    July 2017
    November 2016
    October 2016
    September 2016
    June 2016
    May 2016
    March 2016

    Categories

    All
    Shenanigans
    Software Engineering
    Swift
    Vr
    Xcode

    RSS Feed

Powered by Create your own unique website with customizable templates.