-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathR.generated.swift
More file actions
289 lines (236 loc) · 10.1 KB
/
R.generated.swift
File metadata and controls
289 lines (236 loc) · 10.1 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
//
// This is a generated file, do not edit!
// Generated by R.swift, see https://github.com/mac-cain13/R.swift
//
import Foundation
import Rswift
import UIKit
/// This `R` struct is generated and contains references to static resources.
struct R: Rswift.Validatable {
fileprivate static let applicationLocale = hostingBundle.preferredLocalizations.first.flatMap { Locale(identifier: $0) } ?? Locale.current
fileprivate static let hostingBundle = Bundle(for: R.Class.self)
/// Find first language and bundle for which the table exists
fileprivate static func localeBundle(tableName: String, preferredLanguages: [String]) -> (Foundation.Locale, Foundation.Bundle)? {
// Filter preferredLanguages to localizations, use first locale
var languages = preferredLanguages
.map { Locale(identifier: $0) }
.prefix(1)
.flatMap { locale -> [String] in
if hostingBundle.localizations.contains(locale.identifier) {
if let language = locale.languageCode, hostingBundle.localizations.contains(language) {
return [locale.identifier, language]
} else {
return [locale.identifier]
}
} else if let language = locale.languageCode, hostingBundle.localizations.contains(language) {
return [language]
} else {
return []
}
}
// If there's no languages, use development language as backstop
if languages.isEmpty {
if let developmentLocalization = hostingBundle.developmentLocalization {
languages = [developmentLocalization]
}
} else {
// Insert Base as second item (between locale identifier and languageCode)
languages.insert("Base", at: 1)
// Add development language as backstop
if let developmentLocalization = hostingBundle.developmentLocalization {
languages.append(developmentLocalization)
}
}
// Find first language for which table exists
// Note: key might not exist in chosen language (in that case, key will be shown)
for language in languages {
if let lproj = hostingBundle.url(forResource: language, withExtension: "lproj"),
let lbundle = Bundle(url: lproj)
{
let strings = lbundle.url(forResource: tableName, withExtension: "strings")
let stringsdict = lbundle.url(forResource: tableName, withExtension: "stringsdict")
if strings != nil || stringsdict != nil {
return (Locale(identifier: language), lbundle)
}
}
}
// If table is available in main bundle, don't look for localized resources
let strings = hostingBundle.url(forResource: tableName, withExtension: "strings", subdirectory: nil, localization: nil)
let stringsdict = hostingBundle.url(forResource: tableName, withExtension: "stringsdict", subdirectory: nil, localization: nil)
if strings != nil || stringsdict != nil {
return (applicationLocale, hostingBundle)
}
// If table is not found for requested languages, key will be shown
return nil
}
/// Load string from Info.plist file
fileprivate static func infoPlistString(path: [String], key: String) -> String? {
var dict = hostingBundle.infoDictionary
for step in path {
guard let obj = dict?[step] as? [String: Any] else { return nil }
dict = obj
}
return dict?[key] as? String
}
static func validate() throws {
try font.validate()
try intern.validate()
}
#if os(iOS) || os(tvOS)
/// This `R.storyboard` struct is generated, and contains static references to 2 storyboards.
struct storyboard {
/// Storyboard `LaunchScreen`.
static let launchScreen = _R.storyboard.launchScreen()
/// Storyboard `Main`.
static let main = _R.storyboard.main()
#if os(iOS) || os(tvOS)
/// `UIStoryboard(name: "LaunchScreen", bundle: ...)`
static func launchScreen(_: Void = ()) -> UIKit.UIStoryboard {
return UIKit.UIStoryboard(resource: R.storyboard.launchScreen)
}
#endif
#if os(iOS) || os(tvOS)
/// `UIStoryboard(name: "Main", bundle: ...)`
static func main(_: Void = ()) -> UIKit.UIStoryboard {
return UIKit.UIStoryboard(resource: R.storyboard.main)
}
#endif
fileprivate init() {}
}
#endif
/// This `R.color` struct is generated, and contains static references to 1 colors.
struct color {
/// Color `AccentColor`.
static let accentColor = Rswift.ColorResource(bundle: R.hostingBundle, name: "AccentColor")
#if os(iOS) || os(tvOS)
/// `UIColor(named: "AccentColor", bundle: ..., traitCollection: ...)`
@available(tvOS 11.0, *)
@available(iOS 11.0, *)
static func accentColor(compatibleWith traitCollection: UIKit.UITraitCollection? = nil) -> UIKit.UIColor? {
return UIKit.UIColor(resource: R.color.accentColor, compatibleWith: traitCollection)
}
#endif
#if os(watchOS)
/// `UIColor(named: "AccentColor", bundle: ..., traitCollection: ...)`
@available(watchOSApplicationExtension 4.0, *)
static func accentColor(_: Void = ()) -> UIKit.UIColor? {
return UIKit.UIColor(named: R.color.accentColor.name)
}
#endif
fileprivate init() {}
}
/// This `R.file` struct is generated, and contains static references to 2 files.
struct file {
/// Resource file `Poppins-Black.ttf`.
static let poppinsBlackTtf = Rswift.FileResource(bundle: R.hostingBundle, name: "Poppins-Black", pathExtension: "ttf")
/// Resource file `Poppins-Bold.ttf`.
static let poppinsBoldTtf = Rswift.FileResource(bundle: R.hostingBundle, name: "Poppins-Bold", pathExtension: "ttf")
/// `bundle.url(forResource: "Poppins-Black", withExtension: "ttf")`
static func poppinsBlackTtf(_: Void = ()) -> Foundation.URL? {
let fileResource = R.file.poppinsBlackTtf
return fileResource.bundle.url(forResource: fileResource)
}
/// `bundle.url(forResource: "Poppins-Bold", withExtension: "ttf")`
static func poppinsBoldTtf(_: Void = ()) -> Foundation.URL? {
let fileResource = R.file.poppinsBoldTtf
return fileResource.bundle.url(forResource: fileResource)
}
fileprivate init() {}
}
/// This `R.font` struct is generated, and contains static references to 2 fonts.
struct font: Rswift.Validatable {
/// Font `Poppins-Black`.
static let poppinsBlack = Rswift.FontResource(fontName: "Poppins-Black")
/// Font `Poppins-Bold`.
static let poppinsBold = Rswift.FontResource(fontName: "Poppins-Bold")
/// `UIFont(name: "Poppins-Black", size: ...)`
static func poppinsBlack(size: CGFloat) -> UIKit.UIFont? {
return UIKit.UIFont(resource: poppinsBlack, size: size)
}
/// `UIFont(name: "Poppins-Bold", size: ...)`
static func poppinsBold(size: CGFloat) -> UIKit.UIFont? {
return UIKit.UIFont(resource: poppinsBold, size: size)
}
static func validate() throws {
if R.font.poppinsBlack(size: 42) == nil { throw Rswift.ValidationError(description:"[R.swift] Font 'Poppins-Black' could not be loaded, is 'Poppins-Black.ttf' added to the UIAppFonts array in this targets Info.plist?") }
if R.font.poppinsBold(size: 42) == nil { throw Rswift.ValidationError(description:"[R.swift] Font 'Poppins-Bold' could not be loaded, is 'Poppins-Bold.ttf' added to the UIAppFonts array in this targets Info.plist?") }
}
fileprivate init() {}
}
/// This `R.info` struct is generated, and contains static references to 1 properties.
struct info {
struct uiApplicationSceneManifest {
static let _key = "UIApplicationSceneManifest"
static let uiApplicationSupportsMultipleScenes = false
struct uiSceneConfigurations {
static let _key = "UISceneConfigurations"
struct uiWindowSceneSessionRoleApplication {
struct defaultConfiguration {
static let _key = "Default Configuration"
static let uiSceneConfigurationName = infoPlistString(path: ["UIApplicationSceneManifest", "UISceneConfigurations", "UIWindowSceneSessionRoleApplication", "Default Configuration"], key: "UISceneConfigurationName") ?? "Default Configuration"
static let uiSceneDelegateClassName = infoPlistString(path: ["UIApplicationSceneManifest", "UISceneConfigurations", "UIWindowSceneSessionRoleApplication", "Default Configuration"], key: "UISceneDelegateClassName") ?? "$(PRODUCT_MODULE_NAME).SceneDelegate"
static let uiSceneStoryboardFile = infoPlistString(path: ["UIApplicationSceneManifest", "UISceneConfigurations", "UIWindowSceneSessionRoleApplication", "Default Configuration"], key: "UISceneStoryboardFile") ?? "Main"
fileprivate init() {}
}
fileprivate init() {}
}
fileprivate init() {}
}
fileprivate init() {}
}
fileprivate init() {}
}
fileprivate struct intern: Rswift.Validatable {
fileprivate static func validate() throws {
try _R.validate()
}
fileprivate init() {}
}
fileprivate class Class {}
fileprivate init() {}
}
struct _R: Rswift.Validatable {
static func validate() throws {
#if os(iOS) || os(tvOS)
try storyboard.validate()
#endif
}
#if os(iOS) || os(tvOS)
struct storyboard: Rswift.Validatable {
static func validate() throws {
#if os(iOS) || os(tvOS)
try launchScreen.validate()
#endif
#if os(iOS) || os(tvOS)
try main.validate()
#endif
}
#if os(iOS) || os(tvOS)
struct launchScreen: Rswift.StoryboardResourceWithInitialControllerType, Rswift.Validatable {
typealias InitialController = UIKit.UIViewController
let bundle = R.hostingBundle
let name = "LaunchScreen"
static func validate() throws {
if #available(iOS 11.0, tvOS 11.0, *) {
}
}
fileprivate init() {}
}
#endif
#if os(iOS) || os(tvOS)
struct main: Rswift.StoryboardResourceWithInitialControllerType, Rswift.Validatable {
typealias InitialController = ViewController
let bundle = R.hostingBundle
let name = "Main"
static func validate() throws {
if #available(iOS 11.0, tvOS 11.0, *) {
}
}
fileprivate init() {}
}
#endif
fileprivate init() {}
}
#endif
fileprivate init() {}
}