Hello. This code runs well but when I try to upload to App Store, it gives me an error:
Type 'MenuItem' has no member 'example'
Please see the code below.
Thanks for your time in advance.
Thanks.
...............
//
// ItemRow.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 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)
}
}
................................................
my content view is below
//
// ContentView.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 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()
}
}
................
my ItemRow code is below:
//
// ItemRow.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 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)
}
}
Post
Replies
Boosts
Views
Activity
Sorry
Here you go.
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()
}
#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!")
}
}
Hey @Jason, thanks for your responses.
You mentioned:
Please see TestFlight beta testing overview (iOS, macOS, tvOS, watchOS), and contact Developer Support if you have more questions about either TestFlight or App Store Connect.
Your request limits my activity here. I contacted Developer Support and they sent me here. So at this point I understand that I can write any issues I have designing my apps. Unless you represent Apple and in that case, I would call Apple and let them know that this is not a useful comment.
Thanks.
I appreciate your help and your answer was useful. I wasn't talking about your answer. Your answer was totally useful.
But
AGAIN
asking me to contact the Apple Developer if I had more questions, made me frustrated.
It has been a few weeks that I have been trying to find a place to ask my questions, hours on the phone. After tons of phone calls I found a number that I could request a phone call from Apple Developer Team. But every time apple called my number, they sent an email saying that "Your phone sent us to voice mail.
So I called technical support and went through my phone setting for about 45 minutes. But the problem of "going to voice mail" still not resolved.
Finally I found this forum. And you (Apple) did respond. But you sounded like I need to
"contact Developer Support if you have more questions about either TestFlight or App Store Connect".
I am not attacking you. So you don't need to defend yourself.
I have noticed a weakness that is blocking me from contacting Apple Developer Team or even the way this forum works. And I need to address it.
Thanks.
Hello.
Is there anyway to disable the "Screen Recording" when someone is watching a video inside my app?
My goal is not to allow people to screen record my videos in the app.
Thanks.