GithubHelp home page GithubHelp logo

Comments (8)

shial4 avatar shial4 commented on May 22, 2024

I don't think @ObservedObject in this project is working. Is it?
If it should. I had no luck with getting it to compile while having @ObservedObject wrapper somewhere. :/

from swiftwebui.

helje5 avatar helje5 commented on May 22, 2024

It should work, here is the sample I was testing with: https://github.com/SwiftWebUI/Tinker2/blob/master/Sources/Tinker2/Views/Tests/BindingTestView.swift

from swiftwebui.

shial4 avatar shial4 commented on May 22, 2024

What is this for?
#if canImport(Combine)
import Combine
#elseif canImport(OpenCombine)
import OpenCombine
#endif

Should I add OpenCombine to the project? I think it is not working due to the fact the Two types ObservableObject are colliding with each others.

from swiftwebui.

shial4 avatar shial4 commented on May 22, 2024

I've copy example from here example

That's what I am getting.

Screen Shot 2020-01-10 at 8 52 52 am

Without SwiftWebUI.Obse.... I have error such as:

'ObservableObject' is ambiguous for type lookup in this context

from swiftwebui.

helje5 avatar helje5 commented on May 22, 2024

All this is completely unrelated to this issue. OpenCombine is required on Linux, on macOS you can use the regular Combine (but you need Catalina).

from swiftwebui.

shial4 avatar shial4 commented on May 22, 2024

What I meant is that I still can't get it to work. Due to errors presented above.

from swiftwebui.

helje5 avatar helje5 commented on May 22, 2024

Oh, sorry. Actually it may not work indeed 🤔 That's what the issue is about 😄
I suppose SwiftWebUI is still assuming didChange, but ObservedObject already switched to willChange. Things probably go wrong ...

This might require a little rework.

I'm not sure how much, maybe it isn't actually that bad. Just replacing didChange w/ willChange might work, because WebUI is still working in a transaction. The "will" will still mark the view as dirty and should trigger the diffing.

from swiftwebui.

shial4 avatar shial4 commented on May 22, 2024

Resolved compiling issue. By placing ObservableObject in separate file with one import of SwiftWebUI.
Now I can work it out what's happening inside. See if and what is required to be corrected

from swiftwebui.

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.