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
- Update OpenGraph dependency for comparison API by @Kyle-Ye in #383
- Update GraphValue by @Kyle-Ye in #384
- Add EquatableView by @Kyle-Ye in #385
- Add equatable macro dependency and demo by @Kyle-Ye in #386
- Update AnimatableAttribute implementation by @Kyle-Ye in #387
- Add Animation support by @Kyle-Ye in #388
- Add test case for Animation and UnitCurve by @Kyle-Ye in #389
- Add AnimationModifier by @Kyle-Ye in #391
- Add VariableFrameDuration support by @Kyle-Ye in #390
- Update ColorView to use Animatable by @Kyle-Ye in #392
- Optimize UnitCurve inverse implementation by @Kyle-Ye in #393
- Update RootTransform by @Kyle-Ye in #394
- [NFC] Update Event folder structure by @Kyle-Ye in #395
- Add UITraitBridgedEnvironmentKey support by @Kyle-Ye in #396
- Fix typo in
needsRenderproperty by @Kyle-Ye in #398 - Update EnvironmentAdditions by @Kyle-Ye in #397
- Update DisplayLink and UIHostingView by @Kyle-Ye in #399
- Update ViewRendererHost by @Kyle-Ye in #400
- [Bugfix] Fix UIHostingView update issue by @Kyle-Ye in #402
- [Bugfix] Fix NextUpdate.interval issue by @Kyle-Ye in #403
- Fix OPENSWIFTUI_SAFE_WRAPPER_IMP for class method by @Kyle-Ye in #404
- [Example] Add ColorAnimationExample by @Kyle-Ye in #405
- Add AsyncRenderer support by @Kyle-Ye in #407
- Fix CI iOS 18.0 render crash issue by @Kyle-Ye in #409
- Fix UIWindowScene dealloc issue on async render by @Kyle-Ye in #408
- Add rotate screen support for UIHostingView by @Kyle-Ye in #410
- [Infra] Add Stack3 support by @Kyle-Ye in #411
- Add cycle detection for updates and values by @Kyle-Ye in #412
- Update EmptyView by @Kyle-Ye in #414
- Add onChange modifier support by @Kyle-Ye in #413
- [NFC] Remove
OPENSWIFTUI_SUPPRESS_DEPRECATED_WARNINGSflag by @Kyle-Ye in #415 - Add withAnimation API by @Kyle-Ye in #416
Full Changelog: 0.6.0...0.7.0
-
Via SwiftUI's Render. Currently only align with iOS 18.5 and macOS 15.5 Runtime. ↩