Swiftpack.co - tifoaudii/TifoKit as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by tifoaudii.
tifoaudii/TifoKit v1.0.3
A UIKit declarative wrapper API to improve productivity when building the UI of an iOS application
⭐️ 23
🕓 2 years ago
iOS
.package(url: "https://github.com/tifoaudii/TifoKit.git", from: "v1.0.3")

TifoKit

A declarative wrapper API to use UIKit for improve layout productivity when developing an iOS application

Requirements

  • Currently only support for iOS platform.
  • Min. iOS 11
  • Swift 5+

Installation

Currently only available via Swift Package Manager

Example Usage

TifoKit is now fully declarative, you are not required to use UIViewController anymore to building the UI.

You can simply create a new view by conform to the HostingView protocol.

struct HomeView: HostingView {
    var view: ContentView {
        VGroup {
            VGroup {
                View()
                    .backgroundColor(.brown)
                    .height(100)
                
                Label("First Label")
                Button(title: "Tap Me") {
                    print("tap me")
                }
                
                View()
                    .backgroundColor(.brown)
            }
            .setDistribution(.fill)
            
            
            View()
                .backgroundColor(.yellow)
            
            View()
                .backgroundColor(.blue)
        }
        .setSpacing(10)
        .setDistribution(.fillEqually)
    }
}

Like SwiftUI, you still need a view controller instance to host the View.

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    window = UIWindow()
    window?.makeKeyAndVisible()
    window?.rootViewController = UIComponentHostingViewController(hostingView: HomeView())
    return true
}

Currently TifoKit feature is still need a lot of development. For the UI components, we still need some of component like image, list, scroll view, etc. Give a star and follow my github to get update quickly.

License

TifoKit is released under the MIT license.

GitHub

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

Release Notes

Fixing Result Builder Issue
2 years ago

Fix result builder issue and delete old code.

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