A modern, cross-platform UI framework for Swift that provides a SwiftUI-like declarative syntax while targeting native platform UI components.
Unify Native is a UI framework that allows you to write declarative UI code once and render it using native components on each platform. The framework provides a familiar SwiftUI-like syntax while abstracting away platform-specific implementation details.
The project is in its early stages with the following components implemented:
- ✅
Appprotocol for application lifecycle management - ✅
Viewprotocol for component hierarchy - ✅ Basic application lifecycle management
- ✅ SwiftUI-like declarative syntax
- ✅ MainActor isolation for thread safety
Currently implemented components:
- ✅
VStack: Vertical stack layout - ✅
Text: Basic text display with font and padding support - ✅
Button: Basic button with click handler
import UnifyNativeKit
@main
struct MyApp: App {
var body: ContentView {
ContentView()
}
}
struct ContentView: View {
var body: VStack {
VStack {
Text("Hello, Unify Native!").padding(10).font(.title)
Button("Click Me") {
print("Button clicked")
}
}
}
}-
Native Performance: Use platform-specific UI components for optimal performance and native feel
-
Cross-Platform: Support multiple platforms while maintaining a single codebase
- Windows: SwiftCrossUI
- Linux: SwiftCrossUI
- macOS: SwiftUI
- iOS: SwiftUI
- Android : Standalone Kotlin with standalone build tools, using C and Swift Interop
- (Future) Web: WebAssembly in Swift
-
Modern Swift Features:
- Leverage Swift's modern C++ interoperability
- Use Swift concurrency and actor model
- Type-safe, declarative UI
- Platform-specific window creation
- Basic rendering pipeline
- Layout engine
- More UI components (HStack, ZStack, Image, etc.)
- Component styling system
- Platform-specific renderers
- State management system
- Animation system
- Gesture recognition
- Accessibility support
- Hot reload support
- Developer tools
- Component library
- Theme system
- Web platform support
The framework is structured in layers:
-
Core Layer (
Sources/UnifyNativeKit/Core/)App.swift: Application lifecycleView.swift: View protocolApplicationLifecycle.swift: Runtime management
-
Component Layer (
Sources/UnifyNativeKit/Components/)UnifyComponents.swift: UI component implementations- More components to come
-
Platform Layer (Coming Soon)
- Platform-specific rendering implementations
- Native component bridges
# Build the project
swift build
# Run the example app
swift run- Swift 6.1 or later
- Platform-specific requirements (coming soon)
The project is in early development. Contributions are welcome! Areas where help is needed:
- Additional UI components
- Platform-specific rendering implementations
- Documentation
- Testing infrastructure
- Example applications
License.md
Created by [Priam/Sunday_Team]