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 |
*/ |
|
17 |
|
|
18 |
/** |
|
19 |
This header is private to the Twitter Core SDK and not exposed for public SDK consumption |
|
20 |
*/ |
a0a843
|
21 |
|
H |
22 |
#import <Foundation/Foundation.h> |
|
23 |
|
|
24 |
#if IS_UIKIT_AVAILABLE |
|
25 |
#import <UIKit/UIKit.h> |
|
26 |
#else |
|
27 |
#import <Cocoa/Cocoa.h> |
|
28 |
#endif |
|
29 |
|
|
30 |
NS_ASSUME_NONNULL_BEGIN |
|
31 |
|
655e66
|
32 |
FOUNDATION_EXTERN NSString *const TWTRResourcesUtilLanguageType; |
a0a843
|
33 |
|
H |
34 |
@interface TWTRResourcesUtil : NSObject |
|
35 |
|
|
36 |
/** |
|
37 |
* Returns the bundle given its name. This is useful for retrieving any bundle and future refactoring |
|
38 |
* such as when Digits has its own kit resources. |
|
39 |
* |
|
40 |
* @param bundlePath path of the bundle e.g. TwitterKitResources.bundle |
|
41 |
* |
|
42 |
* @return the bundle |
|
43 |
*/ |
|
44 |
+ (NSBundle *)bundleWithBundlePath:(NSString *)bundlePath; |
|
45 |
|
|
46 |
/** |
|
47 |
* Retrieves the localized bundle of the given resource bundle. |
|
48 |
* |
|
49 |
* @param bundle localized bundle |
|
50 |
* |
|
51 |
* @return localized bundle |
|
52 |
*/ |
|
53 |
+ (NSBundle *)localizedBundleWithBundle:(NSBundle *)bundle; |
|
54 |
|
|
55 |
/** |
|
56 |
* Retrieves the localized bundle for the given bundle path. |
|
57 |
* |
|
58 |
* @param bundlePath path of the bundle e.g. TwitterKitResources.bundle |
|
59 |
* |
|
60 |
* @return localized bundle in the given resource bundle path |
|
61 |
*/ |
|
62 |
+ (NSBundle *)localizedBundleWithBundlePath:(NSString *)bundlePath; |
|
63 |
|
|
64 |
/** |
|
65 |
* Retrieves the localized string for the given key. If the string is not found in the right locale strings file, falls back to English. |
|
66 |
* |
|
67 |
* @param key key for the desired localized string, e.g. "BUTTON_OKAY" |
|
68 |
* @param bundlePath path of the bundle e.g. TwitterKitResources.bundle |
|
69 |
* |
|
70 |
* @return localized string |
|
71 |
*/ |
|
72 |
+ (NSString *)localizedStringForKey:(NSString *)key bundlePath:(NSString *)bundlePath; |
|
73 |
|
|
74 |
/** |
|
75 |
* Constructs the canonical user agent string based on |
|
76 |
* kit info in the main bundle. |
|
77 |
* |
|
78 |
* @return Kit user agent string for URL requests. |
|
79 |
*/ |
|
80 |
+ (NSString *)userAgentFromKitBundle; |
|
81 |
|
|
82 |
/** |
|
83 |
* Returns the localized display name of the application. |
|
84 |
*/ |
|
85 |
+ (NSString *)localizedApplicationDisplayName; |
|
86 |
|
|
87 |
/** |
|
88 |
* Returns the platform of the application. |
|
89 |
*/ |
|
90 |
+ (NSString *)platform; |
|
91 |
|
|
92 |
/** |
|
93 |
* Returns the screen scale of the application. |
|
94 |
*/ |
|
95 |
+ (CGFloat)screenScale; |
|
96 |
|
|
97 |
/** |
|
98 |
* Set the version of the parent Kit (Twitter Kit or Digits) |
|
99 |
*/ |
|
100 |
+ (void)setKitVersion:(nullable NSString *)version; |
|
101 |
|
|
102 |
@end |
|
103 |
|
|
104 |
NS_ASSUME_NONNULL_END |