Post

Replies

Boosts

Views

Activity

Why is this clearing?
This is driving me crazy. I have this code: Utilities.getKnockKnockJokes {             self.previousKnockKnockJoke = self.currentKnockKnockJoke             print("currentKnockKnockJoke = \(self.currentKnockKnockJoke)")             self.currentKnockKnockJoke = KnockKnockJokes.knockKnockJokes.randomElement()!             print("newCurrentKnockKnockJoke = \(self.currentKnockKnockJoke)")             self.singleServeText.text = self.currentKnockKnockJoke         } The function that is called is bellow: getKnockKnockJokes Thank you in advanced!
3
0
556
Jul ’21
Change state from other struct
I have this code:     static var viewModels = [RestaurantListViewModel]() {         didSet {             dataSet = true             print("data set")         }     } When it didSet is called, I want it to change a state in another struct, how can I accomplish this?
2
0
759
Sep ’21
List Sections
I have this struct: struct Final_Restaurant_View: View {     var data: [RestaurantListViewModel]     @State private var isHome = false     var body: some View {         NavigationView{             VStack {                 List(data) {                     data in                         layout(data: data)                 }                 .listStyle(GroupedListStyle())                 Button(action: {                     isHome = true                 }, label: {                     Text("Go Home")                 })                 .padding()             }             .fullScreenCover(isPresented: $isHome, content: {                 ContentView()             })             .navigationBarTitle("Results")         }     } } Which is supposed to get data and display it in a list. The problem is that I can't find anything about sections on a table structured like this and therefore, it goes wack with the section title. Any Ideas???
5
0
1.6k
Sep ’21
Deeplinking
I have looked around and am confused about deep linking to a view that is not the default view, or passing information to that view which then impacts what is shown. Please help. Note: I am using the UIKit lifecycle
2
0
726
Sep ’21
Convert Key Pairs Array To Struct
I have a key pairs array: ["Id": XmGjU9gxS5s0CzP4S6-bHw, "Name": Pizzeria La Rocca, "Url": https://www.yelp.com/biz/pizzeria-la-rocca-seattle?adjust_creative=sxCnBn1t8D3B-4MLGRB_2g&utm_campaign=yelp_api_v3&utm_medium=api_v3_business_search&utm_source=sxCnBn1t8D3B-4MLGRB_2g, "Rating": 5, "Img": https://s3-media1.fl.yelpcdn.com/bphoto/kE6hbIfi4WdlIW52SF5KUw/o.jpg] How do I convert this to my struct? struct RestaurantListViewModel: Identifiable {     let name: String     let imageUrl: URL     let id: String     let rating: Double     let url: String //    let category: Array<String> } Thank you in advanced!
1
0
1.1k
Sep ’21
Lost Connection
I have an M1 Mac and I am on Monterey beta 4. I have Xcode 12 and whenever I try to run my iOS app on my Mac natively, I get this error message. Could not attach to pid : “4837” Lost Connection Full Log Any Ideas? Thanks in advanced
4
0
1.7k
Nov ’21