-
Notifications
You must be signed in to change notification settings - Fork 781
Closed
Labels
Description
I am building a framework that uses R.swift internally. When the library is used, all the image created by R.swift are nil
(because it cannot find the good Bundle).
After reading http://blog.cocoapods.org/Pod-Authors-Guide-to-CocoaPods-Frameworks/, I learnt that the appropriate way to reference the bundle of my framework is to use NSBundle(for: <#ClassFromMyFramework#>)
.
I tried modifying the R.generated.swift
file like this:
//
// 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
private class RswiftDummy {}
/// This `R` struct is generated and contains references to static resources.
public struct R: Rswift.Validatable {
fileprivate static let applicationLocale = hostingBundle.preferredLocalizations.first.flatMap(Locale.init) ?? Locale.current
fileprivate static let hostingBundle = Bundle(for: RswiftDummy.self) ?? Bundle.main
[...]
}
What do you think? Thank you.
uny