13 ms·
A Closer Look at Swift Playgrounds for iPad
- DigitalJack 9y agoInteresting. I've mostly been programming clojure for the last couple years. But I've got one project I'd like to try to make that is very GUI centric. I don't know what it is about GUI programming, but I pretty much hate it. It's a complete schlep for me... it seems to take so much energy and work for something that is tangential. If I had to go through the same level of effort to print something to the console, I'd never program anything.
- nsxwolf 9y agoAdd me to that club. Every tool designed to make GUI programming easier seems to just add complexity and confusion. From hand coded Win32 C++ GUIs to Tcl to Swing to Interface Builder/Storyboards, AngularJS and Bootstrap, I've had to use it all and have managed to turn all those things into giant writhing masses of spaghetti code every time.
- colde 9y agoHave you tried C#/XAML? It is by far the best GUI library/setup i have used by a large margin. It really makes everything else seem completely shit.
- seanmcdirmid 9y agoI always go old school in my own GUI programming, preferring just to draw everything myself via canvas or other immediate mode drawing APIs. It always comes out much cleaner than using a retained widget library.
- GuiA 9y agoI've used a fair amount of GUI tookits (including all the ones mentioned by grandparent), as well as written my own. I have to say that I really like Cocoa (particularly UIKit over AppKit) and feel that of everything I've ever worked with, it gets the most right. Of course, you become bound to a specific platform (I've been meaning to give GNUstep a try, not sure how good it is).
- pjmlp 9y agoGNUStep is kind of dead. Expect not so good Objective-C support for anything later than 2.0 and API support at best around Panther timeframe.
- flukus 9y agoThe two things that have helped me write clean GUI code the most are having some sort of event bus and following the MVVM pattern. The event bus helps you to decouple various parts of the UI, like when a certain menu item has to be disabled by certain data. MVVM let's you embrace the inherent statefulness of UI's and to test them. Both add a fair bit of complication in the short term but reduce it when the app gets bigger. Neither seems to suffer from the performance/correctness trade off that other methods (like forcing every minor change to redraw the UI) often have.
- bsaul 9y agothat's because , as much as we backend dev don't like to admit, frontend development is actually quite hard to be done properly. You have pretty much the same issues as in the backend : state management, concurrency, latency; plus specific ones : aesthetic and ergonomic. i've seen many backend dev calling themselves code heroes falling apart after a few days spent trying to design an android interface. it's a great humility lesson.
- aeorgnoieang 9y ago> state management Every GUI of any significant complexity I've ever created ended up needing (if not having) an explicit state machine to work reliably.
- pjmlp 9y agoThat is the problem, hand coding instead of using the graphical tools for GUI design.
- flukus 9y agoThat only helps for building the actual UI, which IME is not where the spaghetti comes from. The spaghetti comes from "if this data disable this control" type of stuff.
- chuckdries 9y agoNext time, give Vue a shot. All it does is take an HTML template, fill in some data, and update the data when the original 'source of truth' updates. All you have to do is modify that 'source of truth.' Yeah you still have to work with HTML and CSS but it abstracts away DOM manipulation without introducing too much overhead. Use it with Bootstrap, or even materialize for a more opinionated but batteries-included CSS experience. Personally, I tried and hated Angular because it tried to control everything I did. Vue says "make your application however you like, let us handle the view layer and that's it."
- hellofunk 9y agoIf you like clojure, I think you'll find that the clojurescript tools like reagent are among the simplest ways to build interfaces you'll find in any language. I've been using swift, C++, JavaScript, Elm, clojurescript, and others the last few years to build really nice user interfaces, and clojure is by far was the best.
- bschwindHN 9y agoCheck out Re-Frame and Reagent, that's the only UI programming framework I've actually enjoyed. Both are in ClojureScript. Re-Frame: https://github.com/Day8/re-frame https://github.com/Day8/re-frame Reagent: https://reagent-project.github.io/ https://reagent-project.github.io/
- tsukaisute 9y agoA young person in our family was using this. It's a beautiful app, but typing and editing code on an iPad without a physical keyboard appeared to be extremely frustrating. Cutting-pasting, refactoring, etc. all become cumbersome and she had to spend time fighting with the editor instead of focusing on the problems. Waiting for them to make a Mac port, since coding happens on a "real" computer (for now, anyway).
- Cthulhu_ 9y agoIntegrating this app into Playgrounds in xcode would work, although they'd have to make it accessible; xcode is easy enough to install, but it's not marketed as a "install this to learn to code" type of app. Distributing it separately would be better.
- Grustaf 9y agoThe playground format that this course uses ("playground book") is currently not supported in xcode, but hopefully that will change at some point.
- tangue 9y agoYou can use a bluetooth keyboard with an ipad. (the stock aluminium mac keyboard is the most obvious choice but I guess every bluetooth keyboard will work).
- ballenf 9y agoEven cheap keyboard cases provide an incredible productivity boost. Was amazed that shortcut keys like cmd-tab just work.
- interpol_p 9y agoInterestingly even emacs-style shortcut keys for text navigation have been supported in iOS text fields since forever when using a bluetooth keyboard.
- deleted 9y ago
- wjakob 9y agoI wish Apple would internationalize this program to make it accessible to children in non-English-speaking countries.
- yoz-y 9y agoI am pretty sure they will, given their track record.
- mamp 9y agoI believe internationalisation is a big part of version 2 due with iOS 11.
- microtherion 9y agoThat has already happened to some extent, and presumably is going to happen further: https://www.apple.com/newsroom/2017/03/swift-playgrounds-now-available-in-five-additional-languages/ https://www.apple.com/newsroom/2017/03/swift-playgrounds-now...
- wingerlang 9y agoToo bad it isn't available for iOS 9.
- jclardy 9y agoFor what? iPad 2?
- wingerlang 9y agoiPad Air.
- Grustaf 9y agoThe on screen ipad keyboard does support moving the cursor, just put two fingers on the keyboard and move them around. With an external keyboard selection works like on a pc, just hold shift and use the arrow keys. The only thing that's really missing to make editing text on the ipad a breeze is a way to select while moving the cursor with the two finger gesture above.
- jads 9y ago>The only thing that's really missing to make editing text on the ipad a breeze is a way to select while moving the cursor with the two finger gesture above. You can. Double-tap a word or character so it's selected, then do the two-finger select gesture on the keyboard.
- Grustaf 9y agoYeah, I didn't think of that and it goes part of the way, but it would be nice if you could move the cursor to the exact position you want to select from, put down a third finger on the keyboard and then move the cursor. At least for me that would feel more efficient.
- jclardy 9y agoYeah, that seems like it would be the best way, at least until they get 3D Touch on an iPad. On the iPhone you move the cursor with a light 3d touch on the keyboard, then can start a selection by pressing down harder.
- Grustaf 9y agoBrilliant, that detail was news to me, even though I had tried versions of that.
- deleted 9y ago[deleted]
- interpol_p 9y ago
- deleted 9y ago[deleted]
- fgandiya 9y agoOne thing I wished this app had was a playground that teaches you how to interact with the iOS SDK. After all, you can use it in the blank playground, might as well show people how to use it.