Re:Show HN: Lima, a Swift-based DSL for responsive iOS devel...
by matchbok on Wednesday November 07, 2018 @10:45AM
(#18399842)
Agreed... I'd much prefer a declarative layout language though. With complex layouts, it's hard to debug AL if you aren't the one who built it.
Even stackviews, which was Apple admitting that simple layouts are too verbose to do with AL, are a mess.
Re:Show HN: Lima, a Swift-based DSL for responsive iOS devel...
by dep_b on Wednesday November 07, 2018 @11:00AM
(#18399952)
Well storyboards are declarative if you view the source but they're burdened with a ton of legacy. If a view is constrained by auto layouts the frame values should disappear but they don't, leading to a ton of false positives when committing changes. You only have cryptic ID's not real names as references. Also making a mistake in the XML format tends to crash the parser without giving a usable clue to what went wrong.
Last problem is that everything in Interface Builder still lives apart from the code. I think in Android everything gets compiled and is safe to use from there, with IBOutlets you're always either taking the risk (!) or dealing with optionals everywhere (?)
Re:Show HN: Lima, a Swift-based DSL for responsive iOS devel...
by oflannabhra on Wednesday November 07, 2018 @11:23AM
(#18400142)
Rumor is that official, cross-platform declarative layouts are coming to iOS from Apple [0].
[0] - https://daringfireball.net/2018/04/scuttlebutt_regarding_ui_...
Re:Show HN: Lima, a Swift-based DSL for responsive iOS devel...
by tijs on Wednesday November 07, 2018 @11:30AM
(#18400197)
Did that not turn out to be uikit port to macos?
https://thehackernews.com/2018/06/porting-ios-apps-macos.htm...
Re:Show HN: Lima, a Swift-based DSL for responsive iOS devel...
by oflannabhra on Wednesday November 07, 2018 @01:01PM
(#18400866)
No, I believe it is the case that Gruber conflated two separate projects (which might both be part of the same overall vision). The first was codenamed "Marzipan" and has been announced (and leaked and reported by Gurman). The second is what Gruber is speaking of in that article, and relates to laying out views. It has not been announced, but is codenamed Amber. Gruber clarified this post-Marzipan announcement in a tweet [0]. More info from Gurman [1].
[0] - https://mobile.twitter.com/gruber/status/1014490721909444608
[1] - https://mjtsai.com/blog/2018/05/01/scuttlebutt-regarding-app...
Re:Show HN: Lima, a Swift-based DSL for responsive iOS devel...
by dep_b on Wednesday November 07, 2018 @03:46PM
(#18402261)
That would be amazing. I really like using Storyboards if only just to better separate layout from logic but there are so many downsides to them that I just don't really use them all of the time.
Re:Show HN: Lima, a Swift-based DSL for responsive iOS devel...
by rimliu on Wednesday November 07, 2018 @04:19PM
(#18402504)
I think UIStackView would be much simpler solution for this ;)
Re:Show HN: Lima, a Swift-based DSL for responsive iOS devel...
by gk_brown on Wednesday November 07, 2018 @06:33PM
(#18403251)
UIStackView is a step in the right direction, but it doesn't go far enough. It's still not truly declarative; it requires you to think in terms of content priorities; and it doesn't support z-ordering.
I don't think they can get much shorter than this:
And honestly the stuff I needed to do to get CSS working let alone cross-browser until very recently was really not as consistent, clean or predictable as auto layouts. I think you just got used to the suffering.The only thing I really like about CSS is the arbitrary lines you can draw in the sand like "if it gets over 1000px wide then move the menu to the right".