单军华
2018-07-11 7b02207537d35bfa1714bf8beafc921f717d100a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//
//  YYTextContainerView.h
//  YYText <https://github.com/ibireme/YYText>
//
//  Created by ibireme on 15/4/21.
//  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(<YYText/YYText.h>)
#import <YYText/YYTextLayout.h>
#else
#import "YYTextLayout.h"
#endif
 
NS_ASSUME_NONNULL_BEGIN
 
/**
 A simple view to diaplay `YYTextLayout`.
 
 @discussion This view can become first responder. If this view is first responder,
 all the action (such as UIMenu's action) would forward to the `hostView` property.
 Typically, you should not use this class directly.
 
 @warning All the methods in this class should be called on main thread.
 */
@interface YYTextContainerView : UIView
 
/// First responder's aciton will forward to this view.
@property (nullable, nonatomic, weak) UIView *hostView;
 
/// Debug option for layout debug. Set this property will let the view redraw it's contents.
@property (nullable, nonatomic, copy) YYTextDebugOption *debugOption;
 
/// Text vertical alignment.
@property (nonatomic) YYTextVerticalAlignment textVerticalAlignment;
 
/// Text layout. Set this property will let the view redraw it's contents.
@property (nullable, nonatomic, strong) YYTextLayout *layout;
 
/// The contents fade animation duration when the layout's contents changed. Default is 0 (no animation).
@property (nonatomic) NSTimeInterval contentsFadeDuration;
 
/// Convenience method to set `layout` and `contentsFadeDuration`.
/// @param layout  Same as `layout` property.
/// @param fadeDuration  Same as `contentsFadeDuration` property.
- (void)setLayout:(nullable YYTextLayout *)layout withFadeDuration:(NSTimeInterval)fadeDuration;
 
@end
 
NS_ASSUME_NONNULL_END