Swiftpack.co - Package - IBDecodable/IBDecodable

IBDecodable

Build Status Swift 5.0 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: 76
Help us keep the lights on

Dependencies

Releases

0.1.0 - Nov 23, 2019

💥 Make title attribute of Button State optional ➕ Add image and catalog to Button State ➕ Add catalog to ImageView

#68

0.0.4 - Nov 22, 2019

🐦swift 5

0.0.5 - Nov 22, 2019

  • UIHostingController@phimage
  • destinationCreationSelector, modalPresentationStyle, modalTransitionStyle on segue@phimage
  • ➕Dependencies(deployment, plugIn, capabilities) #62 @yageek
  • modalPresentationStyle, modalTransitionStyle on view controller and many other attributes @yageek
  • catalog on image for SF symbol @phimage
  • 🐛fix unit test using Xcode and SwiftPM @phimage

0.0.3 - Apr 16, 2019

Some various changes

https://github.com/IBDecodable/IBDecodable/compare/0.0.2...0.0.3

0.0.1 - Mar 25, 2018