Latest 1.2.1
Homepage https://github.com/bradhilton/Allegro
License MIT
Platforms ios 8.0, osx 10.9, requires ARC
Authors

Allegro is an advanced Swift reflection utility that allows you to create classes and structs at run-time:

struct Person {
   var name: String
   var age: Int
   var friends: [Person]
}
// Returns fields for Person
let fields = try fieldsForType(Person)
// Constructs Person
let person: Person = try constructType { field in
  // return value for field
}

Be aware that every property of the type you’d like to construct must conform to Property.

Installation

CocoaPods

Allegro is available through CocoaPods. To install, simply include the following lines in your podfile:

use_frameworks!
pod 'Allegro'

Be sure to import the module at the top of your .swift files:

import Allegro

Carthage

Allegro is also available through Carthage. Just add the following to your cartfile:

github "bradhilton/Allegro"

Be sure to import the module at the top of your .swift files:

import Allegro

Swift Package Manager

You can also build Allegro using the Swift Package Manager. Just include Allegro as a package in your dependencies:

.Package(url: "https://github.com/bradhilton/Allegro.git", majorVersion: 1)

Be sure to import the module at the top of your .swift files:

import Allegro

Revision History

  • 1.0.0 – Initial Release

Author

Brad Hilton, [email protected]

License

Allegro is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "Allegro",
    "version": "1.2.1",
    "summary": "Dynamic Type Construction In Swift",
    "description": "Allegro allows you to create struct and class instances at runtime.",
    "homepage": "https://github.com/bradhilton/Allegro",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Brad Hilton": "[email protected]"
    },
    "source": {
        "git": "https://github.com/bradhilton/Allegro.git",
        "tag": "1.2.1"
    },
    "platforms": {
        "ios": "8.0",
        "osx": "10.9"
    },
    "source_files": [
        "Sources",
        "Sources/**/*.{swift,h,m}"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This