class App { func openDialog() { /* ... */ } func closeDialog() { /* ... */ } func doDialogSomething1() { self.dialog!.something() } func doDialogSomething2() { self.dialog!.something() } func doDialogSomething3() { self.dialog!.something() } }