Education

RSS for tag

Teach students of all ages to code in Swift using a variety of resources in your curriculum.

Posts under Education tag

108 Posts

Post

Replies

Boosts

Views

Activity

Develop in Swift Explorations/Xcode 13: downloaded lessons not loading while working on programming files
Hello I am teaching xCode using the textbook Develop in Swift Explorations/Xcode 13.  We're using the associated lessons in the xCode Dev environment.  We're having issues with the lessons not completely loading - the results panel is blank. We've tried restarting the program, the computer, and toggling to the previous lesson within the program to try and get it to reload. Nothing resolves it. The files have been downloaded. Perhaps they take alot of RAM to run, and the computers are full? I've looked at the RAM and seem to have enough, but maybe not? Help/advice appreciated.
0
0
1.1k
Oct ’22
"Could not display guide" message
I created a swiftpm project with Xcode Version 13.4.1 (13F100). I changed the target from the default created by Xcode to this:     targets: [         .executableTarget(             name: "App",             path: "App"         )     ] I also changed the package version to 5.6 to match the AboutMe Package file. I also created an App directory and moved all my files (bar the Package.swift file) to it, and I also created a Guide folder and created a Guide.tutorial file based on the example in the WWDC video. I've turned on Author Debugging Mode (this is on Swift Playgrounds on the Mac, I'll try later on Swift Playgrounds on the iPad), but I get no messages other than the "Could not display guide. Try reopening the current project..." I also get a build error that just says "Building failed" What am I missing?
2
0
3.1k
Sep ’22
1099-K How to report this?
If you grossed over $20,000 (or 200 sales) in sales from Apple you will receive a 1099-K.There are 2 problems with this:1) This will NOT reflect the 30% that Apple has withheld.2) A 1099-K will only be sent for those regions that meet the criteria for Apple issuing a 1099-K. Thus, this won't reflect all of your sales. Note: this is an assumption as I had more sales then this 1099-K reflects. In my case, I only received a 1099-K for US sales (I assume as it doesn't say). As a result, the difference from what the 1099k is reporting and what I actually received is only 12%, not 30%. That is, for example, the 1099-K says that I had$20,000 in sales, but what was actually deposited in my account was $17,600.How did you guys/gals fortunate/unfortunate enough to receive a 1099-K report this on your taxes?Did you, for example, have:a) 1099-K income of $20,000 with a business expense of 30% = $14,000b) Addional non-reported income of ($17,600-$14,000) = $3600Total: $17,600 (amount actually received from Apple sales)-OR-a) 1099-K income of $20,000 with a business expense of 12% = $17,600Thanks for the help with this!
8
1
13k
Aug ’22
problem with ForEach loop
when I'm using for each loop(using repeat command) instead of printing 5 items it is printing 10 times, it always doubles my command it is my code NavigationView {             ScrollView {                 ScrollView(.horizontal , showsIndicators: false){                     HStack(spacing: -10){                         ForEach(0..<5) { item in                             NavigationLink(destination: DetailView()) {                                 CardView()                             CardView()
2
0
1.5k
Aug ’22
Store a result in a constant
Hi, I am doing the first question of the last exercise on the following screenshot. However, I don't really understand the two questions. How is it possible to store a result in a constant, if the result itself is declared with 'let', making it a constant? I sure am not understanding correctly the question, understandable with the fact I just started learning code. Here's the block of code.     let total = pigsFlying + frogsBecomingPrinces + multipleLightningStrikes     return total } /*:  - callout(Exercise): Update the `impossibleBeliefsCount` function so that instead of printing the value, it returns it as an `Int`. `impossibleThingsPhrase` creates a phrase using string interpolation:  */ func impossibleThingsPhrase(numberOfImpossibleThings: Int, meal: String) -> String {     return "Why, I've believed as many as \(numberOfImpossibleThings) before \(meal)" } impossibleThingsPhrase(numberOfImpossibleThings: 712, meal: "chicken") /*:  - callout(Exercise): Update the `impossibleThingsPhrase` function so that, instead of using its two internal constants, it takes two arguments: `numberOfImpossibleThings` as an `Int` and `meal` as a `String`. Now you have two functions that take parameters and return values.  - callout(Exercise): Call `impossibleBeliefsCount` and store the result in a constant.\ Call `impossibleThingsPhrase`, passing in the result of `impossibleBeliefsCount` as one of the arguments.  */ func impossibleBeliefsCount(pigsFlying: Int, frogsBecomingPrinces: Int, multipleLightningStrikes: Int) {     let total = pigsFlying + frogsBecomingPrinces + multipleLightningStrikes     return total }
2
0
1.7k
Jul ’22
Where can I find a logical disjunction operator or function for Swift?
Is there a logical disjunction operator or function in Swift? Even better, is there a logical disjunction that works with optional variables instead of boolean variables that returns an object when true, and returns nil when false? A logical disjunction evaluates two boolean variables, and if at least one of them is true, then the return value is true. If neither variables is true, then the return value is false.
1
0
1.3k
Jun ’22
Expected declaration
Hello, I've been attempting to generate this code, but the last line returns an Expected declaration Error. class AboutMe { let firstName: String let lastName: String let age: Int init(firstName: String, lastName: String, age: Int){ self.firstName = firstName self.lastName = lastName self.age = age } var me: String { return "First Name: \(firstName), / Last Name: \(lastName), / Age: \(age)" } let myInfo = AboutMe(firstName: "NAME", lastName: "NAME", age: 10) print(myInfo) }
3
0
1.1k
May ’22
For Swift Student Challenge, must all content be in English?
Hello all, I was wondering in the Swift Student Challenge requirements, it states: All content should be in English. What if my game is mainly in English (UI, main content,) but some foreign language (glyph to be specific) is used as part of app. The judge should be able to use the app without any fluency other than English. Will including some foreign language disqualify my entry? Thank you so much for answering my question. Nico
2
0
1.1k
Apr ’22
Develop in Swift Explorations/Xcode 13: downloaded lessons not loading while working on programming files
Hello I am teaching xCode using the textbook Develop in Swift Explorations/Xcode 13.  We're using the associated lessons in the xCode Dev environment.  We're having issues with the lessons not completely loading - the results panel is blank. We've tried restarting the program, the computer, and toggling to the previous lesson within the program to try and get it to reload. Nothing resolves it. The files have been downloaded. Perhaps they take alot of RAM to run, and the computers are full? I've looked at the RAM and seem to have enough, but maybe not? Help/advice appreciated.
Replies
0
Boosts
0
Views
1.1k
Activity
Oct ’22
"Could not display guide" message
I created a swiftpm project with Xcode Version 13.4.1 (13F100). I changed the target from the default created by Xcode to this:     targets: [         .executableTarget(             name: "App",             path: "App"         )     ] I also changed the package version to 5.6 to match the AboutMe Package file. I also created an App directory and moved all my files (bar the Package.swift file) to it, and I also created a Guide folder and created a Guide.tutorial file based on the example in the WWDC video. I've turned on Author Debugging Mode (this is on Swift Playgrounds on the Mac, I'll try later on Swift Playgrounds on the iPad), but I get no messages other than the "Could not display guide. Try reopening the current project..." I also get a build error that just says "Building failed" What am I missing?
Replies
2
Boosts
0
Views
3.1k
Activity
Sep ’22
1099-K How to report this?
If you grossed over $20,000 (or 200 sales) in sales from Apple you will receive a 1099-K.There are 2 problems with this:1) This will NOT reflect the 30% that Apple has withheld.2) A 1099-K will only be sent for those regions that meet the criteria for Apple issuing a 1099-K. Thus, this won't reflect all of your sales. Note: this is an assumption as I had more sales then this 1099-K reflects. In my case, I only received a 1099-K for US sales (I assume as it doesn't say). As a result, the difference from what the 1099k is reporting and what I actually received is only 12%, not 30%. That is, for example, the 1099-K says that I had$20,000 in sales, but what was actually deposited in my account was $17,600.How did you guys/gals fortunate/unfortunate enough to receive a 1099-K report this on your taxes?Did you, for example, have:a) 1099-K income of $20,000 with a business expense of 30% = $14,000b) Addional non-reported income of ($17,600-$14,000) = $3600Total: $17,600 (amount actually received from Apple sales)-OR-a) 1099-K income of $20,000 with a business expense of 12% = $17,600Thanks for the help with this!
Replies
8
Boosts
1
Views
13k
Activity
Aug ’22
problem with ForEach loop
when I'm using for each loop(using repeat command) instead of printing 5 items it is printing 10 times, it always doubles my command it is my code NavigationView {             ScrollView {                 ScrollView(.horizontal , showsIndicators: false){                     HStack(spacing: -10){                         ForEach(0..<5) { item in                             NavigationLink(destination: DetailView()) {                                 CardView()                             CardView()
Replies
2
Boosts
0
Views
1.5k
Activity
Aug ’22
Store a result in a constant
Hi, I am doing the first question of the last exercise on the following screenshot. However, I don't really understand the two questions. How is it possible to store a result in a constant, if the result itself is declared with 'let', making it a constant? I sure am not understanding correctly the question, understandable with the fact I just started learning code. Here's the block of code.     let total = pigsFlying + frogsBecomingPrinces + multipleLightningStrikes     return total } /*:  - callout(Exercise): Update the `impossibleBeliefsCount` function so that instead of printing the value, it returns it as an `Int`. `impossibleThingsPhrase` creates a phrase using string interpolation:  */ func impossibleThingsPhrase(numberOfImpossibleThings: Int, meal: String) -> String {     return "Why, I've believed as many as \(numberOfImpossibleThings) before \(meal)" } impossibleThingsPhrase(numberOfImpossibleThings: 712, meal: "chicken") /*:  - callout(Exercise): Update the `impossibleThingsPhrase` function so that, instead of using its two internal constants, it takes two arguments: `numberOfImpossibleThings` as an `Int` and `meal` as a `String`. Now you have two functions that take parameters and return values.  - callout(Exercise): Call `impossibleBeliefsCount` and store the result in a constant.\ Call `impossibleThingsPhrase`, passing in the result of `impossibleBeliefsCount` as one of the arguments.  */ func impossibleBeliefsCount(pigsFlying: Int, frogsBecomingPrinces: Int, multipleLightningStrikes: Int) {     let total = pigsFlying + frogsBecomingPrinces + multipleLightningStrikes     return total }
Replies
2
Boosts
0
Views
1.7k
Activity
Jul ’22
Where can I find a logical disjunction operator or function for Swift?
Is there a logical disjunction operator or function in Swift? Even better, is there a logical disjunction that works with optional variables instead of boolean variables that returns an object when true, and returns nil when false? A logical disjunction evaluates two boolean variables, and if at least one of them is true, then the return value is true. If neither variables is true, then the return value is false.
Replies
1
Boosts
0
Views
1.3k
Activity
Jun ’22
Expected declaration
Hello, I've been attempting to generate this code, but the last line returns an Expected declaration Error. class AboutMe { let firstName: String let lastName: String let age: Int init(firstName: String, lastName: String, age: Int){ self.firstName = firstName self.lastName = lastName self.age = age } var me: String { return "First Name: \(firstName), / Last Name: \(lastName), / Age: \(age)" } let myInfo = AboutMe(firstName: "NAME", lastName: "NAME", age: 10) print(myInfo) }
Replies
3
Boosts
0
Views
1.1k
Activity
May ’22
Python
When I go to my terminal and type in "python" or "python --version" I get back "command not found: python" I have the newest version downloaded but not even version 2 isn't showing up. What do I do? I even just factory reset my mac. I'm running the M1 mini
Replies
4
Boosts
0
Views
2k
Activity
May ’22
For Swift Student Challenge, must all content be in English?
Hello all, I was wondering in the Swift Student Challenge requirements, it states: All content should be in English. What if my game is mainly in English (UI, main content,) but some foreign language (glyph to be specific) is used as part of app. The judge should be able to use the app without any fluency other than English. Will including some foreign language disqualify my entry? Thank you so much for answering my question. Nico
Replies
2
Boosts
0
Views
1.1k
Activity
Apr ’22