I am new to Swift Playgrounds but I am slightly familiar with programming from many years ago. I am trying to use the isOnGem command but have not found the information for how it is used. Have I missed a lesson?
isOnGem is not part of Swift. What playground are you using? Did you build one from scratch? isOnGem sounds like a method defined in a class/struct within a particular application, thus, it has to be used within the context of using the containing class/struct.
Thank you for your response. The app I am using is My Playgrounds, ver. 3.2, by Apple. The instructions leave gaps which have to be figured out prior to actually doing any programming.
In the 1960’s I did some programming in Algol, FORTRAN, and Basic so I am familiar with some of the requirements.
Do you have any suggestions for learning Swift on-line?
is "My Playgrounds" the same as "Swift Playgrounds?" "Swift Playgrounds" is an App on the Mac App Store (and the iOS App store) that was originally written for the iPad, but, has recently been ported to Macs. It is billed as being approachable to programming from eight to eighty, and is supposed to be a general primer to programming, but, specifically uses Swift and Swift playgrounds. Reviews point out the first few lessons seem aimed at children, but the subject soon moves into more challenging lessons that even adults will find interesting.
There are several tutorials on-line on Swift. If you perform a search on, for example, "Swift Language tutorials", you'll find links to various resources. It's hard to recommend any of those since 1) I'm not clear on how much general programming background you have, and 2) I'm have not used any of these resources. I've been programming since the '60s as well, but, it has been continuous up through the present, and in a bunch of languages, including the languages you mentioned. I've been getting up to speed on Swift simply using the Swift Language Reference, as well as the Swift forums, the swift.org materials, and the Apple Github Swift projects since much of the background is similar to C++, Java, etc.. You might want to look at what you can find on the Internet to find a tutorial that fits comfortably with your background.
If you do decide to use the Internet resources, be careful about the version of Swift that is being taught. Because Swift is still "swiftly" (pun intended) evolving, there are significant changes going from Swift 3 through Swift 5,
isOnGem is one of the conditions you can check in the Learn to Code 1 book in Swift Playgrounds. It’s introduced on the Using else if page of the Conditional Code chapter and there’s an example of using it on that page.
If you haven’t completed that portion of the book yet, there’s probably another way to solve the problem using concept that you’ve read about already.
There’s also often help associated with commands and conditions if you tap on them (iOS) or Control-click them (macOS).
Thank you. I may have missed that. I will go back and check.