Note: I want to achieve similar functionality in swift - Where to store global constants in an iOS application?
I have two classes - MasterViewController and DetailViewController
I want to define an enum (refer below enum) and use its values in both classes:
enum Planet: Int {
case Mercury = 1, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune
}
I tried to define it in MasterViewController and use it in DetailViewController like this:
let aPlanet = Planet.Earth
but compiler is complaining :(
"Use of unresolved identifier Planet"
Generally in my objective c code I used to have a global constant file, which I used to import in app-prefix.pch file, which was making it accessible to all files within my project, but in this case I am clueless.