Skip to content

0xLeif/SwiftAK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SwiftAK

AppKit code that is fun to write.

Example Code

import Cocoa
import SwiftAK

class ViewController: NSViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        view.center {
            NSView().vstack {
                [
                    
                    NSView(backgroundColor: .red)
                        .frame(height: 100, width: 100)
                        .padding()
                        .background(color: .yellow),
                    
                    NSText()
                        .configure {
                        $0.string = "Hello World!"
                    }
                    .background(color: .blue)
                    .frame(height: 60, width: 100)
                ]
            }
        }
    }
}

Example

SwiftAK Example