forked from LoopKit/LoopKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImage.swift
More file actions
31 lines (28 loc) · 822 Bytes
/
Image.swift
File metadata and controls
31 lines (28 loc) · 822 Bytes
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
//
// Image.swift
// DashKitUI
//
// Created by Pete Schwamb on 2/7/20.
// Copyright © 2020 LoopKit Authors. All rights reserved.
//
import SwiftUI
private class LocalBundle {
/// Returns the resource bundle associated with the current Swift module.
static var main: Bundle = {
if let mainResourceURL = Bundle.main.resourceURL,
let bundle = Bundle(url: mainResourceURL.appendingPathComponent("LoopKitUI_LoopKitUI.bundle"))
{
return bundle
}
return Bundle(for: LocalBundle.self)
}()
}
extension Image {
init(frameworkImage name: String, decorative: Bool = false) {
if decorative {
self.init(decorative: name, bundle: LocalBundle.main)
} else {
self.init(name, bundle: LocalBundle.main)
}
}
}