That does'n work for me, terminal says Using Previews Device Set: '/Users/mcrich/Library/Developer/Xcode/UserData/Previews/Simulator Devices'
Post
Replies
Boosts
Views
Activity
ask on apple forums not dev apple forums
I am so sorry for the confusion, here is everything:
struct Final_Restaurant_View: View {
var data: [RestaurantListViewModel]
@State private var isHome = false
var body: some View {
NavigationView{
VStack {
if data.count == 0 {
Text("No Picks Found")
}else {
List(data) {
data in
Section(header: Text("GroupPicks")) {
layout(data: data)
}
// layout(data: data)
}
.listStyle(GroupedListStyle())
}
Button(action: {
isHome = true
}, label: {
Text("Go Home")
})
.padding()
}
.fullScreenCover(isPresented: $isHome, content: {
ContentView(join: false)
})
.navigationBarTitle("Results")
}
}
}
struct layout: View {
var data: RestaurantListViewModel
var body: some View {
HStack {
URLImage(data.imageUrl) { image in
image
.resizable()
.aspectRatio(contentMode: .fill)
.clipped()
.frame(maxWidth: 30, maxHeight: 30)
.padding()
}
Text(data.name)
.padding()
HStack {
(Star Rating Logic
}
Button(action: {
print("opening site pressed")
if let url = URL(string: data.url) {
UIApplication.shared.open(url)
}
}) {
// Text("More Info")
Image("yelp logo")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(maxWidth: 30)
}
}
}
}
Here is the content:
struct layout: View {
var data: RestaurantListViewModel
var body: some View {
HStack {
URLImage(data.imageUrl) { image in
image
.resizable()
.aspectRatio(contentMode: .fill)
.clipped()
.frame(maxWidth: 30, maxHeight: 30)
.padding()
}
Text(data.name)
.padding()
HStack {
(rating logic)
}
Button(action: {
print("opening site pressed")
if let url = URL(string: data.url) {
UIApplication.shared.open(url)
}
}) {
// Text("More Info")
Image("yelp logo")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(maxWidth: 30)
}
}
}
}
I fixed it by reloading the scene when the deep link handler is called
Update: I know how to do it using a bool var. Unfortunately, it gets called after I load the view. How do I fix this?
I tried that, but when I do that, this happens:
Decided to set this in the same struct and then pass it in as a parameter.
Ask on apple forums not dev, we are for developers, not consumers on a beta.
here is the framework: https://github.com/chrisdhaan/CDYelpFusionKit
I didn't have some dependencies installed
Fixed it, the simulator file I’d was wrong.
It worked, but the icon isn't showing. Any ideas?
60px, 120px, and 180px. It’s in both because I also want to show the images. Also, I am checking.
Running Xcode in rosetta helped me.