commit | author | age
|
a0a843
|
1 |
// |
H |
2 |
// TWTRMoPubNativeAdContainerView.h |
|
3 |
// TwitterKit |
|
4 |
// |
|
5 |
// Copyright © 2016 Twitter. All rights reserved. |
|
6 |
// |
|
7 |
|
|
8 |
#import <UIKit/UIKit.h> |
|
9 |
|
|
10 |
NS_ASSUME_NONNULL_BEGIN |
|
11 |
|
|
12 |
/** |
|
13 |
* A default combination of colors for the native ads. |
|
14 |
*/ |
|
15 |
typedef NS_ENUM(NSUInteger, TWTRNativeAdTheme) { |
|
16 |
/** |
|
17 |
* Official light theme. |
|
18 |
*/ |
|
19 |
TWTRNativeAdThemeLight, |
|
20 |
/** |
|
21 |
* Official dark theme. |
|
22 |
*/ |
|
23 |
TWTRNativeAdThemeDark |
|
24 |
}; |
|
25 |
|
|
26 |
/** |
|
27 |
* The ad view rendered using MoPub. This class is not intended for public use other than to configure |
|
28 |
* color options. Colors can be configured by setting the theme and further customized by tweaking |
|
29 |
* the individual color options. |
|
30 |
* |
|
31 |
* ## UIAppearance |
|
32 |
* |
|
33 |
* You may use UIAppearance proxy objects to style certain aspects of the |
|
34 |
* the ad view to match your application's design. |
|
35 |
|
|
36 |
* // Setting a theme |
|
37 |
* [TWTRMoPubNativeAdContainerView appearance].theme = TWTRNativeAdThemeDark; |
|
38 |
* |
|
39 |
* // Overriding colors of certain properties |
|
40 |
* [TWTRMoPubNativeAdContainerView appearance].primaryTextColor = [UIColor yellowColor]; |
|
41 |
* |
|
42 |
* @note You can't change the theme through an appearance proxy after the |
|
43 |
* view has already been added to the view hierarchy. |
|
44 |
*/ |
|
45 |
@interface TWTRMoPubNativeAdContainerView : UIView <UIAppearanceContainer> |
|
46 |
|
|
47 |
/** |
|
48 |
* Setting the theme of ad views. This is the base template that can |
|
49 |
* be overridden by setting your custom colors for the available view |
|
50 |
* properties. Default is `TWTRNativeAdThemeLight`. |
|
51 |
*/ |
|
52 |
@property (nonatomic) TWTRNativeAdTheme theme UI_APPEARANCE_SELECTOR; |
|
53 |
|
|
54 |
/** |
|
55 |
* Background color of this ad container view. Defaults to #F5F8FA. |
|
56 |
*/ |
|
57 |
@property (nonatomic) UIColor *backgroundColor UI_APPEARANCE_SELECTOR; |
|
58 |
|
|
59 |
/** |
|
60 |
* Background color of the ad within the container. Defaults to #FFFFFF. |
|
61 |
*/ |
|
62 |
@property (nonatomic) UIColor *adBackgroundColor UI_APPEARANCE_SELECTOR; |
|
63 |
|
|
64 |
/** |
|
65 |
* Primary text color used within the ad cell including the underlying ad. Defaults to #292F33. |
|
66 |
*/ |
|
67 |
@property (nonatomic) UIColor *primaryTextColor UI_APPEARANCE_SELECTOR; |
|
68 |
|
|
69 |
/** |
|
70 |
* Background color of buttons. Defaults to #174791. |
|
71 |
*/ |
|
72 |
@property (nonatomic) UIColor *buttonBackgroundColor UI_APPEARANCE_SELECTOR; |
|
73 |
|
|
74 |
@end |
|
75 |
|
|
76 |
NS_ASSUME_NONNULL_END |