mardi 30 décembre 2014

How to check for multiple if-conditions in swift

I know this questions sounds silly and it totally is. But somehow I cannot get Xcode (Version 6.1.1 (6A2008a)) to recognize my if-statement is swift. I have tried several different syntaxes and Xcode seems to accept none of them. Here is what I am trying to do:


if (self.status == self.statusRunning && self.nextEpisode == nil) { self.complete = false } else { self.complete = true }


The first part is a simple string comparison between a class property (var ...) and constant (let ...). The second part should just check whether the class property (var nextEpisode:Episode?) is still nil or has already been filled. After that another class property should be set accordingly.


Although I'm still new to swift this seems like a rather minor problem bug Xcode keeps throwing different errors, so I just turn to you guys to tell me whether my syntax or my Xcode is messed up...


Cheers,


Jan


Edit:Error Source https://gist.github.com/Jan0707/a111762fe0c65bb1f84f


Aucun commentaire:

Enregistrer un commentaire