Skip to content

Releases: OpenSwiftUIProject/OpenSwiftUI

0.13.0

03 Jan 20:17
c6e6fbd

Choose a tag to compare

Highlights

  • Add RenderBox and Path basic ABI support
  • Fix Transition Animation issue
  • Add AsyncRender system support
import OpenSwiftUI

struct ContentView: View {
    @State private var items = [6]

    var body: some View {
        VStack(spacing: 10) {
            ForEach(items, id: \.self) { item in
                Color.blue.opacity(Double(item) / 6.0)
                    .frame(height: 50)
                    .transition(.slide)
            }
        }
        .animation(.easeInOut(duration: 2), value: items)
        .onAppear {
            items.removeAll { $0 == 6 }
        }
    }
}
View 0x0000000103704330 at Time(seconds: 9.999930625781417e-07):
(display-list
  (item #:identity 1 #:version 1
    (frame (0.0 445.3333333333333; 402.0 50.0))
    (content-seed 3)
    (color #007AFFFF)))
Async view at Time(seconds: 0.0540470416599419):
(display-list
  (item #:identity 1 #:version 7
    (frame (0.052906036376953125 445.3333333333333; 402.0 50.0))
    (content-seed 3)
    (color #007AFFFF)))
...
Async view at Time(seconds: 2.0373803749971557):
(display-list
  (item #:identity 1 #:version 364
    (frame (402.0 445.3333333333333; 402.0 50.0))
    (content-seed 3)
    (color #007AFFFF)))
Async view at Time(seconds: 2.054047041659942):
(display-list)
View 0x0000000103704330 at Time(seconds: 2.054047041659942):
(display-list)

What's Changed

Full Changelog: 0.12.0...0.13.0

0.12.0

22 Nov 16:06
182cebe

Choose a tag to compare

Highlights

  • Add Xcode 26 SDK support
  • Add EnvManager support in Package.swift
  • Add Group/RepeatAnimation/View.alignmentGuide API support
  • Fixed various miscellaneous bug

What's Changed

New Contributors

Full Changelog: 0.11.0...0.12.0

0.11.0

26 Oct 19:04
39c59d9

Choose a tag to compare

Milestone

New API support

  • ForEach
  • PositionLayout
  • LabeledContent
  • Transition system
import OpenSwiftUI

struct ContentView: View {
    @State private var opacities = [0, 0.5, 1.0]

    var body: some View {
        VStack(spacing: 0) {
            ForEach(opacities, id: \.self) { opacity in
                Color.red.opacity(opacity)
            }
        }.onAppear {
            DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
                withAnimation(.spring) {
                    opacities.insert(0.25, at: 1)
                    opacities.insert(0.75, at: 3)
                }
            }
        }
    }
}
截屏2025-10-27 03 03 44

Bug Fix

  • Fixed various miscellaneous issues

What's Changed

Full Changelog: 0.10.0...0.11.0

0.10.0

05 Oct 18:31
ebb0ebf

Choose a tag to compare

Milestone

  • Add StateObject/ObservedObject/EnvironmentObject support.
  • Update DynamicProperty/State/Binding implementation
  • Migrate documentation from SPI to GH pages.
import OpenObservation
import OpenSwiftUI

@Observable
private class Model {
    var showRed = false
}

struct ContentView: View {
    @State private var model = Model()

    var body: some View {
        Subview()
            .environment(model)
    }
}

struct Subview: View {
    @Environment(Model.self) private var model

    var body: some View {
        Color(model.showRed ? .red : .blue)
    }
}

What's Changed

Full Changelog: 0.9.0...0.10.0

0.9.0

14 Sep 18:24
9a7abef

Choose a tag to compare

0.9.0 Pre-release
Pre-release

Milestone

  • visionOS build support
  • Timeline API support
import OpenSwiftUI

struct ContentView: View {
    var body: some View {
        TimelineView(.animation) { context in
            let time = context.date.timeIntervalSince1970
            ZStack {
                Color(hue: (sin(time * 0.5) + 1) / 2, saturation: 0.8, brightness: 0.9)
                Color(hue: (cos(time * 2) + 1) / 2, saturation: 1.0, brightness: 1.0)
                    .frame(width: 100 + sin(time * 3) * 20, height: 100 + sin(time * 3) * 20)
            }
        }
    }
}
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-09-15.at.02.10.03.mp4
2025-09-15.02.15.11.mov

What's Changed

  • Add visionOS support by @Kyle-Ye in #499
  • Add Timeline and Animation functionality by @Kyle-Ye in #500
  • Add usage of _ViewInputs.textAlwaysOnProvider by @Kyle-Ye in #501
  • [Bug Fix] Fix macOS animation and visionOS build issue by @Kyle-Ye in #506

Full Changelog: 0.8.0...0.9.0

0.8.0

07 Sep 18:55
0af53c9

Choose a tag to compare

0.8.0 Pre-release
Pre-release

Milestone

  • OpenObservation macro support
  • macOS Animation support via CVDisplayLink
  • RenderEffect support
  • Transition API support
import OpenObservation
import OpenSwiftUI

@Observable
private class Model {
    var showRed = false
}

struct ObservationExample: View {
    @State private var model = Model()

    private var showRed: Bool {
        get { model.showRed }
        nonmutating set { model.showRed = newValue }
    }

    var body: some View {
        VStack {
            Color(platformColor: showRed ? .red : .blue)
                .frame(width: showRed ? 200 : 400, height: showRed ? 200 : 400)
        }
        .animation(.spring, value: showRed)
        .onAppear {
            DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
                showRed.toggle()
            }
        }
    }
}
screnshot.mov

What's Changed

Full Changelog: 0.7.3...0.8.0

0.7.3

24 Aug 18:54
4dd605e

Choose a tag to compare

0.7.3 Pre-release
Pre-release

Milestone

  • Add RotationEffect & Rotation3DEffect support
  • Add TransactionModifier support
  • Add GeometryReader support
image

What's Changed

Full Changelog: 0.7.2...0.7.3

0.7.2

17 Aug 19:56
3cef59f

Choose a tag to compare

0.7.2 Pre-release
Pre-release

Milestone

  • Add SpringAnimation support
  • Add basic PlatformViewControllerRepresentable and PlatformViewRepresentable support
  • Add Font support

What's Changed

Full Changelog: 0.7.1...0.7.2

0.7.1

27 Jul 18:58
e658752

Choose a tag to compare

0.7.1 Pre-release
Pre-release

Milestone

  • Add TaskModifier support
  • A few bug fixes and stability improvements

What's Changed

Full Changelog: 0.7.0...0.7.1

0.7.0

20 Jul 18:26
4bd1f28

Choose a tag to compare

0.7.0 Pre-release
Pre-release

Milestone:

  • Add async render support 1
  • Add Animation support for iOS platform.
  • Add onChange modifier API support
import OpenSwiftUI
struct ContentView: View {
    @State private var showRed = false
    var body: some View {
        VStack {
            Color(platformColor: showRed ? .red : .blue)
                .frame(width: showRed ? 200 : 400, height: showRed ? 200 : 400)
        }
        .animation(.easeInOut(duration: 2), value: showRed)
        .onAppear {
            DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
                showRed.toggle()
            }
        }
    }
}
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-07-20.at.03.03.42.mp4
import OpenSwiftUI
import Foundation

private struct ElasticEaseInEaseOutAnimation: CustomAnimation {
    let duration: TimeInterval

    func animate<V>(value: V, time: TimeInterval, context: inout AnimationContext<V>) -> V? where V: VectorArithmetic {
        if time > duration { return nil }
        let p = time / duration
        let s = sin((20 * p - 11.125) * ((2 * Double.pi) / 4.5))
        if p < 0.5 {
            return value.scaled(by: -(pow(2, 20 * p - 10) * s) / 2)
        } else {
            return value.scaled(by: (pow(2, -20 * p + 10) * s) / 2 + 1)
        }
    }
}

extension Animation {
    static var elasticEaseInEaseOut: Animation { elasticEaseInEaseOut(duration: 0.35) }

    static func elasticEaseInEaseOut(duration: TimeInterval) -> Animation {
        Animation(ElasticEaseInEaseOutAnimation(duration: duration))
    }
}

struct ContentView: View {
    @State private var isActive = false

    var body: some View {
        VStack(alignment: isActive ? .trailing : .leading) {
            Color.red
                .frame(width: 100.0, height: 100.0)
            Color.blue
                .frame(width: 300.0, height: 100.0)
        }
        .animation(.elasticEaseInEaseOut(duration: 2.0), value: isActive)
        .onAppear {
            DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
                isActive.toggle()
            }
        }
    }
}
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-07-21.at.02.24.54.mp4

What's Changed

Full Changelog: 0.6.0...0.7.0

  1. Via SwiftUI's Render. Currently only align with iOS 18.5 and macOS 15.5 Runtime.