Swiftpack.co - Package - 0xLeif/SwiftUIKit

SwiftUIKit

UIKit code that is fun to write.

Example Code

import UIKit
import SwiftUIKit

class ViewController: UIViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        Navigate.shared.configure(controller: navigationController)
            .set(title: "Hello SwiftUIKit")
            .setRight(barButton: BarButton {
                Button("Button 0") {
                    print("Tapped the barbutton")
                }
            })
        
        
        view.embed {
            SafeAreaView {
                List(defaultCellHeight: 60) {
                    [
                        Button("Say Hello") {
                            print("Hello World!")
                        },
                        
                        HStack(withSpacing: 8) {
                            [
                                Label("Name"),
                                
                                Divider(.vertical),
                                
                                Spacer(),
                                
                                Field(value: "SwiftUIKit",
                                      placeholder: "Some Name",
                                      keyboardType: .default)
                                    .inputHandler { print("New Name: \($0)") }
                            ]
                        },
                        
                        Label.callout("This is some callout text!"),
                        
                        ZStack {
                            [
                                Image(.blue)
                                    .frame(height: 60, width: 60)
                                    .offset(x: 100)
                            ]
                        },
                        
                        NavButton(destination: {
                            UIViewController {
                                UIView(backgroundColor: .white) {
                                    LoadingImage(URL(string: "https://cdn11.bigcommerce.com/s-oe2q4reh/images/stencil/2048x2048/products/832/1401/Beige_Pekingese_Puppy__21677.1568609759.jpg")!)
                                        .contentMode(.scaleAspectFit)
                                }
                            }
                        }, style: .push) {
                            Label("Go see a puppy")
                        },
                        
                        Button("Show an Alert") {
                            Navigate.shared.alert(title: "Hello this is an Alert!",
                                                  message: "Just a test...",
                                                  secondsToPersist: 3)
                        },
                        
                        Button("Show an Alert w/ cancel") {
                            Navigate.shared.alert(title: "Hello World",
                                                  message: "This is an alert",
                                                  withActions: [.cancel],
                                                  secondsToPersist: 3)
                        },
                        
                        Button("Show a Toast Message") {
                            Navigate.shared.toast(style: .error, pinToTop: true, secondsToPersist: 4) {
                                Label("This is a test error message!")
                            }
                        }
                    ]
                }
            }
        }
    }
}

Example View

Example SwiftUIKit

GitHub Supporters

ambid17 suzyfendrick


oneleif project

This means that the project is sponsored by the oneleif community, and the collaborators are team members from oneleif.

What is oneleif?

oneleif is a nonprofit community that supports tech minded individuals. We do this by offering a fun loving community that works on Open Sourced projects together. We love to give back through free resources and guidance.

How to join oneleif

Click on the link below to join the Discord server.

-OR-

Check out our website

Questions?

Feel free to email us at: oneleifdev@gmail.com

-OR-

Ask questions in the discord

Github

link
Stars: 58

Dependencies

Used By

Total: 0

Releases

Default ContractView - 2020-09-02 13:38:00

var contractView: ContractView<UIView, Int> = ContractView { contractView in
    Contract(initialValue: 0)
        .onChange { (value) in
            print("New Value: \(String(describing: value))")
            Later.main {
                // Update UI
            }
    }
}

V+H Scroll - 2020-09-01 15:23:50

Example

VScroll {
    VStack {
        [
            /* Views to scroll */
        ]
    }
}

Later Resign Contract - 2020-08-31 16:30:39

SwiftUIKit+Later - 2020-08-27 05:39:02

- 2020-04-27 20:45:54

SwiftUIKit v1.1.0

Updates

  • TableView
  • Layer Modifiers
  • Different Padding
  • Fixed Bugs

Xcode 10.3 Legacy Build of v1.0.0 - 2020-01-30 02:50:07

Xcode 10.3 Support for v1.0.0

- 2020-01-30 02:49:06

SwiftUIKit v1.0.0

Includes a Navigate Singleton:

  • Navigate using the navigationController
  • Navigate from VC to VC
  • Present Alerts
  • Present Action Sheets
  • Present Toast Messages

Includes the following Containers:

  • HStack
  • VStack
  • ZStack
  • SafeAreaView

Includes the following Views:

  • Button
  • Divider
  • Field
  • Image
  • Label
  • LoadingImage
  • LoadingView
  • MultiLineField
  • NavButton
  • ScrollView
  • Slider
  • Spacer
  • Switch
  • Table (Static)
  • View
  • WebView
  • EffectView