GithubHelp home page GithubHelp logo

react-meets-swiftui's Introduction

React Meets SwiftUI

I'm looking to learn SwiftUI over the coming weeks and will be using this repository to record various common React design patterns implemented in SwiftUI. If you're a React developer interested in learning Swift UI, this might be a good place for you to start. You can also read the introductory blog post below.

An Introduction to SwiftUI for React Developers

Examples

Todo

  • Async Image (loading from URL)
  • Responsive layouts
  • Firebase
  • Packages
  • Gestures
  • Animation

react-meets-swiftui's People

Contributors

bmcmahen avatar jamesplease avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-meets-swiftui's Issues

Redux (Binding to an External Store) @ObjectBinding

Hiya, and thanks for the amazing resource for react devs!

My understanding on this is still a little vague but i think using @EnvironmentObject instead of @ObjectBinding is a little closer to a redux setup seeing as with @EnvironmentObject you can directly access a central source of truth/store from nested views without prop drilling.

Children example: using a Group?

๐Ÿ‘‹ Hey there! Really cool repo. I've already learned a lot from the 3 examples you've put together.

I'm still super new to Swift, but one idea I had for this example โ€“ and you may have already thought of this โ€“ is to update content to expect a Group instead of a Text. That way, you can return whatever you'd like by wrapping it in the Group.

(Note: I haven't tested this code, so it might not compile. Also, this general approach might not even be sound. And there is likely a better way altogether!)

import SwiftUI

struct Page : View {
    var body: some View {
        Layout() {
+            Group {
                Text("This is the page content")
+            }
        }
    }
}

struct Layout : View {

-   var content: () -> Text
+   var content: () -> Group

    var body: some View {
        VStack {
            Text("This is the layout")
            content()
        }
    }
}

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.