-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathR.generated.swift
More file actions
433 lines (358 loc) · 17.3 KB
/
R.generated.swift
File metadata and controls
433 lines (358 loc) · 17.3 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
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
//
// 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.init) ?? 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.init)
.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 intern.validate()
}
#if os(iOS) || os(tvOS)
/// This `R.segue` struct is generated, and contains static references to 2 view controllers.
struct segue {
/// This struct is generated for `RepoDetailViewController`, and contains static references to 1 segues.
struct repoDetailViewController {
/// Segue identifier `userDetailFromRepoDetail`.
static let userDetailFromRepoDetail: Rswift.StoryboardSegueIdentifier<UIKit.UIStoryboardSegue, RepoDetailViewController, UserDetailViewController> = Rswift.StoryboardSegueIdentifier(identifier: "userDetailFromRepoDetail")
#if os(iOS) || os(tvOS)
/// Optionally returns a typed version of segue `userDetailFromRepoDetail`.
/// Returns nil if either the segue identifier, the source, destination, or segue types don't match.
/// For use inside `prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?)`.
static func userDetailFromRepoDetail(segue: UIKit.UIStoryboardSegue) -> Rswift.TypedStoryboardSegueInfo<UIKit.UIStoryboardSegue, RepoDetailViewController, UserDetailViewController>? {
return Rswift.TypedStoryboardSegueInfo(segueIdentifier: R.segue.repoDetailViewController.userDetailFromRepoDetail, segue: segue)
}
#endif
fileprivate init() {}
}
/// This struct is generated for `RepoSearchViewController`, and contains static references to 2 segues.
struct repoSearchViewController {
/// Segue identifier `repositoryDetail`.
static let repositoryDetail: Rswift.StoryboardSegueIdentifier<UIKit.UIStoryboardSegue, RepoSearchViewController, RepoDetailViewController> = Rswift.StoryboardSegueIdentifier(identifier: "repositoryDetail")
/// Segue identifier `userDetail`.
static let userDetail: Rswift.StoryboardSegueIdentifier<UIKit.UIStoryboardSegue, RepoSearchViewController, UserDetailViewController> = Rswift.StoryboardSegueIdentifier(identifier: "userDetail")
#if os(iOS) || os(tvOS)
/// Optionally returns a typed version of segue `repositoryDetail`.
/// Returns nil if either the segue identifier, the source, destination, or segue types don't match.
/// For use inside `prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?)`.
static func repositoryDetail(segue: UIKit.UIStoryboardSegue) -> Rswift.TypedStoryboardSegueInfo<UIKit.UIStoryboardSegue, RepoSearchViewController, RepoDetailViewController>? {
return Rswift.TypedStoryboardSegueInfo(segueIdentifier: R.segue.repoSearchViewController.repositoryDetail, segue: segue)
}
#endif
#if os(iOS) || os(tvOS)
/// Optionally returns a typed version of segue `userDetail`.
/// Returns nil if either the segue identifier, the source, destination, or segue types don't match.
/// For use inside `prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?)`.
static func userDetail(segue: UIKit.UIStoryboardSegue) -> Rswift.TypedStoryboardSegueInfo<UIKit.UIStoryboardSegue, RepoSearchViewController, UserDetailViewController>? {
return Rswift.TypedStoryboardSegueInfo(segueIdentifier: R.segue.repoSearchViewController.userDetail, segue: segue)
}
#endif
fileprivate init() {}
}
fileprivate init() {}
}
#endif
#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.file` struct is generated, and contains static references to 2 files.
struct file {
/// Resource file `repository.yml`.
static let repositoryYml = Rswift.FileResource(bundle: R.hostingBundle, name: "repository", pathExtension: "yml")
/// Resource file `userDetail.yml`.
static let userDetailYml = Rswift.FileResource(bundle: R.hostingBundle, name: "userDetail", pathExtension: "yml")
/// `bundle.url(forResource: "repository", withExtension: "yml")`
static func repositoryYml(_: Void = ()) -> Foundation.URL? {
let fileResource = R.file.repositoryYml
return fileResource.bundle.url(forResource: fileResource)
}
/// `bundle.url(forResource: "userDetail", withExtension: "yml")`
static func userDetailYml(_: Void = ()) -> Foundation.URL? {
let fileResource = R.file.userDetailYml
return fileResource.bundle.url(forResource: fileResource)
}
fileprivate init() {}
}
/// This `R.image` struct is generated, and contains static references to 6 images.
struct image {
/// Image `back`.
static let back = Rswift.ImageResource(bundle: R.hostingBundle, name: "back")
/// Image `icons8-calendar-50`.
static let icons8Calendar50 = Rswift.ImageResource(bundle: R.hostingBundle, name: "icons8-calendar-50")
/// Image `icons8-code-35`.
static let icons8Code35 = Rswift.ImageResource(bundle: R.hostingBundle, name: "icons8-code-35")
/// Image `icons8-marker-50`.
static let icons8Marker50 = Rswift.ImageResource(bundle: R.hostingBundle, name: "icons8-marker-50")
/// Image `icons8-star-50`.
static let icons8Star50 = Rswift.ImageResource(bundle: R.hostingBundle, name: "icons8-star-50")
/// Image `icons8-time-50`.
static let icons8Time50 = Rswift.ImageResource(bundle: R.hostingBundle, name: "icons8-time-50")
#if os(iOS) || os(tvOS)
/// `UIImage(named: "back", bundle: ..., traitCollection: ...)`
static func back(compatibleWith traitCollection: UIKit.UITraitCollection? = nil) -> UIKit.UIImage? {
return UIKit.UIImage(resource: R.image.back, compatibleWith: traitCollection)
}
#endif
#if os(iOS) || os(tvOS)
/// `UIImage(named: "icons8-calendar-50", bundle: ..., traitCollection: ...)`
static func icons8Calendar50(compatibleWith traitCollection: UIKit.UITraitCollection? = nil) -> UIKit.UIImage? {
return UIKit.UIImage(resource: R.image.icons8Calendar50, compatibleWith: traitCollection)
}
#endif
#if os(iOS) || os(tvOS)
/// `UIImage(named: "icons8-code-35", bundle: ..., traitCollection: ...)`
static func icons8Code35(compatibleWith traitCollection: UIKit.UITraitCollection? = nil) -> UIKit.UIImage? {
return UIKit.UIImage(resource: R.image.icons8Code35, compatibleWith: traitCollection)
}
#endif
#if os(iOS) || os(tvOS)
/// `UIImage(named: "icons8-marker-50", bundle: ..., traitCollection: ...)`
static func icons8Marker50(compatibleWith traitCollection: UIKit.UITraitCollection? = nil) -> UIKit.UIImage? {
return UIKit.UIImage(resource: R.image.icons8Marker50, compatibleWith: traitCollection)
}
#endif
#if os(iOS) || os(tvOS)
/// `UIImage(named: "icons8-star-50", bundle: ..., traitCollection: ...)`
static func icons8Star50(compatibleWith traitCollection: UIKit.UITraitCollection? = nil) -> UIKit.UIImage? {
return UIKit.UIImage(resource: R.image.icons8Star50, compatibleWith: traitCollection)
}
#endif
#if os(iOS) || os(tvOS)
/// `UIImage(named: "icons8-time-50", bundle: ..., traitCollection: ...)`
static func icons8Time50(compatibleWith traitCollection: UIKit.UITraitCollection? = nil) -> UIKit.UIImage? {
return UIKit.UIImage(resource: R.image.icons8Time50, compatibleWith: traitCollection)
}
#endif
fileprivate init() {}
}
/// This `R.nib` struct is generated, and contains static references to 3 nibs.
struct nib {
/// Nib `DetailHeaderComponent`.
static let detailHeaderComponent = _R.nib._DetailHeaderComponent()
/// Nib `HeaderCardComponent`.
static let headerCardComponent = _R.nib._HeaderCardComponent()
/// Nib `RepositoryCell`.
static let repositoryCell = _R.nib._RepositoryCell()
#if os(iOS) || os(tvOS)
/// `UINib(name: "DetailHeaderComponent", in: bundle)`
@available(*, deprecated, message: "Use UINib(resource: R.nib.detailHeaderComponent) instead")
static func detailHeaderComponent(_: Void = ()) -> UIKit.UINib {
return UIKit.UINib(resource: R.nib.detailHeaderComponent)
}
#endif
#if os(iOS) || os(tvOS)
/// `UINib(name: "HeaderCardComponent", in: bundle)`
@available(*, deprecated, message: "Use UINib(resource: R.nib.headerCardComponent) instead")
static func headerCardComponent(_: Void = ()) -> UIKit.UINib {
return UIKit.UINib(resource: R.nib.headerCardComponent)
}
#endif
#if os(iOS) || os(tvOS)
/// `UINib(name: "RepositoryCell", in: bundle)`
@available(*, deprecated, message: "Use UINib(resource: R.nib.repositoryCell) instead")
static func repositoryCell(_: Void = ()) -> UIKit.UINib {
return UIKit.UINib(resource: R.nib.repositoryCell)
}
#endif
static func detailHeaderComponent(owner ownerOrNil: AnyObject?, options optionsOrNil: [UINib.OptionsKey : Any]? = nil) -> DetailHeaderComponentView? {
return R.nib.detailHeaderComponent.instantiate(withOwner: ownerOrNil, options: optionsOrNil)[0] as? DetailHeaderComponentView
}
static func headerCardComponent(owner ownerOrNil: AnyObject?, options optionsOrNil: [UINib.OptionsKey : Any]? = nil) -> HeaderCardComponentView? {
return R.nib.headerCardComponent.instantiate(withOwner: ownerOrNil, options: optionsOrNil)[0] as? HeaderCardComponentView
}
static func repositoryCell(owner ownerOrNil: AnyObject?, options optionsOrNil: [UINib.OptionsKey : Any]? = nil) -> RepositoryCell? {
return R.nib.repositoryCell.instantiate(withOwner: ownerOrNil, options: optionsOrNil)[0] as? RepositoryCell
}
fileprivate init() {}
}
/// This `R.reuseIdentifier` struct is generated, and contains static references to 2 reuse identifiers.
struct reuseIdentifier {
/// Reuse identifier `profileDetailCell`.
static let profileDetailCell: Rswift.ReuseIdentifier<ProfileDetailCell> = Rswift.ReuseIdentifier(identifier: "profileDetailCell")
/// Reuse identifier `repositoryCell`.
static let repositoryCell: Rswift.ReuseIdentifier<RepositoryCell> = Rswift.ReuseIdentifier(identifier: "repositoryCell")
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 nib.validate()
#endif
#if os(iOS) || os(tvOS)
try storyboard.validate()
#endif
}
#if os(iOS) || os(tvOS)
struct nib: Rswift.Validatable {
static func validate() throws {
try _RepositoryCell.validate()
}
struct _DetailHeaderComponent: Rswift.NibResourceType {
let bundle = R.hostingBundle
let name = "DetailHeaderComponent"
func firstView(owner ownerOrNil: AnyObject?, options optionsOrNil: [UINib.OptionsKey : Any]? = nil) -> DetailHeaderComponentView? {
return instantiate(withOwner: ownerOrNil, options: optionsOrNil)[0] as? DetailHeaderComponentView
}
fileprivate init() {}
}
struct _HeaderCardComponent: Rswift.NibResourceType {
let bundle = R.hostingBundle
let name = "HeaderCardComponent"
func firstView(owner ownerOrNil: AnyObject?, options optionsOrNil: [UINib.OptionsKey : Any]? = nil) -> HeaderCardComponentView? {
return instantiate(withOwner: ownerOrNil, options: optionsOrNil)[0] as? HeaderCardComponentView
}
fileprivate init() {}
}
struct _RepositoryCell: Rswift.NibResourceType, Rswift.ReuseIdentifierType, Rswift.Validatable {
typealias ReusableType = RepositoryCell
let bundle = R.hostingBundle
let identifier = "repositoryCell"
let name = "RepositoryCell"
func firstView(owner ownerOrNil: AnyObject?, options optionsOrNil: [UINib.OptionsKey : Any]? = nil) -> RepositoryCell? {
return instantiate(withOwner: ownerOrNil, options: optionsOrNil)[0] as? RepositoryCell
}
static func validate() throws {
if UIKit.UIImage(named: "icons8-code-35", in: R.hostingBundle, compatibleWith: nil) == nil { throw Rswift.ValidationError(description: "[R.swift] Image named 'icons8-code-35' is used in nib 'RepositoryCell', but couldn't be loaded.") }
if UIKit.UIImage(named: "icons8-star-50", in: R.hostingBundle, compatibleWith: nil) == nil { throw Rswift.ValidationError(description: "[R.swift] Image named 'icons8-star-50' is used in nib 'RepositoryCell', but couldn't be loaded.") }
if #available(iOS 11.0, tvOS 11.0, *) {
}
}
fileprivate init() {}
}
fileprivate init() {}
}
#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 = GithubNavigationController
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() {}
}