commit | author | age
|
655e66
|
1 |
/* |
H |
2 |
* Copyright (C) 2017 Twitter, Inc. |
|
3 |
* |
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 |
* you may not use this file except in compliance with the License. |
|
6 |
* You may obtain a copy of the License at |
|
7 |
* |
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
* |
|
10 |
* Unless required by applicable law or agreed to in writing, software |
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS, |
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 |
* See the License for the specific language governing permissions and |
|
14 |
* limitations under the License. |
|
15 |
* |
|
16 |
*/ |
a0a843
|
17 |
|
H |
18 |
#import <UIKit/UIKit.h> |
|
19 |
|
|
20 |
NS_ASSUME_NONNULL_BEGIN |
|
21 |
|
|
22 |
/** |
|
23 |
* A default combination of colors for the native ads. |
|
24 |
*/ |
|
25 |
typedef NS_ENUM(NSUInteger, TWTRNativeAdTheme) { |
|
26 |
/** |
|
27 |
* Official light theme. |
|
28 |
*/ |
|
29 |
TWTRNativeAdThemeLight, |
|
30 |
/** |
|
31 |
* Official dark theme. |
|
32 |
*/ |
|
33 |
TWTRNativeAdThemeDark |
|
34 |
}; |
|
35 |
|
|
36 |
/** |
|
37 |
* The ad view rendered using MoPub. This class is not intended for public use other than to configure |
|
38 |
* color options. Colors can be configured by setting the theme and further customized by tweaking |
|
39 |
* the individual color options. |
|
40 |
* |
|
41 |
* ## UIAppearance |
|
42 |
* |
|
43 |
* You may use UIAppearance proxy objects to style certain aspects of the |
|
44 |
* the ad view to match your application's design. |
|
45 |
|
|
46 |
* // Setting a theme |
|
47 |
* [TWTRMoPubNativeAdContainerView appearance].theme = TWTRNativeAdThemeDark; |
|
48 |
* |
|
49 |
* // Overriding colors of certain properties |
|
50 |
* [TWTRMoPubNativeAdContainerView appearance].primaryTextColor = [UIColor yellowColor]; |
|
51 |
* |
|
52 |
* @note You can't change the theme through an appearance proxy after the |
|
53 |
* view has already been added to the view hierarchy. |
|
54 |
*/ |
|
55 |
@interface TWTRMoPubNativeAdContainerView : UIView <UIAppearanceContainer> |
|
56 |
|
|
57 |
/** |
|
58 |
* Setting the theme of ad views. This is the base template that can |
|
59 |
* be overridden by setting your custom colors for the available view |
|
60 |
* properties. Default is `TWTRNativeAdThemeLight`. |
|
61 |
*/ |
|
62 |
@property (nonatomic) TWTRNativeAdTheme theme UI_APPEARANCE_SELECTOR; |
|
63 |
|
|
64 |
/** |
|
65 |
* Background color of this ad container view. Defaults to #F5F8FA. |
|
66 |
*/ |
|
67 |
@property (nonatomic) UIColor *backgroundColor UI_APPEARANCE_SELECTOR; |
|
68 |
|
|
69 |
/** |
|
70 |
* Background color of the ad within the container. Defaults to #FFFFFF. |
|
71 |
*/ |
|
72 |
@property (nonatomic) UIColor *adBackgroundColor UI_APPEARANCE_SELECTOR; |
|
73 |
|
|
74 |
/** |
|
75 |
* Primary text color used within the ad cell including the underlying ad. Defaults to #292F33. |
|
76 |
*/ |
|
77 |
@property (nonatomic) UIColor *primaryTextColor UI_APPEARANCE_SELECTOR; |
|
78 |
|
|
79 |
/** |
|
80 |
* Background color of buttons. Defaults to #174791. |
|
81 |
*/ |
|
82 |
@property (nonatomic) UIColor *buttonBackgroundColor UI_APPEARANCE_SELECTOR; |
|
83 |
|
|
84 |
@end |
|
85 |
|
|
86 |
NS_ASSUME_NONNULL_END |