Could not find an overload for “init” that accepts the supplied arguments in Swift

后端 未结 3 744
长发绾君心
长发绾君心 2020-12-19 17:42

I am trying to figure out how to translate this in Swift and I am also having this error: \"Could not find an overload for “init” that accepts the supplied arguments\". Any

3条回答
  •  旧时难觅i
    2020-12-19 18:28

    Confirming what matt says:

    in xCode 6.0 this does work:

    images = [UIImage(named: "steps_normal"), UIImage(named: "steps_big")]
    

    but in xCode6.1 values should be unwrapped:

    images = [UIImage(named: "steps_normal")!, UIImage(named: "steps_big")!]
    

提交回复
热议问题