isHidden not working at Xcode 6.2

Hi,


I just started to learn IOS programing and from the first day I have trouble. At the online course with Xcode 8 this guy is using .isHidden method but my Xcode does not recognize isHidden. What should I do? and will this problem occur all the time?

What class's "isHidden" are you trying to use? UIView? Can you show us a line of code that produces an error message, and what is the exact error message?


Because of the API's origins in the Obj-C world, pre Swift, in some classes there is an ambiguity between the property name "hidden" and the accessor (method, function) name "isHidden". Different versions of Swift have handled this differently. In Xcode 6.2's version of Swift, you will likely have to get the value like this:


    let wasHidden = myView.isHidden


but set the value like this:


    myView.hidden = shouldBeHidden

What should I do?

Install the appropriate version of Xcode. Upgrade your macOS if needed.


will this problem occur all the time?

YES, if you keep using your old Xcode. Swift has changed so rapidly since the era of Xcode 6.2, that all practical codes written for Xcode 8 do not compile on Xcode 6.2.


If you really want to learn IOS programing, you should better use the latest release version of Xcode and choose tutorials or courses based on the same version of Xcode. Or else you may need to take much more time to learn how to back-port Swift codes than to learn iOS programming.

isHidden not working at Xcode 6.2
 
 
Q