Education

RSS for tag

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

Education Documentation

Posts under Education tag

34 Posts
Sort by:
Post not yet marked as solved
0 Replies
175 Views
Hi friends. I'm new around here and just migrated from Windows to macOS. I started working on iOS development with Swift. So if you have any study resource suggestions for beginners, can you share them? I am open to all resources such as documents, websites, videos.
Posted
by
Post not yet marked as solved
0 Replies
235 Views
This is the content view which moves down on the screen as I open it from different view. when I click top left button to open menu. The menu When I click the Home option from menu whole view moves down on screen. The whole view gets moved down on screen each time I open it. //the content view import SwiftUI struct ContentView: View {     var body: some View {                       NavigationView{                               ScrollView{                      Text("Men")                          .font(.system(size: 30, weight:.bold))                      .padding(.trailing, 320.0)                  ScrollView(.horizontal){                      HStack{                          NavigationLink(destination:mentshirt()){                          custom(content:Image("mentshirt"),over:"T-shirt",col: .black)                          }                          NavigationLink(destination:menjeans()){                          custom(content:Image("menjeans"),over:"Jeans",col: .black)                          }                          NavigationLink(destination:menjacket()){                          custom(content:Image("menjacket"),over: "Jacket",col: .black)                          }                      }                  }                      Text("Women")                          .font(.system(size: 30,weight: .bold))                          .padding(.trailing,280.0)                  ScrollView(.horizontal){                      HStack{                          NavigationLink(destination:womentshirt()){                          custom(content:Image("womentshirt"),over:"T-shirt",col: .black)                          }                          NavigationLink(destination:womenjeans()){                          custom(content:Image("womenjeans"),over:"Jeans",col: .black)                          }                          NavigationLink(destination:womenjacket()){                          custom(content:Image("womenjacket"),over:"Jacket",col: .black)                          }                      }                  }                      Text("Kids")                          .font(.system(size: 30,weight: .bold))                          .padding(.trailing,320.0)                  ScrollView(.horizontal){                      HStack{                          NavigationLink(destination:kidtshirt()){                              custom(content:Image("kidtshirt"),over:"T-shirt",col:.black)                      }                          NavigationLink(destination:kidjeans()){                          custom(content:Image("kidjeans"),over:"Jeans",col: .black)                          }                              NavigationLink(destination:kidjacket()){                          custom(content:Image("kidjacket"),over:"Jacket",col:.black)                              }                      }                  }                  }                  .navigationBarBackButtonHidden(true)                  .navigationBarItems(leading:                                          NavigationLink(                                          destination: clothlist()){                                                  navcustom(content:                                                             Image(systemName: "line.horizontal.3"),col: .white)                          },                      trailing:                              HStack{                      Image("logo")                          .resizable()                          .clipShape(Circle())                          .shadow(color:.white,radius: 10)                          .frame(width: 30, height: 30, alignment: .center)                              Spacer(minLength: 80)                          NavigationLink(destination: cart()){                              navcustom(content:                                         Image(systemName: "cart"),col: .white)                          }                          Spacer(minLength: 15)                              NavigationLink(destination: login()){                                  navcustom(content:Image(systemName: "person.crop.circle.fill"), col: .white)                              }                          }                  )              }.navigationBarBackButtonHidden(true)             .ignoresSafeArea()         } } struct ContentView_Previews: PreviewProvider {     static var previews: some View {         Group {               ContentView()                 .environment(\.colorScheme, .dark)         }     } } func custom(content:Image,over:String,col:Color) -> some View {     content         .resizable()         .overlay(Text(over).font(.system(size: 20,weight: .bold)).foregroundColor(col),alignment: .bottomLeading)         .frame(width: 400, height: 500, alignment: .center)         .padding(5)                        } func navcustom(content:Image,col:Color)-> some View {     content         .resizable()         .frame(width: 30, height: 30, alignment: .center)         .foregroundColor(col) } //the menu view from which I open content view import SwiftUI struct clothlist: View {     var body: some View {         List         {             NavigationLink(destination:ContentView())             {             Text(Image(systemName: "house"))+Text(" Home")             }             Text(Image(systemName: "person"))+Text(" Men")             NavigationLink(destination:menjeans())             {             Text("Jeans")             }             NavigationLink(destination:menjacket())             {             Text("Jacket")             }             NavigationLink(destination:mentshirt())             {             Text("Tshirt")             }             Text(Image(systemName: "person"))+Text(" Women")             NavigationLink(destination:womenjeans())             {             Text("Jeans")             }             NavigationLink(destination:womenjacket())             {             Text("Jacket")             }             NavigationLink(destination:womentshirt())             {             Text("Tshirt")             }             Group{             Text(Image(systemName: "person"))+Text(" Kids")             NavigationLink(destination:kidjeans())             {             Text("Jeans")             }             NavigationLink(destination:kidjacket())             {             Text("Jacket")             }             NavigationLink(destination:kidtshirt())             {             Text("Tshirt")             }             }         }         .navigationBarBackButtonHidden(true)     } } struct clothlist_Previews: PreviewProvider {     static var previews: some View {         clothlist()     } } how to stop the view from moving down on screen on every open?
Posted
by
Post not yet marked as solved
3 Replies
384 Views
Something wrong with Readline. I can't use readLine()!)! My code is really simple: var aYear = Int(readLine()!)! func isLeap(year: Int) {       var leap = "NO"       //IF divisible by 4 with no remainders.   if year % 4 == 0 {     leap = "YES"     //Is leap year, unless:   }   if year % 100 == 0 {     leap = "NO"     //Is not leap year, unless:   }   if year % 400 == 0 {     leap = "YES"     //Is leap year.   }   print(leap)   } //Don't change this isLeap(year: aYear) This error keeps coming up. I can't figure out how to fix this error: "__lldb_expr_122/readline .playground:1: Fatal error: Unexpectedly found nil while unwrapping an Optional value Playground execution failed: error: Execution was interrupted, reason: EXC_BREAKPOINT (code=1, subcode=0x18f494588). The process has been left at the point where it was interrupted, use "thread return -x" to return to the state before expression evaluation." It is really strange because in online compiler this simple code works just fine. PLEASE HELP ME. I CAN'T FIND THE SOLUTION. It's kinda internal xcode error or what...
Posted
by
Post marked as solved
2 Replies
303 Views
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
Posted
by
Post not yet marked as solved
5 Replies
647 Views
I am 14 years old and would like to participate in the Swift Student Challenge @ WWDC23. I have no experience programming in Swift or any other programming language. What do you suggest to learn Swift?
Posted
by
Post not yet marked as solved
3 Replies
268 Views
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) }
Posted
by
Post not yet marked as solved
2 Replies
358 Views
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
Posted
by
Post not yet marked as solved
2 Replies
296 Views
Hi I heard about WWDC2 and I interested in it. I decided to start Swift but I don’t know from where can I start? Can anyone guide me ? Which source should I use ? And I want to prepare myself for next year WWDC . Thanks :)
Posted
by
Post not yet marked as solved
1 Replies
162 Views
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.
Posted
by
Post not yet marked as solved
1 Replies
143 Views
I'm looking for the Swift tutorial that had always been used since I started learning Swift for the first time about 5 years ago. I can't remember the name. It was an app that reviewed restaurants, as I remember. I need a sample of key-value-coding. I recall that tutorial used key-value-coding.
Posted
by
Post not yet marked as solved
1 Replies
74 Views
Apple has a "Develop in Swift" curriculum with three books available at https://developer.apple.com/learn/curriculum/. However, they link to Apple Books, which isn't available in China. Is there any possible way to download an English copy of it without going through Books? Thanks!
Posted
by
Post not yet marked as solved
1 Replies
162 Views
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?
Posted
by