Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Looking cool, I think iOS development in general could learn a lot from React + JS ecosystem. :+1:


What problems do you think the React + JS ecosystem could solve in the iOS world that haven't already largely been solved by standard iOS development approaches? I'm legitimately asking here - I been developing for iOS for years (and more recently with React from time to time for the web), and I've never once felt that standard iOS conventions/patterns were lacking compared to the React/JS ecosystem, but I would like to understand your point of view.


My favorite thing about react/react native development is the unidirectional flow of data. Specifically I like how it gives you:

1) Deterministic View Renders 2) Deterministic State Reproduction

I think the following article gives a good overview of why this is a good idea:

https://medium.com/javascript-scene/10-tips-for-better-redux...

Quoting from the article:

"When your view render is isolated from network I/O and state updates, you can achieve a deterministic view render, meaning: given the same state, the view will always render the same output. It eliminates the possibility of problems such as race conditions from asynchronous stuff randomly wiping out bits of your view, or mutilating bits of your state as your view is in the process of rendering."

ComponentKit is another example of a native library inspired by react (also developed by FB):

http://componentkit.org/


Biggest problem is the lack of a proper way to update data thru the app. More often than not, we end with a big mess of singleton, notification, badly implemented kvo... and if you're not lucky, you'll have to fight to get an authoritative source for the data, or the latest one. When I see what's possible with solution like Om, I'm very envious (not that it's a silver bullet, but it's a major step forward in my point of view)


You should try Realm. We radically simplified the architecture of our app by using Realm as the authoritative source of data (equivalent to a redux store) and then having all the views reacting to changes in the model. This also allowed us to have all writes happening background threads.


I am a huge fan of Realm; I have personally moved to a model where I use Realm as the authoritative source of data. It works very well.


I've been a Cocoa dev for 10+ years, and I have been doing React Native for a few months while the team I work in has been doing it longer. ( http://artsy.github.io/series/react-native-at-artsy/ )

The general things Cocoa could improve from JS:

* State Management * View lifecycle management * JSON -> UI (this became a lot worse with Swift) * Developer Happiness ( e.g. compare https://github.com/orta/vscode-jest to TDD in Xcode ) * Open toolchains (Swift is improving this)

The JS ecosystem focused on building apps that talk to APIs and act as simpler clients, the Cocoa one is about building apps that don't.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: