Swiftpack.co - mgray88/Allegory as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by mgray88.
mgray88/Allegory 0.0.2
SwiftUI but UIKit
⭐️ 3
🕓 2 years ago
iOS
.package(url: "https://github.com/mgray88/Allegory.git", from: "0.0.2")

Allegory

SwiftUI but UIKit (plus a little RxSwift)

Allegory is a library built to resemble SwiftUI as much as possible built on top of UIKit for use on iOS versions starting from iOS 10.

See Progress

Example

Allegory is designed to be almost identical to SwiftUI, except that the body of your views returns SomeView instead of some View.

struct Counter: View {
    @State var count: Int
    let limit: Int

    var body: SomeView {
        if count < limit {
            VStack {
                Button("Increment") { count += 1 }
                Text("\(count)")
            }
            // Not yet implemented
            // .onAppear { print("Counter.VStack onAppear") }
            // .onDisappear { print("Counter.VStack onDisappear") }
        } else {
            VStack { Text("Limit exceeded") }
        }
    }
}

@main
struct CounterApp: App {
    var body: SomeScene {
        WindowGroup("Counter Demo") {
            Counter(count: 5, limit: 15)
        }
    }
}

Installation

With CocoaPods

Add the following line to your Podfile:

pod 'Allegory', '~> 0.0.2'

With Swift Package Manager

In Xcode 12.3+ go to File -> Swift Packages -> Add Package Dependency and enter there URL of this repo

https://github.com/mgray88/Allegory

WIP

Allegory is a highly dynamic work in progress. Much of it is not ready for use.

Author

Mike Gray

Acknowledgements

Many, many thanks to these other open source projects and resources that have inspired and provided insight on the inner workings of SwiftUI

SwiftUI is a trademark owned by Apple Inc. Software maintained as a part of the Allegory project is not affiliated with Apple Inc.

License

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

GitHub

link
Stars: 3
Last commit: 2 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

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