The reason you sometimes set the class of a UIView to something else, say MyView, in IB is that you want to create a MyView, but IB doesn't have MyView in its library so you can't just drag one into your view. So, you drag in a UIView instead and change its class to MyView.
That's not necessary at all when you're instantiating an object in code rather than loading it from a .xib. In code, you know what class you want to instantiate, so you just instantiate that class:
MyView *subview = [[MyView alloc] initWithFrame:someFrame];
If you want subview to be a UIButton, you instantiate that instead:
UIButton *subview = [UIButton buttonWithType:UIButtonTypeRoundedRect];
Don't mess around with isa-swizzling, at least not now. If you're asking this question (and there's nothing wrong with asking this question) you should treat swizzling as a dark art that you might get to at some point in the future.