YYTextEffectWindow.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //
  2. // YYTextEffectWindow.h
  3. // YYKit <https://github.com/ibireme/YYKit>
  4. //
  5. // Created by ibireme on 15/2/25.
  6. // Copyright (c) 2015 ibireme.
  7. //
  8. // This source code is licensed under the MIT-style license found in the
  9. // LICENSE file in the root directory of this source tree.
  10. //
  11. #import <UIKit/UIKit.h>
  12. #if __has_include(<YYKit/YYKit.h>)
  13. #import <YYKit/YYTextMagnifier.h>
  14. #import <YYKit/YYTextSelectionView.h>
  15. #else
  16. #import "YYTextMagnifier.h"
  17. #import "YYTextSelectionView.h"
  18. #endif
  19. NS_ASSUME_NONNULL_BEGIN
  20. /**
  21. A window to display magnifier and extra contents for text view.
  22. @discussion Use `sharedWindow` to get the instance, don't create your own instance.
  23. Typically, you should not use this class directly.
  24. */
  25. @interface YYTextEffectWindow : UIWindow
  26. /// Returns the shared instance (returns nil in App Extension).
  27. + (nullable instancetype)sharedWindow;
  28. /// Show the magnifier in this window with a 'popup' animation. @param mag A magnifier.
  29. - (void)showMagnifier:(YYTextMagnifier *)mag;
  30. /// Update the magnifier content and position. @param mag A magnifier.
  31. - (void)moveMagnifier:(YYTextMagnifier *)mag;
  32. /// Remove the magnifier from this window with a 'shrink' animation. @param mag A magnifier.
  33. - (void)hideMagnifier:(YYTextMagnifier *)mag;
  34. /// Show the selection dot in this window if the dot is clipped by the selection view.
  35. /// @param selection A selection view.
  36. - (void)showSelectionDot:(YYTextSelectionView *)selection;
  37. /// Remove the selection dot from this window.
  38. /// @param selection A selection view.
  39. - (void)hideSelectionDot:(YYTextSelectionView *)selection;
  40. @end
  41. NS_ASSUME_NONNULL_END