Last active
September 5, 2019 09:11
-
-
Save pedrommcarrasco/cbe1665e7c921c107e7bd74306691289 to your computer and use it in GitHub Desktop.
How To Display Your Dependencies - Parser
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
struct Acknowledgments: Decodable { | |
let specs: [Framework] | |
} | |
struct Framework: Decodable { | |
let name: String | |
let homepage: String | |
let version: String | |
} | |
struct AcknowledgmentsParser { | |
static var acknowledgments: Acknowledgments? { // Could be a Result if you care about errors | |
guard let path = Bundle.main.path(forResource: "Pods-YOUR_TARGET-metadata", ofType: "plist") else { return nil } | |
do { | |
let data = try Data(contentsOf: URL(fileURLWithPath: path)) | |
let decoder = PropertyListDecoder() | |
return try decoder.decode(Acknowledgments.self, from: data) | |
} catch { | |
return nil | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment