London Escorts sunderland escorts 1v1.lol unblocked yohoho 76 https://www.symbaloo.com/mix/yohoho?lang=EN yohoho https://www.symbaloo.com/mix/agariounblockedpvp https://yohoho-io.app/ https://www.symbaloo.com/mix/agariounblockedschool1?lang=EN
19.3 C
New York
Friday, October 18, 2024

ios – Problem with .animation in SwiftUI inflicting your complete view to maneuver


I’m having a problem after updating to Xcode 15 the place my view unexpectedly strikes when making an attempt to animate a rotating Circle() in SwiftUI. Beforehand, this code labored completely, however now your complete view both shifts from the top-left nook to the bottom-right nook constantly or, in some circumstances, simply the Circle() strikes unexpectedly.

The issue appears to happen when the animation is added. If I take away the animation code, the Circle() stays mounted and shows accurately.

Right here is the code I’m utilizing to show the rotating circle:

Circle()     
.stroke(fashion: StrokeStyle(lineWidth: 7, lineCap: .spherical, sprint: [10, 30]))     
.body(width: 100, peak: 100, alignment: .middle)     
.foregroundStyle(Coloration.accentColor)     
.rotationEffect(Angle(levels: isLoading ? 0 : 360.0))     
.onAppear {         
    isLoading = true     
}     
.animation(Animation.linear(period: 2.0).repeatForever(autoreverses: false), worth: isLoading) 

When the animation is utilized, the view begins transferring as described. Nonetheless, with out the animation, all the things works advantageous.

Does anybody know why this could be taking place and learn how to repair it?

Atmosphere:

Xcode 15
macOS (SwiftUI venture)

Already tried this , however identical consequence

  .onAppear(carry out: {                     
              withAnimation(Animation.linear(period: 2.0).repeatForever(autoreverses:false)){                    
        isLoading.toggle()                     
        }                 
    })                 
    .rotationEffect(Angle(levels: isLoading ? 0 : 360.0))

Related Articles

Social Media Auto Publish Powered By : XYZScripts.com