Live data from Hacker News

Katana – Modern Swift framework for creating iOS apps, inspired by React/Redux

github.com

31–40 of 54 posts

Re: Katana – Modern Swift framework for creating iOS apps, inspired by React/Redux

#31

Earlier quoted context omitted.

I don't blame you for being skeptical. The main advantages we've noticed using this pattern are: 1) every time there is a crash or a problem we can look at the the state and the actions that lead to that situation. This improved our ability to spot and fix bugs. 2) we can easly reproduce any appearance of the UI by providing a struct the rappresents the state of the app. This has improved our ability to QA the entire…

Those are legitimately interesting advantages - thank you for replying. Those would make really interesting deep dives blog posts / videos for making a case for Katana.

We haven't (yet) blog posts about Katana advantages, but if you want to try it yourself here you can find a very simple tutorial that will guide you in creating a very simple game

https://github.com/BendingSpoons/katana-tutorial-swift

It explores the core concepts of the framework and gives you an hint about how it feels to develop applications with this approach

Re: Katana – Modern Swift framework for creating iOS apps, inspired by React/Redux

#32
post #15

Earlier quoted context omitted.

What are the normal iOS conventions? MVC pattern in iOS usually creates Massive View Controllers that are really hard to maintain and test.

I'd argue that "massive view controllers" aren't "normal", and if you find yourself in situations with massive view controllers, those are likely excellent candidates to refactor into smaller view controllers that can be composed together using something like iOS view controller containment. Well-disciplined iOS developers can keep this under control. I'll turn the question around - don't you see the potential for th…

You have a lot of comments on this article, with some good questions and good points. However, I think there's a theme in some of them:

> Well-disciplined iOS developers can keep this under control.

Well-disciplined iOS developers with good development practices were also able to manage manual reference counting. However, I think it's widely agreed that ARC was a step forward for iOS development. Similarly, the Swift language has eliminated whole classes of bugs - ones that expert developers didn't often struggle with but nevertheless were problematic for the platform as a whole.

Personally, I love developing for iOS. I don't think there's anything broken with Apple's frameworks. I tend to be conservative and would prefer to rely on first-party provided frameworks & libraries when writing an application, with judicious use of 2nd & 3rd party code.

However, I believe there will be a better way to write iOS apps in the future. I think there's a lot of accidental complexity involved that must be simplified eventually. I don't think Katana is the solution. But I'm very curious to find out if it's a step in the right direction.

Re: Katana – Modern Swift framework for creating iOS apps, inspired by React/Redux

#33
post #5

How do you deal with the main thread and thread safety? Being able to 'modify' views off the main thread would be the largest advantage of something like this, kind of like async display kit

hey mahyarm, thanks for the feedback

this is definitely something interesting. We started looking into that at the beginning of the project but later we dropped it since we haven't found a use case when that was really needed, the performance are quite satisfying at the moment! Katana already has a diffing algorithm in place and some other optimizations.

If you have a project that could benefit from it, please open an issue so we can take a look at it!

Re: Katana – Modern Swift framework for creating iOS apps, inspired by React/Redux

#35
post #7

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…

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)

Re: Katana – Modern Swift framework for creating iOS apps, inspired by React/Redux

#36
post #34

From the code samples in README: var payload: () What does that mean? What type has payload? I throwed it inside Xcode, it does compile but i still don't understand it.

It's Void. In that example there is no need for the action to have a payload.

Re: Katana – Modern Swift framework for creating iOS apps, inspired by React/Redux

#39

This feels a bit like a solution without a problem, or maybe more like a giant sledgehammer-sized solution to 10 or 15 smaller ant-size problems. I guess I'm just not sure what advantage I'd get by taking a (frankly) mind-bending approach to building an iOS app instead of following normal iOS conventions. And just to be clear I've done React development on the web, and I've thoroughly enjoyed it. Modern web developme…

As an iOS user, do you ever find that you have to kill an app in the app switcher and then restart it, to get some corner of the UI to refresh?

Also, if I understand correctly, when you open an iOS app, it should always come back to where you left it, regardless of whether it was killed in the meantime (possibly by the OS).

I'm guessing these things are easier to deal with correctly if you use something like React+Redux or Katana.

Post reply on HN