call function from external file swift code example Example: xcode execute function from a different file MyOtherClass().otherClassFunction()