I have declared some enum values in view controller and trying to access in another class, but for some enum I can infer directly but for other I need to use the class name. Sample code
class MyRootViewController: UIViewController {
enum Animation {
case left
case right
case top
case bottom
case none
}
//some code
}
class OtherViewController: UIViewController {
enum Configurations {
case config
case version
case type
}
//some code
}
class Utility {
func addConfiguration(_ config: Configurations) {
//some code
}
func showAnimation(_ animation: MyRootViewController.Animation) {
//Some code
}
}
Here in the second function of Utitlity if I declare like func showAnimation(_ animation: Animation)
it throws error "Use of undeclared identifier Animation"
Why did in first method worked even though I didn't mention class but in the second one didn't?
Configurations
, can you pls check and confirm? - Sohil R. Memon