Swift function Generic -


i user swift function return class or a's subclass like

func test(tst: int) -> {     if(tst == 1) {         return a()     }     else {         return b()     } } 

b subclass of a

when return b. use dynamictype it's type. return type a. how can real type.


Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

qt - How to embed QML toolbar and menubar into QMainWindow -