1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- //
- // YYTextMagnifier.h
- // YYKit <https://github.com/ibireme/YYKit>
- //
- // Created by ibireme on 15/2/25.
- // Copyright (c) 2015 ibireme.
- //
- // This source code is licensed under the MIT-style license found in the
- // LICENSE file in the root directory of this source tree.
- //
- #import <UIKit/UIKit.h>
- #if __has_include(<YYKit/YYKit.h>)
- #import <YYKit/YYTextAttribute.h>
- #else
- #import "YYTextAttribute.h"
- #endif
- NS_ASSUME_NONNULL_BEGIN
- /// Magnifier type
- typedef NS_ENUM(NSInteger, YYTextMagnifierType) {
- YYTextMagnifierTypeCaret, ///< Circular magnifier
- YYTextMagnifierTypeRanged, ///< Round rectangle magnifier
- };
- /**
- A magnifier view which can be displayed in `YYTextEffectWindow`.
-
- @discussion Use `magnifierWithType:` to create instance.
- Typically, you should not use this class directly.
- */
- @interface YYTextMagnifier : UIView
- /// Create a mangifier with the specified type. @param type The magnifier type.
- + (id)magnifierWithType:(YYTextMagnifierType)type;
- @property (nonatomic, readonly) YYTextMagnifierType type; ///< Type of magnifier
- @property (nonatomic, readonly) CGSize fitSize; ///< The 'best' size for magnifier view.
- @property (nonatomic, readonly) CGSize snapshotSize; ///< The 'best' snapshot image size for magnifier.
- @property (nullable, nonatomic, strong) UIImage *snapshot; ///< The image in magnifier (readwrite).
- @property (nullable, nonatomic, weak) UIView *hostView; ///< The coordinate based view.
- @property (nonatomic) CGPoint hostCaptureCenter; ///< The snapshot capture center in `hostView`.
- @property (nonatomic) CGPoint hostPopoverCenter; ///< The popover center in `hostView`.
- @property (nonatomic) BOOL hostVerticalForm; ///< The host view is vertical form.
- @property (nonatomic) BOOL captureDisabled; ///< A hint for `YYTextEffectWindow` to disable capture.
- @property (nonatomic) BOOL captureFadeAnimation; ///< Show fade animation when the snapshot image changed.
- @end
- NS_ASSUME_NONNULL_END
|