I don't why, my json file is throwing an error as being corrupted
even though json file is valid. (I have checked from json validator).
Here is my code:
My model:
`import Foundation
class Person:Identifiable,Decodable{
var id:UUID?
var Name:String
var Address:String
var Company:String
var YearsofExperience:Int
}
My JSON File
[{
"Name":"Inigo Montoya",
"Address":"555 YouKilled My father Street",
"Company":"CodeWithChris",
"YearsofExperience":35
},
{
"Name":"Edna Mode",
"Address":"123 Nocape Lane",
"Company":"CodeWithChris",
"YearsofExperience":177
},
{
"Name":"Travis Bickle",
"Address":"99 Youtalkingtome Road",
"Company":"CodeWithChris",
"YearsofExperience":99
},
{
"Name":"Walter Sobchak",
"Address":"8 Dude Place",
"Company":"CodeWithChris",
"YearsofExperience":23
},
{
"Name":"Jullis Winnfield",
"Address":"25 Ezekiel Ave",
"Company":"CodeWithChris",
"YearsofExperience":17
}]
ViewModel:
import Foundation
class EmployeeModel:ObservableObject{
@Published var person = [Person]()
init(){
person.self = DataFetching.getLocalData()
}
}
Post
Replies
Boosts
Views
Activity
I am trying to add a button in a table view cell . but when I adjust the it's constraints programmatically, with respect it's guide , it does not move and just remains stuck .
Also it remains non clickable