Post

Replies

Boosts

Views

Activity

DATA
Hello. I have data I need to add to my new app. Below is a simple example of my plants and the data I am adding to my app Aloe Vera a. Medicinal Properties (skin healer) b. How to harvest (Cut from the middle) c. How much water does it need (once every three days) d. Recipe (cut the leaf, use the gel inside for your rash) Almond a. Medicinal Properties (skin healer) b. How to harvest (cut the young leaves) c. How much water does it need (daily) d. Recipe (soak in water overnight, rinse, blend) Raspberry a. Medicinal Properties (skin healer) b. How to harvest (cut from mid branch) c. How much water does it need (twice a day) d. Recipe (mix raspberry with coconut water and blend.) I understand that the above date (information about the four plants) needs to be organized in a Numbers file. The questions are: Where in the app do you import the Numbers file? What is the code? I mean the code that you write for this. So when you click on the Raspberry button, the app jumps to another page with four other buttons (Medicinal Properties, How to harvest, How much water does it need, recipe? Is there a video that shows this? Thanks so much for your time.
3
0
1.4k
Jul ’22
Playground problem & Splitting a tip
I wrote this code to "Playground". The spinning wheel spinner forever and never showed me the total. I opened a new "Playground" file, and it worked perfect. Does anyone know why? Here is the code: Math - Splitting in a restaurant import UIKit var people:Double = 4 var subtotal:Double = 128 var tax = 0.13 var split:Double = 0 let total = (subtotal / people) - (tax) print(total) // Total shows $31.87 for each person Thanks
1
0
1k
Aug ’22
Type 'MenuItem' has no member 'example'
Hello. When I run my app, there is no error message. But when I try to upload to App Store (Build > Archive) it give me an error message: Here is the code: // //  ItemDetail.swift //  a365Planner_2020_07_20 // //  Created by Mahmoud Rajabzadeh Mashhadi on 7/20/20. //  Copyright © 2020 Mahmoud Rajabzadeh Mashhadi. All rights reserved. // import SwiftUI struct ItemDetail: View {     var item: MenuItem          var body: some View {         VStack {             ZStack(alignment: .bottomTrailing) {                 Image(item.mainImage)             }                          ScrollView {                              Text(item.recipe)                     .padding()                     .font(.headline)                 Text(item.ingredient)                    .padding()                 Text(item.instruction)                     .padding()                 Text(item.emTipTitle)                     .padding()                     .font(.headline)                 Text(item.emTip)                     .padding()                 Spacer()             }         }.navigationBarTitle(Text(item.name), displayMode: .inline)     } } struct ItemDetail_Previews: PreviewProvider {     static var previews: some View {         NavigationView {             ItemDetail(item: MenuItem.example)         }     } } thanks so much.
6
0
1k
Sep ’22
error when uploading to App Store ... Type 'MenuItem' has no member 'example'
PROBLEM WITH UPLOADING MY APP TO THE APP STORE Hello. I have a new version of my app in the app store. And I am trying to upload it. But I am running into problems. The app runs well when I run the app on my iPhone or in the simulator. But when I try to upload it to the app store, it gives me an error message. The error message is: Type 'MenuItem' has no member 'example' What am I doing wrong? .......................................................................................................................................... appDelegate import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } // MARK: UISceneSession Lifecycle func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { // Called when a new scene session is being created. // Use this method to select a configuration to create the new scene with. return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) } func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) { // Called when the user discards a scene session. // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. // Use this method to release any resources that were specific to the discarded scenes, as they will not return. } } .......................................................................................................................................... ConentView import SwiftUI struct ContentView: View { let menu = Bundle.main.decode([MenuSection].self, from: "menu.json") var body: some View { NavigationView { List { ForEach(menu) { section in Section(header: Text(section.name)) { ForEach(section.items) { item in ItemRow(item: item) } } } } .navigationBarTitle("Full Self Drive 365") .listStyle(GroupedListStyle()) } } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } } .......................................................................................................................................... Item Row import SwiftUI struct ItemRow: View { var item: MenuItem var body: some View { NavigationLink(destination: ItemDetail(item: item)) { HStack { Image(item.thumbnailImage) .clipShape(Circle()) .overlay(Circle().stroke(Color.blue, lineWidth: 2)) Text(item.name) } } } } struct ItemRow_Previews: PreviewProvider { static var previews: some View { ItemRow(item: MenuItem.example) } } .......................................................................................................................................... Item Detail import SwiftUI struct ItemDetail: View { var item: MenuItem var body: some View { VStack { ZStack(alignment: .bottomTrailing) { Image(item.mainImage) } ScrollView { Text(item.recipe) .padding() .font(.headline) Text(item.ingredient) .font(.subheadline) .padding() Text(item.instruction) .padding() .font(.subheadline) Text(item.emTipTitle) .padding() .font(.headline) Text(item.emTip) .padding() .font(.subheadline) Spacer() } }.navigationBarTitle(Text(item.name), displayMode: .inline) } } .......................................................................................................................................... Menu import SwiftUI struct MenuSection: Codable, Identifiable { var id: UUID var name: String var items: [MenuItem] } struct MenuItem: Codable, Equatable, Identifiable { var id: UUID var name: String var recipe: String var ingredient: String var instruction: String var emTipTitle: String var emTip: String var mainImage: String { name.replacingOccurrences(of: " ", with: "-").lowercased() } var thumbnailImage: String { "\(mainImage)-thumb" } #if DEBUG static let example = MenuItem(id: UUID(), name: "Maple French Toast", recipe: "Breakfast Icecream", ingredient: "Sweet, fluffy, and served piping hot, our French toast is flown in fresh every day from Maple City, Canada, which is where all maple syrup in the world comes from. And if you believe that, we have some land to sell you…", instruction: "Cook it", emTipTitle: "Energy management", emTip: "Practice 5 minute rule") #endif } struct Menu_Previews: PreviewProvider { static var previews: some View { Text("Full Self Drive 365!") } } .......................................................................................................................................... order import SwiftUI class Order { var items = [MenuItem] () func add(item: MenuItem) { items.append(item) } func remove(item: MenuItem) { if let index = items.firstIndex(of: item) { items.remove(at: index) } } } struct Order_Previews: PreviewProvider { static var previews: some View { /@START_MENU_TOKEN@/Text("Hello, World!")/@END_MENU_TOKEN@/ } } .......................................................................................................................................... Thanks so much.
2
0
645
Sep ’22
app in review
Good morning everyone. I recently uploaded an app to the app store (Version 14). On the iTunesConnect page, I can see my version 14 app. It shows "Waiting for Review." That means Apple has received the app, and someone from Apple will soon review my app. Am I correct? Also, when I clicked on the app, I went to another page where I could add someone (myself in this case) to test the app. But when I add myself as a tester, it says "No Builds Available." That doesn't make sense. I already uploaded an app that shows it is ready for review but also indicates "No Builds Available." Please help me understand. Thanks so much for your time.
4
0
1.4k
Oct ’22