Swiftpack.co - IBDecodable/IBDecodable as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by IBDecodable.
IBDecodable/IBDecodable 0.6.0
A tool to translate xib and storyboard XML into Swift models.
⭐️ 135
🕓 2 weeks ago
.package(url: "https://github.com/IBDecodable/IBDecodable.git", from: "0.6.0")

IBDecodable

Swift Swift 5.5 Contributors Forks Stargazers Issues MIT License

A tool to translate .xib and .storyboard XML into Swift models.

Installing

Using Cocoapods:

Simply add the following line to your Podfile:

pod 'IBDecodable'

Using Swift Package Manager:

To include IBDecodable into a Swift Package Manager package, add it to the dependencies attribute defined in your Package.swift file.

dependencies: [
    .Package(url: "https://github.com/IBDecodable/IBDecodable.git", majorVersion: <majorVersion>, minor: <minor>)
]

Parse Storyboard

From file url:

let file = try StoryboardFile(url: fileURL)

From string content:

let parser = InterfaceBuilderParser()
let storyboardDocument = try parser.parseStoryboard(xml: "<?xml ... ")

Browse the storyboard scene

if let scenes = file.document.scenes {
  for scene in scenes {
    ..
  }
}

Get the storyboard resources

if let resources = file.document.resources {
  for resource in resources {
    resource.resource // .. `NamedColor`, Ìmage
  }
}

Parse Xib

From file url:

let file = try XibFile(url: fileURL)

From string content:

let parser = InterfaceBuilderParser()
let xibDocument = try parser.parseXib(xml: "<?xml ... ")

GitHub

link
Stars: 135
Last commit: 2 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Dependencies

Release Notes

0.6.0
2 weeks ago

What's Changed

New Contributors

Full Changelog: https://github.com/IBDecodable/IBDecodable/compare/0.5.0...0.6.0

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics