Post

Replies

Boosts

Views

Activity

Reply to iOS14 Crash Fatal Unexpectedly found nil while unwrapping an Optional value
Sorry misunderstood the question. It prints https://runningworks.org/ struct DoGood: Identifiable {   var id = UUID()   var name: String   var info: String   var link: String   var logo: String } let doGoodData = [   DoGood(name: "Running Works", info: "Running Works is a non-profit running program founded to use sport to empower individuals and families to break cycles of abuse, neglect, ******* and homelessness – one stride at a time.", link: "https://runningworks.org/", logo: "runningworks"),   DoGood(name:"PARA GUIDE", info:"PARA GUIDE enables Para-Visually impaired individuals to experience a more enriched life through guided physical activities.", link:"https://www.paraguide.org/", logo: ""),   DoGood(name:"Share Charlotte", info:"Shre Charlotte offers simple ways for neighbors, nonprofits, and businesses to come together and do good to support our local community.", link:"https://sharecharlotte.org/", logo:""),   DoGood(name:"Speed for Need", info:"Speed For Need pushes riders with special needs in customized racing chairs to help them compete in fitness events that they would not be able to do on their own.",link:"https://speedforneed.org/", logo:"speedforneed") ]
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’20
Reply to How can I go about checking if Core Data contains X data?
Thanks OOPer for the feedback. I've gone ahead and changed isFavorite to favoriteRunClubItem Here's the definition public class FavoriteItem:NSManagedObject, Identifiable {   @NSManaged public var isFavorite:Bool   @NSManaged public var misc:String?   @NSManaged public var name:String?   @NSManaged public var location:String?   @NSManaged public var date:String?   @NSManaged public var category:String?   @NSManaged public var dayofweek:Int   @NSManaged public var link:String?   @NSManaged public var hour:Int   @NSManaged public var minute:Int } extension FavoriteItem {   static func getAllFavorites() -> NSFetchRequest<FavoriteItem>{     let request:NSFetchRequest<FavoriteItem> = FavoriteItem.fetchRequest() as! NSFetchRequest<FavoriteItem>           let sortDescriptor = NSSortDescriptor(key: "category", ascending: true)     request.sortDescriptors = [sortDescriptor]     return request   } }
Topic: Programming Languages SubTopic: Swift Tags:
Sep ’20
Reply to JSON Decoded data not getting returned to be used.
Thanks OOPer! Does doing it the way you show differ with the error catching I have in place?        if let error = error {         print("Error took place \(error)")         return       } Do I declare my state as @State var yelpbusinessinfo: [Welcome] = [] or because it's not an array
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’20
Reply to JSON Decoded data not getting returned to be used.
Thanks @OOPer! Does doing it the way you show differ with the error catching I have in place?        if let error = error {         print("Error took place \(error)")         return       } Do I declare my state as @State var yelpbusinessinfo: [Welcome] = [] or because it's not an array
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’20
Reply to JSON Decoded data not getting returned to be used.
In JSON, dictionary-like structure is called object.  Thank you! I'm learning here so this is helpful. I appreciate your patience as well. I'm sort of struggling to grasp what you're saying. How is this different when a response is [ ] vs { }? In my view I have Welcome declared as @State var yelpbusinessdata: [Welcome] = [] and I'm calling the data as  List(yelpbusinessdata) { review in .. }                .onAppear{                 print("on appear calling data")                 Yelp().getBusinessInfo {                   (yelpbusinessinfo) in                   self.yelpbusinessdata = yelpbusinessinfo                   print("we got yelp reviews")                 }               }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’20
Reply to JSON Decoded data not getting returned to be used.
Sorry! I had thought I revealed those. Here they are // MARK: - Welcome struct Welcome: Codable, Identifiable {   let id = UUID()   let reviews: [Review]   let total: Int   let possibleLanguages: [String]   enum CodingKeys: String, CodingKey {     case reviews, total     case possibleLanguages = "possible_languages"   } } // MARK: - Review struct Review: Codable, Identifiable {   let id: String   let url: String   let text: String   let rating: Int   let timeCreated: String   let user: User   enum CodingKeys: String, CodingKey {     case id, url, text, rating     case timeCreated = "time_created"     case user   } } // MARK: - User struct User: Codable {   let id: String   let profileURL: String   let imageURL: String   let name: String   enum CodingKeys: String, CodingKey {     case id     case profileURL = "profile_url"     case imageURL = "image_url"     case name   } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’20