Giter VIP home page Giter VIP logo

Comments (6)

ShivamRawat0l avatar ShivamRawat0l commented on May 25, 2024 1

Working Perfectly.

Thanks for the quick response.

from dswaveformimage.

ShivamRawat0l avatar ShivamRawat0l commented on May 25, 2024

Current solution for me is to

@State var statename = false;

WaveformLiveCanvas(samples: [],configuration: liveConfiguration,
                                   renderer: LinearWaveformRenderer(),
                                   shouldDrawSilencePadding: statename).onAppear{  
                                   statename = true; 
                                   } 

Still this would give error inside a List {} theirfore switched to scrollview. Could have tried LazyVStack but currently scrollview is fine.

from dswaveformimage.

dmrschmidt avatar dmrschmidt commented on May 25, 2024

Hey @ShivamRawat0l,

I took a quick look at this myself and I can reproduce the behavior you describe.

I cannot yet exactly say why, but it does seem to be a bug in the state handling of WaveformLiveCanvas.

I’ll look into this further, but can’t promise when I may have found a fix for this.

So in the meantime your workaround will have to do. IMHO that looks like a perfectly fine and even simpler approach anyway, no?

Out of curiosity - not sure whether this is related to the library at all - what error are you getting with List?

from dswaveformimage.

ShivamRawat0l avatar ShivamRawat0l commented on May 25, 2024

Hey @ShivamRawat0l,

I took a quick look at this myself and I can reproduce the behavior you describe.

I cannot yet exactly say why, but it does seem to be a bug in the state handling of WaveformLiveCanvas.

I’ll look into this further, but can’t promise when I may have found a fix for this.

So in the meantime your workaround will have to do. IMHO that looks like a perfectly fine and even simpler approach anyway, no?

Out of curiosity - not sure whether this is related to the library at all - what error are you getting with List?

WIth

@State var statename = false;

WaveformLiveCanvas(samples: [],configuration: liveConfiguration,
                                   renderer: LinearWaveformRenderer(),
                                   shouldDrawSilencePadding: statename).onAppear{  
                                   statename = true; 
                                   }

I am putting statename to true inside onAppear. And in List onAppear and onDisappear are called regularly as we scroll through.
So went with ScrollView only for the meantime.

from dswaveformimage.

dmrschmidt avatar dmrschmidt commented on May 25, 2024

Ah ok, I think I get what you mean.

In any case, I think I've found and fixed the issue.
If I'm completely honest with you, I don't 100% understand why SwiftUI behaves the way it does here. Something about @StateObject that behaves different to what I'd expect.

Update to 13.0.1 and the issue should be fixed. Please let me know if it does / doesn't.

from dswaveformimage.

ShivamRawat0l avatar ShivamRawat0l commented on May 25, 2024

Ah ok, I think I get what you mean.

In any case, I think I've found and fixed the issue. If I'm completely honest with you, I don't 100% understand why SwiftUI behaves the way it does here. Something about @StateObject that behaves different to what I'd expect.

Update to 13.0.1 and the issue should be fixed. Please let me know if it does / doesn't.

Wow thanks that was quick. Ill check and update the ticket :)

from dswaveformimage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.