react-native-navigation的迁移库

AnimatedViewFactory.m 832B

123456789101112131415161718192021
  1. #import "AnimatedViewFactory.h"
  2. #import "AnimatedImageView.h"
  3. #import "AnimatedTextView.h"
  4. #import "UIVIew+Utils.h"
  5. @implementation AnimatedViewFactory
  6. + (AnimatedReactView *)createFromElement:(UIView *)element toElement:(UIView *)toElement transitionOptions:(SharedElementTransitionOptions *)transitionOptions {
  7. switch (element.viewType) {
  8. case ViewTypeImage:
  9. return [[AnimatedImageView alloc] initElement:element toElement:toElement transitionOptions:transitionOptions];
  10. case ViewTypeText:
  11. return [[AnimatedTextView alloc] initElement:element toElement:toElement transitionOptions:transitionOptions];
  12. case ViewTypeOther:
  13. default:
  14. return [[AnimatedReactView alloc] initElement:element toElement:toElement transitionOptions:transitionOptions];
  15. }
  16. }
  17. @end