I have a struct name called Car. Car has two attributes(noOfTyres, ownerName).
struct Car {
var noOfTyres: Int
var ownerName: String
}
The string value is let objStr = "Car/ownerName"
how to convert the objStr to swiftObject like Car.ownerName?
switchbut it is actually unclear what your end goal is here. How exactly do you want to use Car.ownerName?Struct Carshould bestruct Car. There is no object likeCar.ownerName,ownerNameis not a static var ofCar. This looks like the same school assignment as @Larme duplicate comment.