cannot check for class existance in swift due to optimization levels. instead do a version check