sugarcube 0.2.5 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -147,6 +147,34 @@ image.uicolor # => UIColor.colorWithPatternImage(image)
147
147
  self.view << subview # => self.view.addSubview(subview)
148
148
  self.view.show # => self.hidden = false
149
149
  self.view.hide # => self.hidden = true
150
+ ```
151
+
152
+ View factories
153
+ ---------
154
+
155
+ ```ruby
156
+ UIButton.buttonWithType(:custom.uibuttontype)
157
+ # =>
158
+ UIButton.custom
159
+
160
+ UIButton.custom => UIButton.buttonWithType(:custom.uibuttontype)
161
+ UIButton.rounded => UIButton.buttonWithType(:rounded.uibuttontype)
162
+ UIButton.rounded_rect => UIButton.buttonWithType(:rounded_rect.uibuttontype)
163
+ UIButton.detail => UIButton.buttonWithType(:detail.uibuttontype)
164
+ UIButton.detail_disclosure => UIButton.buttonWithType(:detail_disclosure.uibuttontype)
165
+ UIButton.info => UIButton.buttonWithType(:info.uibuttontype)
166
+ UIButton.info_light => UIButton.buttonWithType(:info_light.uibuttontype)
167
+ UIButton.info_dark => UIButton.buttonWithType(:info_dark.uibuttontype)
168
+ UIButton.contact => UIButton.buttonWithType(:contact.uibuttontype)
169
+ UIButton.contact_add => UIButton.buttonWithType(:contact_add.uibuttontype)
170
+ ```
171
+
172
+ ```ruby
173
+ UITableView.alloc.initWithFrame([[0, 0], [320, 480]], style: :plain.uitableviewstyle)
174
+ UITableView.alloc.initWithFrame([[0, 0], [320, 480]], style: :grouped.uitableviewstyle)
175
+ # =>
176
+ UITableView.plain
177
+ UITableView.grouped
150
178
  ```
151
179
 
152
180
  UIControl
@@ -364,4 +392,4 @@ Assume I ran `include SugarCube::Adjust` in these examples.
364
392
  ```
365
393
 
366
394
  [BubbleWrap]: https://github.com/rubymotion/BubbleWrap
367
- [sweettea]: https://github.com/colinta/sweettea/README.md
395
+ [sweettea]: https://github.com/colinta/sweettea
@@ -0,0 +1,34 @@
1
+ class UIButton
2
+ class << self
3
+ def custom
4
+ self.buttonWithType(:custom.uibuttontype)
5
+ end
6
+ def rounded
7
+ self.buttonWithType(:rounded.uibuttontype)
8
+ end
9
+ def rounded_rect
10
+ self.buttonWithType(:rounded_rect.uibuttontype)
11
+ end
12
+ def detail
13
+ self.buttonWithType(:detail.uibuttontype)
14
+ end
15
+ def detail_disclosure
16
+ self.buttonWithType(:detail_disclosure.uibuttontype)
17
+ end
18
+ def info
19
+ self.buttonWithType(:info.uibuttontype)
20
+ end
21
+ def info_light
22
+ self.buttonWithType(:info_light.uibuttontype)
23
+ end
24
+ def info_dark
25
+ self.buttonWithType(:info_dark.uibuttontype)
26
+ end
27
+ def contact
28
+ self.buttonWithType(:contact.uibuttontype)
29
+ end
30
+ def contact_add
31
+ self.buttonWithType(:contact_add.uibuttontype)
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,10 @@
1
+ class UITableView
2
+ class << self
3
+ def plain
4
+ UITableView.alloc.initWithFrame([[0, 0], [320, 480]], style: :plain.uitableviewstyle)
5
+ end
6
+ def grouped
7
+ UITableView.alloc.initWithFrame([[0, 0], [320, 480]], style: :grouped.uitableviewstyle)
8
+ end
9
+ end
10
+ end
@@ -1,3 +1,3 @@
1
1
  module SugarCube
2
- Version = '0.2.5'
2
+ Version = '0.3.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sugarcube
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-07-23 00:00:00.000000000 Z
13
+ date: 2012-07-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake
17
- requirement: &70269784397300 !ruby/object:Gem::Requirement
17
+ requirement: &70233201675040 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70269784397300
25
+ version_requirements: *70233201675040
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rspec
28
- requirement: &70269784412820 !ruby/object:Gem::Requirement
28
+ requirement: &70233201690520 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
- version_requirements: *70269784412820
36
+ version_requirements: *70233201690520
37
37
  description: ! 'CocoaTouch/iOS is a *verbose* framework. These extensions hope to
38
38
  make
39
39
 
@@ -76,10 +76,12 @@ files:
76
76
  - lib/sugarcube/numeric.rb
77
77
  - lib/sugarcube/symbol.rb
78
78
  - lib/sugarcube/symbol/symbol_uicolor.rb
79
+ - lib/sugarcube/uibutton.rb
79
80
  - lib/sugarcube/uicolor.rb
80
81
  - lib/sugarcube/uicontrol.rb
81
82
  - lib/sugarcube/uifont.rb
82
83
  - lib/sugarcube/uiimage.rb
84
+ - lib/sugarcube/uitableview.rb
83
85
  - lib/sugarcube/uiview.rb
84
86
  - lib/sugarcube/uiviewcontroller.rb
85
87
  - lib/sugarcube/version.rb