FHSSnapshotView.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //
  2. // FHSSnapshotView.h
  3. // FLEX
  4. //
  5. // Created by Tanner Bennett on 1/7/20.
  6. // Copyright © 2020 FLEX Team. All rights reserved.
  7. //
  8. #import "FHSViewSnapshot.h"
  9. #import "FHSRangeSlider.h"
  10. #import "fakes.h"
  11. NS_ASSUME_NONNULL_BEGIN
  12. @protocol FHSSnapshotViewDelegate <NSObject>
  13. - (void)didSelectView:(FHSViewSnapshot *)snapshot;
  14. - (void)didDeselectView:(FHSViewSnapshot *)snapshot;
  15. - (void)didLongPressView:(FHSViewSnapshot *)snapshot;
  16. @end
  17. @interface FHSSnapshotView : UIView
  18. + (instancetype)delegate:(id<FHSSnapshotViewDelegate>)delegate;
  19. @property (nonatomic, weak) id<FHSSnapshotViewDelegate> delegate;
  20. @property (nonatomic) NSArray<FHSViewSnapshot *> *snapshots;
  21. @property (nonatomic, nullable) FHSViewSnapshot *selectedView;
  22. /// Views of these classes will have their headers hidden
  23. @property (nonatomic) NSArray<Class> *headerExclusions;
  24. @property (nonatomic, readonly) FHSRangeSlider *depthSlider; //this is a UIControl, it wont work OOB on tvOS but the snapshot viewer isnt working on tvOS anyway, moot for now.
  25. #if !TARGET_OS_TV
  26. @property (nonatomic, readonly) UISlider *spacingSlider;
  27. #else
  28. @property (nonatomic, readonly) KBSlider *spacingSlider;
  29. #endif
  30. - (void)emphasizeViews:(NSArray<UIView *> *)emphasizedViews;
  31. - (void)toggleShowHeaders;
  32. - (void)toggleShowBorders;
  33. - (void)hideView:(FHSViewSnapshot *)view;
  34. @end
  35. NS_ASSUME_NONNULL_END