diff --git a/Riot/Generated/RiotDefaults.swift b/Riot/Generated/RiotDefaults.swift index fc3e4c799..f9f6d79db 100644 --- a/Riot/Generated/RiotDefaults.swift +++ b/Riot/Generated/RiotDefaults.swift @@ -57,7 +57,7 @@ internal enum RiotDefaults { // MARK: - Implementation Details private func arrayFromPlist(at path: String) -> [T] { - let bundle = BundleToken.bundle + let bundle = Bundle(for: BundleToken.self) guard let url = bundle.url(forResource: path, withExtension: nil), let data = NSArray(contentsOf: url) as? [T] else { fatalError("Unable to load PLIST at path: \(path)") @@ -69,7 +69,7 @@ private struct PlistDocument { let data: [String: Any] init(path: String) { - let bundle = BundleToken.bundle + let bundle = Bundle(for: BundleToken.self) guard let url = bundle.url(forResource: path, withExtension: nil), let data = NSDictionary(contentsOf: url) as? [String: Any] else { fatalError("Unable to load PLIST at path: \(path)") @@ -85,10 +85,4 @@ private struct PlistDocument { } } -// swiftlint:disable convenience_type -private final class BundleToken { - static let bundle: Bundle = { - Bundle(for: BundleToken.self) - }() -} -// swiftlint:enable convenience_type +private final class BundleToken {} diff --git a/Riot/Modules/LaunchLoading/LaunchLoadingView.swift b/Riot/Modules/LaunchLoading/LaunchLoadingView.swift index eb5ae0ebc..f2843db62 100644 --- a/Riot/Modules/LaunchLoading/LaunchLoadingView.swift +++ b/Riot/Modules/LaunchLoading/LaunchLoadingView.swift @@ -20,25 +20,37 @@ import Reusable @objcMembers final class LaunchLoadingView: UIView, NibLoadable, Themable { + // MARK: - Constants + + private enum LaunchAnimation { + static let duration: TimeInterval = 3.0 + static let repeatCount = Float.greatestFiniteMagnitude + } + // MARK: - Properties @IBOutlet private weak var animationView: ElementView! - @IBOutlet private weak var activityIndicatorView: UIActivityIndicatorView! + private var animationTimeline: Timeline_1! // MARK: - Setup static func instantiate() -> LaunchLoadingView { let view = LaunchLoadingView.loadFromNib() - let timeline = Timeline_1(view: view.animationView, duration: 3) - timeline.play() return view } + override func awakeFromNib() { + super.awakeFromNib() + + let animationTimeline = Timeline_1(view: self.animationView, duration: LaunchAnimation.duration, repeatCount: LaunchAnimation.repeatCount) + animationTimeline.play() + self.animationTimeline = animationTimeline + } + // MARK: - Public func update(theme: Theme) { - //self.backgroundColor = theme.backgroundColor - //self.logoImageView.tintColor = theme.tintColor - //self.activityIndicatorView.color = theme.tabBarUnselectedItemTintColor + self.backgroundColor = theme.backgroundColor + self.animationView.backgroundColor = theme.backgroundColor } }