ActivityTracking.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. Licensed to the Apache Software Foundation (ASF) under one
  3. or more contributor license agreements. See the NOTICE file
  4. distributed with this work for additional information
  5. regarding copyright ownership. The ASF licenses this file
  6. to you under the Apache License, Version 2.0 (the
  7. "License"); you may not use this file except in compliance
  8. with the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing,
  11. software distributed under the License is distributed on an
  12. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  13. KIND, either express or implied. See the License for the
  14. specific language governing permissions and limitations
  15. under the License.
  16. */
  17. #import <UIKit/UIKit.h>
  18. @protocol ActivityTracking
  19. // default is UIActivityIndicatorViewStyleWhite
  20. @property(nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle;
  21. // default is YES. calls -setHidden when animating gets set to NO
  22. @property(nonatomic) BOOL hidesWhenStopped;
  23. @property (nullable, readwrite, nonatomic, strong) UIColor *color NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR;
  24. /** Sets the line width of the spinner's circle. */
  25. @property (nonatomic) CGFloat lineWidth;
  26. /** Sets the line cap of the spinner's circle. */
  27. @property (nonatomic, strong) NSString * _Nullable lineCap;
  28. /** Specifies the timing function to use for the control's animation. Defaults to kCAMediaTimingFunctionEaseInEaseOut */
  29. @property (nullable, nonatomic, strong) CAMediaTimingFunction *timingFunction;
  30. /** Property indicating the duration of the animation, default is 1.5s. Should be set prior to -[startAnimating] */
  31. @property (nonatomic, readwrite) NSTimeInterval duration;
  32. /** Property to manually set the percent complete of the spinner, in case you don't want to start at 0. Valid values are 0.0 to 1.0 */
  33. @property (nonatomic) CGFloat percentComplete;
  34. /**
  35. * Convenience function for starting & stopping animation with a boolean variable instead of explicit
  36. * method calls.
  37. *
  38. * @param animate true to start animating, false to stop animating.
  39. @note This method simply calls the startAnimating or stopAnimating methods based on the value of the animate parameter.
  40. */
  41. - (void)setAnimating:(BOOL)animate;
  42. - (void)startAnimating;
  43. - (void)stopAnimating;
  44. - (BOOL)isAnimating;
  45. @end