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

113 Posts

Post

Replies

Boosts

Views

Activity

My view moves down and down with every opening of that view.
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?
0
0
1.3k
Mar ’22
Ive created a login view but as soon as I leave that view all the textfield and password field is empty.
I want the details entered in textfield and password should stay even after changing the view or closing the app and the person should be logged in even after he closes the app, Can anyone help me out? import SwiftUI import Firebase struct login: View {     @State var chec:String=""     @State var email:String=""     @State var navigated = false     @State var loggedin:Bool=false     @State var pass:String=""     @State private var secured:Bool=true     var body: some View     {                 VStack                 {                     if(loggedin==true)                     {                     Image("logo")                         .resizable()                         .clipShape(Circle())                         .shadow(color:.green,radius: 10)                         .frame(width: 200, height: 200, alignment: .center)                     }                     else                     {                         Image("logo")                             .resizable()                             .clipShape(Circle())                             .shadow(color:.red,radius: 10)                             .frame(width: 200, height: 200, alignment: .center)                     }                     Spacer(minLength: 50.0)                     Text(chec)                         .foregroundColor(.red)                     HStack                     {                         Text("E-mail:")                         TextField("", text:$email)                             .foregroundColor(.white)                             .frame(width: 275)                             .textFieldStyle(.roundedBorder)                             .autocapitalization(.none)                             .disableAutocorrection(true)                     }                         HStack                         {                         Text("Password:")                             if secured                             {                                 SecureField("",text:$pass)                                     .background(Color.black)                                     .foregroundColor(.white)                                     .textFieldStyle(.roundedBorder)                                     .autocapitalization(.none)                                     .disableAutocorrection(true)                             }                             else                             {                                 TextField("",text: $pass)                                     .background(Color.black)                                     .foregroundColor(.white)                                     .textFieldStyle(.roundedBorder)                                     .autocapitalization(.none)                                     .disableAutocorrection(true)                             }                             Button(action: {self.secured.toggle()})                             {                                 if secured                                 {                                     Image(systemName:"eye.slash")                                 }                                 else                                 {                                     Image(systemName:"eye")                                 }                             }.buttonStyle(BorderlessButtonStyle())                         }                     VStack{                         Button(action: {                             if(email==""&&pass=="")                             {                                 chec="Enter E-mail and Password"                             }                             else if(pass=="")                             {                                 chec="Enter Password"                             }                             else if(email=="")                             {                                 chec="Enter E-mail"                             }                             guard !email.isEmpty,!pass.isEmpty else                         {                             return                         }                             loginfunc()                         }){                             Text("Login")                         }                         NavigationLink(destination: signup(),label:{Text("Not Yet signed? Create new account")})                             .padding(.top, 3.0)                     }                     .padding()                     Spacer(minLength: 400)                 }                      }     func loginfunc(){         Auth.auth().signIn(withEmail: email, password: pass) { result, error in             if error != nil{                 print(error?.localizedDescription ?? "")                 loggedin=false                 chec="E-mail or Password wrong!"             }else {                 print("success")                 loggedin=true             }             if(loggedin==true)             {                 chec=""                 print("wow so nice to get work done")             }         }     } } //} struct ButtonView: View {     var buttext:String     var body: some View {         Text(buttext)         .frame(width: 200, height: 100, alignment: .center)         .background(Color.black)         .foregroundColor(Color.white)     } } struct login_Previews: PreviewProvider {     static var previews: some View {         login()             .environment(\.colorScheme, .dark)     } }
1
0
984
Mar ’22
I tried using multilinetextalignment but my text is not aligning on left of iPhone screen, what is the reason for it?
import SwiftUI struct lastview: View {     var img:UIImage     var texty:String     var body: some View {         ScrollView(.vertical){         Image(uiImage: img)             .resizable()             .frame(width: 500, height: 500, alignment: .center)             Text(texty)                 .multilineTextAlignment(.leading)                          }     } }
1
0
1.1k
Mar ’22
I used array to print image. but I also want to print text with the images using array how can I use it ,like I want to use same tray but want to print different text with their images using the same array like 2D array.
import SwiftUI struct menjeans: View {     var menje:[UIImage] =         [UIImage(named:"IMG_9917")!,         UIImage(named:"IMG_9920")!,         UIImage(named:"IMG_9923")!]     let layout=[GridItem(.flexible()),GridItem(.flexible())]     var body: some View     {         NavigationView         {             ScrollView(.vertical)             {             LazyVGrid(columns: layout,spacing: 2)                 {                 ForEach(menje, id: .self)                     {                     imager in                         maincustom(content: Image(uiImage:imager), text: "df")                     }                     .navigationBarTitle("Men")                 }             }         }     } } struct menjeans_Previews: PreviewProvider {     static var previews: some View {         menjeans()     } }
0
0
1.1k
Feb ’22
"code in Objective-C to maintain"
I am learning Swift and when I was casually browsing for job openings to see what the employers expect one thing caught my eyes. It says something like, In addition to Swift, "code in Objective-C to maintain" What does that mean? If I learn Swift and have a good understanding, will learning and using Obj-C be easier? Is it a common requirement for iOS/macOS developers? Appreciate your time!
1
0
590
Jan ’22
Developer Site Changes Doc?
There are many nice changes here in recent years. Is there a document or page that outlines and explains the changes to the Developer portal that resulted in the excellent Document Archive no longer being maintained? https://developer.apple.com/library/archive/navigation/# Is there currently a reliable way to search for all of the newer sample code and documents within one list/view?
0
0
678
Nov ’21
Guided Project-Apple Pie: How to use map method in place of loop?
I’m going through Develop in Swift Fundamentals and I’m stuck at a problem where it says “Learn about the map method, and use it in place of the loop that converts the array of characters to an array of strings in updateUI().” Here’s the code:  var letters = [String]() for letter in currentGame.formattedWord { letters.append(String(letter)) } Thanks in advance.
1
0
1.2k
Sep ’21
Paid version(School Edition) of my free app got rejected
I have a kids / education app in the store. My app is free with limited functionality and users need to buy in-app purchase option for upgrade. Recently I got some emails from school / institutions asking if they could get the upgrade version app via School Manager. It seems like it's impossible to buy in-app purchase in bulk via School Manager. (Please correct me if I'm wrong about this.) So I built and submitted a separate paid version of my app with "School Edition" added to the name and no in-app purchase. But this app got rejected with the following message. "This app duplicates the content and functionality of other apps submitted by you or another developer to the App Store, which is considered a form of spam." I replied that many other developers are doing the same approach and they are live on the app store. They gave me a short answer saying that they can't provide feedback on app concept and I need to review the guidelines. I know there have been many apps that had both Lite (free) and Pro (paid) version. And there are still many apps that have the same approach such as MathTango. MathTango https://apps.apple.com/us/app/mathtango/id1234698308 https://apps.apple.com/us/app/mathtango-school-edition/id1333842226 Is there anyone else who had the similar issue or who could give some advice on this?
0
0
921
Sep ’21
Hi I am getting a blank screen when I run the following code in my Xcode project
// //  ContentView.swift //  NewsReader // //  Created by Rashid  Vohra on 7/7/21. // import SwiftUI struct Result: Codable {     var articles: [Article] } struct Article: Codable {     var url: String     var title: String     var description: String?     var urlToImage: String? } struct ContentView: View {     private let url = "https://newsapi.org/v2/top-headlines?country=us&category=business&apiKey=49d5bfa113c34ec0af781fab38395996"               @State private var articles = [ Article ()          func fetchData() {         guard let url = URL(string: url) else {             print("URL is not valid")             return         }                  let request = URLRequest(url: url)                  URLSession.shared.dataTask(with: request) {             data, response, error in             if let data = data {                 if let decodedResult = try?                     JSONDecoder().decode(                         Result.self, from: data) {                                          DispatchQueue.main.async {                                                self.articles =                             decodedResult.articles                     }                     return                 }             }             print ("Error: (error?.localizedDescription ?? "Unknown Error") ")         }.resume()     }          var body: some View {                           List(articles, id: .url) { item in             HStack(alignment: .top) {                                 VStack(alignment: .leading) {                     Text(item.title)                         .font(.headline)                     Text(item.description ?? "")                         .font(.footnote)                 }             }.onAppear(perform: fetchData)         }     } } struct ContentView_Previews: PreviewProvider {     static var previews: some View {         ContentView()     } }
2
0
1.1k
Aug ’21
Right to left page transition in swift ui using navigation link
I am using navigation link to navigate using a button which is log out button when i click the button it takes me straight to login page i want the transition effect of the page to start from right to left instead of the opposite which is occurring              NavigationLink("", destination: login(),isActive: $goWhenTrue)           Button (action: { print("Button Tapped")}, label: {               Text("LogOut")                 .font(.headline)                 .foregroundColor(.white)                 .frame(width: 340, height: 50)                 .background(Color.blue)                 .clipShape(Capsule())                 .padding()                 .onTapGesture {                                       self.goWhenTrue = true                   if ((UserDefaults.standard.string(forKey: "Username") != nil)) {                     UserDefaults.standard.removeObject(forKey: "Username")
0
0
1.1k
Aug ’21
My view moves down and down with every opening of that view.
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?
Replies
0
Boosts
0
Views
1.3k
Activity
Mar ’22
Resource recommendations for beginners?
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.
Replies
0
Boosts
0
Views
516
Activity
Mar ’22
Ive created a login view but as soon as I leave that view all the textfield and password field is empty.
I want the details entered in textfield and password should stay even after changing the view or closing the app and the person should be logged in even after he closes the app, Can anyone help me out? import SwiftUI import Firebase struct login: View {     @State var chec:String=""     @State var email:String=""     @State var navigated = false     @State var loggedin:Bool=false     @State var pass:String=""     @State private var secured:Bool=true     var body: some View     {                 VStack                 {                     if(loggedin==true)                     {                     Image("logo")                         .resizable()                         .clipShape(Circle())                         .shadow(color:.green,radius: 10)                         .frame(width: 200, height: 200, alignment: .center)                     }                     else                     {                         Image("logo")                             .resizable()                             .clipShape(Circle())                             .shadow(color:.red,radius: 10)                             .frame(width: 200, height: 200, alignment: .center)                     }                     Spacer(minLength: 50.0)                     Text(chec)                         .foregroundColor(.red)                     HStack                     {                         Text("E-mail:")                         TextField("", text:$email)                             .foregroundColor(.white)                             .frame(width: 275)                             .textFieldStyle(.roundedBorder)                             .autocapitalization(.none)                             .disableAutocorrection(true)                     }                         HStack                         {                         Text("Password:")                             if secured                             {                                 SecureField("",text:$pass)                                     .background(Color.black)                                     .foregroundColor(.white)                                     .textFieldStyle(.roundedBorder)                                     .autocapitalization(.none)                                     .disableAutocorrection(true)                             }                             else                             {                                 TextField("",text: $pass)                                     .background(Color.black)                                     .foregroundColor(.white)                                     .textFieldStyle(.roundedBorder)                                     .autocapitalization(.none)                                     .disableAutocorrection(true)                             }                             Button(action: {self.secured.toggle()})                             {                                 if secured                                 {                                     Image(systemName:"eye.slash")                                 }                                 else                                 {                                     Image(systemName:"eye")                                 }                             }.buttonStyle(BorderlessButtonStyle())                         }                     VStack{                         Button(action: {                             if(email==""&&pass=="")                             {                                 chec="Enter E-mail and Password"                             }                             else if(pass=="")                             {                                 chec="Enter Password"                             }                             else if(email=="")                             {                                 chec="Enter E-mail"                             }                             guard !email.isEmpty,!pass.isEmpty else                         {                             return                         }                             loginfunc()                         }){                             Text("Login")                         }                         NavigationLink(destination: signup(),label:{Text("Not Yet signed? Create new account")})                             .padding(.top, 3.0)                     }                     .padding()                     Spacer(minLength: 400)                 }                      }     func loginfunc(){         Auth.auth().signIn(withEmail: email, password: pass) { result, error in             if error != nil{                 print(error?.localizedDescription ?? "")                 loggedin=false                 chec="E-mail or Password wrong!"             }else {                 print("success")                 loggedin=true             }             if(loggedin==true)             {                 chec=""                 print("wow so nice to get work done")             }         }     } } //} struct ButtonView: View {     var buttext:String     var body: some View {         Text(buttext)         .frame(width: 200, height: 100, alignment: .center)         .background(Color.black)         .foregroundColor(Color.white)     } } struct login_Previews: PreviewProvider {     static var previews: some View {         login()             .environment(\.colorScheme, .dark)     } }
Replies
1
Boosts
0
Views
984
Activity
Mar ’22
I tried using multilinetextalignment but my text is not aligning on left of iPhone screen, what is the reason for it?
import SwiftUI struct lastview: View {     var img:UIImage     var texty:String     var body: some View {         ScrollView(.vertical){         Image(uiImage: img)             .resizable()             .frame(width: 500, height: 500, alignment: .center)             Text(texty)                 .multilineTextAlignment(.leading)                          }     } }
Replies
1
Boosts
0
Views
1.1k
Activity
Mar ’22
Swift Challenge
Hi guys I want to participate in the Swift Student Challenge this year. Any suggestions on how to prepare for it?
Replies
1
Boosts
0
Views
803
Activity
Feb ’22
I used array to print image. but I also want to print text with the images using array how can I use it ,like I want to use same tray but want to print different text with their images using the same array like 2D array.
import SwiftUI struct menjeans: View {     var menje:[UIImage] =         [UIImage(named:"IMG_9917")!,         UIImage(named:"IMG_9920")!,         UIImage(named:"IMG_9923")!]     let layout=[GridItem(.flexible()),GridItem(.flexible())]     var body: some View     {         NavigationView         {             ScrollView(.vertical)             {             LazyVGrid(columns: layout,spacing: 2)                 {                 ForEach(menje, id: .self)                     {                     imager in                         maincustom(content: Image(uiImage:imager), text: "df")                     }                     .navigationBarTitle("Men")                 }             }         }     } } struct menjeans_Previews: PreviewProvider {     static var previews: some View {         menjeans()     } }
Replies
0
Boosts
0
Views
1.1k
Activity
Feb ’22
"code in Objective-C to maintain"
I am learning Swift and when I was casually browsing for job openings to see what the employers expect one thing caught my eyes. It says something like, In addition to Swift, "code in Objective-C to maintain" What does that mean? If I learn Swift and have a good understanding, will learning and using Obj-C be easier? Is it a common requirement for iOS/macOS developers? Appreciate your time!
Replies
1
Boosts
0
Views
590
Activity
Jan ’22
Developer Site Changes Doc?
There are many nice changes here in recent years. Is there a document or page that outlines and explains the changes to the Developer portal that resulted in the excellent Document Archive no longer being maintained? https://developer.apple.com/library/archive/navigation/# Is there currently a reliable way to search for all of the newer sample code and documents within one list/view?
Replies
0
Boosts
0
Views
678
Activity
Nov ’21
C# on terminal
which are the commands to compile and execute C # in the terminal
Replies
0
Boosts
0
Views
592
Activity
Sep ’21
Guided Project-Apple Pie: How to use map method in place of loop?
I’m going through Develop in Swift Fundamentals and I’m stuck at a problem where it says “Learn about the map method, and use it in place of the loop that converts the array of characters to an array of strings in updateUI().” Here’s the code:  var letters = [String]() for letter in currentGame.formattedWord { letters.append(String(letter)) } Thanks in advance.
Replies
1
Boosts
0
Views
1.2k
Activity
Sep ’21
Paid version(School Edition) of my free app got rejected
I have a kids / education app in the store. My app is free with limited functionality and users need to buy in-app purchase option for upgrade. Recently I got some emails from school / institutions asking if they could get the upgrade version app via School Manager. It seems like it's impossible to buy in-app purchase in bulk via School Manager. (Please correct me if I'm wrong about this.) So I built and submitted a separate paid version of my app with "School Edition" added to the name and no in-app purchase. But this app got rejected with the following message. "This app duplicates the content and functionality of other apps submitted by you or another developer to the App Store, which is considered a form of spam." I replied that many other developers are doing the same approach and they are live on the app store. They gave me a short answer saying that they can't provide feedback on app concept and I need to review the guidelines. I know there have been many apps that had both Lite (free) and Pro (paid) version. And there are still many apps that have the same approach such as MathTango. MathTango https://apps.apple.com/us/app/mathtango/id1234698308 https://apps.apple.com/us/app/mathtango-school-edition/id1333842226 Is there anyone else who had the similar issue or who could give some advice on this?
Replies
0
Boosts
0
Views
921
Activity
Sep ’21
Hi I am getting a blank screen when I run the following code in my Xcode project
// //  ContentView.swift //  NewsReader // //  Created by Rashid  Vohra on 7/7/21. // import SwiftUI struct Result: Codable {     var articles: [Article] } struct Article: Codable {     var url: String     var title: String     var description: String?     var urlToImage: String? } struct ContentView: View {     private let url = "https://newsapi.org/v2/top-headlines?country=us&category=business&apiKey=49d5bfa113c34ec0af781fab38395996"               @State private var articles = [ Article ()          func fetchData() {         guard let url = URL(string: url) else {             print("URL is not valid")             return         }                  let request = URLRequest(url: url)                  URLSession.shared.dataTask(with: request) {             data, response, error in             if let data = data {                 if let decodedResult = try?                     JSONDecoder().decode(                         Result.self, from: data) {                                          DispatchQueue.main.async {                                                self.articles =                             decodedResult.articles                     }                     return                 }             }             print ("Error: (error?.localizedDescription ?? "Unknown Error") ")         }.resume()     }          var body: some View {                           List(articles, id: .url) { item in             HStack(alignment: .top) {                                 VStack(alignment: .leading) {                     Text(item.title)                         .font(.headline)                     Text(item.description ?? "")                         .font(.footnote)                 }             }.onAppear(perform: fetchData)         }     } } struct ContentView_Previews: PreviewProvider {     static var previews: some View {         ContentView()     } }
Replies
2
Boosts
0
Views
1.1k
Activity
Aug ’21
Right to left page transition in swift ui using navigation link
I am using navigation link to navigate using a button which is log out button when i click the button it takes me straight to login page i want the transition effect of the page to start from right to left instead of the opposite which is occurring              NavigationLink("", destination: login(),isActive: $goWhenTrue)           Button (action: { print("Button Tapped")}, label: {               Text("LogOut")                 .font(.headline)                 .foregroundColor(.white)                 .frame(width: 340, height: 50)                 .background(Color.blue)                 .clipShape(Capsule())                 .padding()                 .onTapGesture {                                       self.goWhenTrue = true                   if ((UserDefaults.standard.string(forKey: "Username") != nil)) {                     UserDefaults.standard.removeObject(forKey: "Username")
Replies
0
Boosts
0
Views
1.1k
Activity
Aug ’21