formotion 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.md +8 -0
- data/README.md +3 -0
- data/examples/Login/Rakefile +1 -1
- data/examples/Persistence/Rakefile +1 -1
- data/lib/formotion/exceptions.rb +1 -0
- data/lib/formotion/row/row.rb +3 -0
- data/lib/formotion/row_type/string_row.rb +10 -0
- data/lib/formotion/version.rb +1 -1
- metadata +4 -4
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -96,6 +96,7 @@ form.build_section do |section|
|
|
96
96
|
section.build_row do |row|
|
97
97
|
row.title = "Label"
|
98
98
|
row.subtitle = "Placeholder"
|
99
|
+
row.type = :string
|
99
100
|
end
|
100
101
|
end
|
101
102
|
```
|
@@ -122,6 +123,8 @@ You have `form#submit`, `form#on_submit`, and `form#render` at your disposal. He
|
|
122
123
|
```ruby
|
123
124
|
class PeopleController < Formotion::FormController
|
124
125
|
def viewDidLoad
|
126
|
+
super
|
127
|
+
|
125
128
|
self.navigationItem.rightBarButtonItem = UIBarButtonItem.alloc.initWithBarButtonSystemItem(UIBarButtonSystemItemSave, target:self, action:'submit')
|
126
129
|
end
|
127
130
|
|
data/examples/Login/Rakefile
CHANGED
data/lib/formotion/exceptions.rb
CHANGED
data/lib/formotion/row/row.rb
CHANGED
@@ -231,6 +231,9 @@ module Formotion
|
|
231
231
|
# Called in UITableViewDataSource methods
|
232
232
|
# in form_delegate.rb
|
233
233
|
def make_cell
|
234
|
+
if self.object.nil?
|
235
|
+
raise Formotion::NoRowTypeError, "No row type specified for row #{self.index_path.row} in section #{self.index_path.section}; specify a :type"
|
236
|
+
end
|
234
237
|
cell, text_field = Formotion::RowCellBuilder.make_cell(self)
|
235
238
|
@text_field = text_field
|
236
239
|
self.object.after_build(cell)
|
@@ -58,6 +58,16 @@ module Formotion
|
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
61
|
+
if UIDevice.currentDevice.systemVersion >= "6.0"
|
62
|
+
field.swizzle(:setText) do
|
63
|
+
def setText(text)
|
64
|
+
r = old_setText(text)
|
65
|
+
self.sendActionsForControlEvents(UIControlEventEditingChanged)
|
66
|
+
r
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
61
71
|
field.placeholder = row.placeholder
|
62
72
|
field.text = row.value.to_s
|
63
73
|
cell.addSubview(field)
|
data/lib/formotion/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: formotion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-10-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bubble-wrap
|
@@ -194,7 +194,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
194
194
|
version: '0'
|
195
195
|
segments:
|
196
196
|
- 0
|
197
|
-
hash: -
|
197
|
+
hash: -1236886504313804300
|
198
198
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
199
199
|
none: false
|
200
200
|
requirements:
|
@@ -203,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
203
203
|
version: '0'
|
204
204
|
segments:
|
205
205
|
- 0
|
206
|
-
hash: -
|
206
|
+
hash: -1236886504313804300
|
207
207
|
requirements: []
|
208
208
|
rubyforge_project:
|
209
209
|
rubygems_version: 1.8.23
|