Just added an example that let's you script UIs using a sci repl, https://github.com/phronmophobic/mobiletest#membrane-example. Feedback welcome! Here's an example of a simple counter:
(require '[membrane.ui :as ui])
(require '[com.phronemophobic.mobiletest.membrane :refer
[main-view]])
(def my-count (atom 0))
(defn counter-view []
(ui/translate 50 100
(ui/on
:mouse-down
(fn [pos]
(swap! my-count inc)
nil)
(ui/label (str "the count "
@my-count)
(ui/font nil 42)))))
(add-watch my-count ::update-view (fn [k ref old updated]
(reset! main-view (counter-view))))
(reset! my-count 0)wwwwaaat, wow
I've done a little bit more research into what objc interop would look like, but it's still a work in progress.
I wish the Apple ecosystem wasn't so closed down. Not sure what the best way to make it easy for other people to try things out.
Perhaps publish a thing that people can try via this thing, what was it, TestFlight?
yea, I can look into that if people are interested
I would be interested in that.
Are you also able to change the UI via the SCI REPL in the published app?
yea, there's a main-view atom. just reset its value and it will get redrawn
that's wicked
in addition to test-flight, I guess there's probably some CI system that could build everything for you if given the right provisioning profile
Maybe try to get something in the app store? ;)
I know Apple has frowned upon apps with scripting capabilities before, but maybe it's less restrictive now?
Maybe don't tell em? ;)
it's just "a config file to set the UI layout"
I think you could let users point to their gist to import a certain UI configuration (using scripting). Don't know what the app itself would do, perhaps a 4clojure app (now that the site is closing down) or a SCI REPL?
(typing code on a phone is a bit awkward though)
perhaps "docstring of the day", an app which shows you info about a particular clojure function
yea, it's more fun if you can script against the Apple platform apis
otherwise, you might as well make a web app
yes, agreed
@smith.adriane I wonder, have you ever had the stalling problem again since we made the initialize-at-build-time fix? > If it gets stuck directly after setup and doesn't reach the clinit phase within 3-4 minutes, try stopping the script and restarting ./scripts/compile-shared.
I haven't
cool
good find! maybe it's time to remove the warning from the docs
Perhaps it's possible to record your screen on the phone as post this as an animated gif in the repo
yea, shouldn't be too hard
also perhaps make a link or mention of this channel to get more interested people in here