Mockingbird is a UIKit renderer for platform independent Mockingbird DSL. The goal of this project is to provide a SwiftUI-like UI framework for older iOS versions starting from iOS 9.
MockingbirdUIKit
is just like SwiftUI
for UIKit except that the body of your views return SomeView
instead of some View
to enable pre-iOS 13 compatibility.
struct MyView: View {
@State var counter: Int = 0
var body: SomeView {
VStack(spacing: 20) {
Text("\(counter)")
.fontWeight(.heavy)
.padding(20)
.background(Color.orange)
.clipShape(RoundedRectangle(cornerRadius: 10))
.shadow(radius: 10)
HStack {
Button("Decrease") { self.counter -= 1}
Button("Increase") { self.counter += 1}
}
}
}
}
window.rootViewController = HostingController(rootView: MyView())
Status | Name | Notes |
---|---|---|
✅ | State |
|
✅ | Binding |
|
✅ | ObservedObject |
|
✅ | EnvironmentObject |
|
✅ | Published |
In ReactiveKit |
✅ | ObservableObject |
In ReactiveKit |
Status | Name | Notes |
---|---|---|
✅ | Never |
|
✅ | Optional |
|
✅ | VStack |
|
✅ | HStack |
|
✅ | ZStack |
|
✅ | Spacer |
|
✅ | Button |
Partial |
✅ | Color |
|
✅ | Image |
|
✅ | Text |
|
✅ | AnyView |
|
✅ | TupleView |
|
✅ | EmptyView |
|
✅ | ModifiedContent |
|
✅ | ConditionalContent |
|
✅ | GeometryReader |
|
✅ | ForEach |
Partial |
✅ | Shape |
|
✅ | Slider |
|
✅ | Sheet |
|
✅ | ScrollView |
|
❌ | Toggle |
|
❌ | List |
|
❌ | NavigationView |
|
❌ | TabView |
|
❌ | ... |
Status | Name | Notes |
---|---|---|
✅ | Padding |
|
✅ | Frame |
|
✅ | FlexFrame |
|
✅ | LayoutPriority |
|
✅ | ClipShape |
|
✅ | Overlay |
|
✅ | Background |
|
✅ | FixedSize |
|
✅ | AspectRatio |
|
✅ | Offset |
|
✅ | Shadow |
|
✅ | Gesture |
|
✅ | EnvironmentValue |
|
✅ | EnvironmentObject |
|
✅ | EdgesIgnoringSafeArea |
|
❌ | Animation |
|
❌ | Transaction |
|
❌ | RotationEffect |
|
❌ | ProjectionEffect |
|
❌ | TransformEffect |
|
❌ | ProjectionEffect |
|
❌ | OnAppear |
|
❌ | OnDisappear |
|
❌ | ... |
Status | Name | Notes |
---|---|---|
✅ | Path |
|
✅ | Rectangle |
|
✅ | RoundedRectangle |
|
✅ | Circle |
|
✅ | Ellipse |
|
✅ | Capsule |
Status | Name | Notes |
---|---|---|
✅ | Color |
|
✅ | FillStyle |
|
✅ | StrokeStyle |
|
✅ | ForegroundStyle |
|
❌ | ImagePaint |
|
❌ | Gradient |
|
❌ | ... |
Status | Name | Notes |
---|---|---|
✅ | TapGesture |
|
✅ | LongPressGesture |
|
✅ | RotationGesture |
|
✅ | DragGesture |
|
❌ | ... |
Add https://github.com/DeclarativeHub/MockingbirdUIKit.git
as a dependency.
github "DeclarativeHub/MockingbirdUIKit" "master"