Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
506 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 8 additions & 3 deletions
11
UniLayoutIOS/Example/Pods/Local Podspecs/UniLayout.podspec.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
387 changes: 276 additions & 111 deletions
387
UniLayoutIOS/Example/Pods/Pods.xcodeproj/project.pbxproj
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
UniLayoutIOS/Example/Pods/Target Support Files/UniLayout/Info.plist
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
UniLayoutIOS/Example/Pods/Target Support Files/UniLayout/ResourceBundle-UniLayout-Info.plist
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
UniLayoutIOS/UniLayout/Assets/Images.xcassets/unilayout-chevron.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "unilayout-chevron.pdf" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Binary file added
BIN
+17.3 KB
...youtIOS/UniLayout/Assets/Images.xcassets/unilayout-chevron.imageset/unilayout-chevron.pdf
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// | ||
// UniAssets.swift | ||
// UniLayout Pod | ||
// | ||
// Library utility: obtaining assets | ||
// Obtain assets from the library, mostly used to simulate internal iOS assets | ||
// | ||
|
||
import UIKit | ||
|
||
public class UniAssets { | ||
|
||
// --- | ||
// MARK: Members | ||
// --- | ||
|
||
private static var loadedAssets: [String: UIImage] = [:] | ||
|
||
|
||
// --- | ||
// MARK: Initialization | ||
// --- | ||
|
||
private init() { | ||
} | ||
|
||
|
||
// --- | ||
// MARK: Direct asset access | ||
// --- | ||
|
||
public static var chevron: UIImage? { | ||
get { return UniAssets.obtainAsset(name: "chevron") } | ||
} | ||
|
||
|
||
// --- | ||
// MARK: Generic asset loading | ||
// --- | ||
|
||
public static func obtainAsset(name: String) -> UIImage? { | ||
if let loadedAsset = loadedAssets[name] { | ||
return loadedAsset | ||
} | ||
if let bundleUrl = Bundle(for: UniAssets.self).url(forResource: "UniLayout", withExtension: "bundle") { | ||
let bundle = Bundle(url: bundleUrl) | ||
if let image = UIImage(named: "unilayout-" + name, in: bundle, compatibleWith: nil) { | ||
loadedAssets[name] = image | ||
return image | ||
} | ||
} | ||
return nil | ||
} | ||
|
||
} |
Oops, something went wrong.