13. SugarCube started out as a Fusionbox project
(see the announcement), but as its popularity
increased, the decision was made to offer it to
the rubymotion community, in the spirit of
open-source and collaboration. It is a great
compliment to teacup, especially when paired
with sweettea!
12年10月27日土曜日
14. Teacup
A community-driven DSL for creating user interfaces on the
iphone.
Using teacup, you can easily create and style layouts while
keeping your code dry. The goal is to offer a rubyesque (well,
actually a rubymotion-esque) way to create interfaces
programmatically.
sweettea
teacup
+
sugarcube
=
sweettea
12年10月27日土曜日
23. $bundle
Fetching gem metadata from https://rubygems.org/...
Installing geomotion (0.0.2)
Installing thor (0.16.0)
Installing rubymotion_generators (0.0.3)
Using sugarcube (0.11)
Using bundler (1.2.1)
Your bundle is complete! Use `bundle show [gemname]` to see where a
bundled gem is installed.
$
12年10月27日土曜日
38. (UILabel(#9626020, [[30.0, 30.0...)> adjust self
=> UILabel(#9626020, [[30.0, 30.0], [150.0, 20.0]], text: "This is page 1"), child of UIView(#9625860)
(UILabel(#9626020, [[30.0, 30.0...)> right 10
[[40.0, 30.0], [150.0, 20.0]]
=> UILabel(#9626020, [[40.0, 30.0], [150.0, 20.0]], text: "This is page 1"), child of UIView(#9625860)
(UILabel(#9626020, [[40.0, 30.0...)> r 10
[[50.0, 30.0], [150.0, 20.0]]
=> UILabel(#9626020, [[50.0, 30.0], [150.0, 20.0]], text: "This is page 1"), child of UIView(#9625860)
12年10月27日土曜日
39. #
if
you
are
in
the
REPL,
you
might
not
be
able
to
click
on
the
view
you
want...
>
adjust
superview.subviews[4].subviews[1]
>
up
1
>
down
1
#
same
as
up
-‐1,
obviously
>
down
#
defaults
to
1
anyway
>
left
1
>
right
1
#
same
as
up
-‐1,
obviously
>
left
#
=>
left
1
>
origin
10,
12
#
move
to
x:10,
y:12
>
wider
1
>
thinner
1
>
taller
#
=>
taller
1
>
shorter
#
=>
shorter
1
>
size
100,
10
#
set
size
to
width:100,
height:
10
>
shadow(opacity:
0.5,
offset:
[0,
0],
color:
:black,
radius:
1)
#
and
path,
which
is
a
CGPath
object.
>
center
#
See
`Centering`
section
below
>
restore
#
original
frame
and
shadow
is
saved
when
you
call
`adjust`
12年10月27日土曜日