added to Types class the try/catch functionality for swift by wrapping around Objective-C