> Design Patterns > Visitor > Visitor Design Pattern In Swift

Visitor Design Pattern In Swift

Visitor design pattern in Swift to perform operation on elements of an object structure.


Visitor design pattern In Swift

Output

ConcreteElementA::Accept()
ConcreteVisitor1::VisitConcreteElementA()
ConcreteElementA::Accept()
ConcreteVisitor2::VisitConcreteElementA()
ConcreteElementB::Accept()
ConcreteVisitor1::VisitConcreteElementB()
ConcreteElementB::Accept()
ConcreteVisitor2::VisitConcreteElementB()


Suresh Kumar Srivastava is founder of online learning site coursegalaxy.com and author of popular books C In Depth, Data Structures Through C In Depth. He has 18+ years experience in industry and worked on architecture and design of multiple products. This article Visitor Design Pattern In Swift is from his Design Patterns course.