RCTProgressViewManager.m 962 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. #import "RCTProgressViewManager.h"
  8. #import "RCTConvert.h"
  9. @implementation RCTConvert (RCTProgressViewManager)
  10. RCT_ENUM_CONVERTER(
  11. UIProgressViewStyle,
  12. (@{
  13. @"default" : @(UIProgressViewStyleDefault),
  14. #if !TARGET_OS_TV
  15. @"bar" : @(UIProgressViewStyleBar),
  16. #endif
  17. }),
  18. UIProgressViewStyleDefault,
  19. integerValue)
  20. @end
  21. @implementation RCTProgressViewManager
  22. RCT_EXPORT_MODULE()
  23. - (UIView *)view
  24. {
  25. return [UIProgressView new];
  26. }
  27. RCT_EXPORT_VIEW_PROPERTY(progressViewStyle, UIProgressViewStyle)
  28. RCT_EXPORT_VIEW_PROPERTY(progress, float)
  29. RCT_EXPORT_VIEW_PROPERTY(progressTintColor, UIColor)
  30. RCT_EXPORT_VIEW_PROPERTY(trackTintColor, UIColor)
  31. RCT_EXPORT_VIEW_PROPERTY(progressImage, UIImage)
  32. RCT_EXPORT_VIEW_PROPERTY(trackImage, UIImage)
  33. @end