formotion 1.5.1 → 1.6

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.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- YzRkYTkxZmM3MzIyMzdkMTBjNzY0MWRjMjNjZjFmNjhhZGUzOTZkOA==
5
- data.tar.gz: !binary |-
6
- YzZhMmQ3NTQ4YWVjODQ5YjcyOWVkYTJiNGJhYmU0YTE0NjVlNTQ2OQ==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- ZGUzZTRiODVlMmE3MGY2YjRiNGIzNTBiZjQ2MDI5ZTA3ODBiNzRhZTFmNGFl
10
- ZjYwZmQ2NDg4YTMzMDMyZTljZGQ3ZTNkMjc3OTA2OWUxNjVjNWVhOTI3MTQ0
11
- NjY2YmQ5ZmE0NGU1NWZlMWI4MTNmMDk1MGRhNGNjZDU0ZDNjZDI=
12
- data.tar.gz: !binary |-
13
- ODE0MDE1OWU3NzEwMTliNzA1MGIzMzE3NWU0MjIxZGFjYzIwMTg0NjE4ZGIx
14
- OWY1ZjlmMmY3YzhiNjg3ZTZiYmYxYTY0MWM5OWViNDE0MGM4MDY0ZDg2MzRj
15
- YTEyNTc3ODA2MTAzNzhkOWQ2NjYzZTBmODQ2MzMyMjQyYmYxOTE=
2
+ SHA1:
3
+ metadata.gz: 3407c939ef975c1f7e97164c26689e0110507891
4
+ data.tar.gz: 996472e335ea5b2be05e62fccc4499402e21b6a0
5
+ SHA512:
6
+ metadata.gz: ac0469bebf08738e7ec88465b6b72fce94625f02b65eb5815f85650a5671046266f90beee6100f6cf16d8849ebcd6100eb58f9c74d23ac2b669238de29a233c5
7
+ data.tar.gz: e16aeb3fbd30d8407bb19b7bd102b04b90274c2f1540056d110371bfbab3a4709ee0afb33838267ebf4b214b16a2772b0b6e460471e8fd808903d10e37cc6948
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
15
15
  s.require_paths = ["lib"]
16
16
  s.license = 'MIT'
17
17
 
18
- s.add_dependency "bubble-wrap", "~> 1.3.0"
18
+ s.add_dependency "bubble-wrap", "~> 1.4.0"
19
19
  s.add_dependency "motion-require", "~> 0.0.3"
20
20
  s.add_development_dependency 'rake'
21
21
  end
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'formotion', path: '../..'
@@ -1,7 +1,10 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  $:.unshift("/Library/RubyMotion/lib")
3
3
  require 'motion/project'
4
- require '../../lib/formotion'
4
+
5
+ require 'rubygems'
6
+ require 'bundler'
7
+ Bundler.require :default
5
8
 
6
9
  Motion::Project::App.setup do |app|
7
10
  # Use `rake config' to see complete project settings.
@@ -60,7 +60,7 @@ module Formotion
60
60
 
61
61
  # Subview Methods
62
62
  def push_subform(form)
63
- @subform_controller = Formotion::FormController.alloc.initWithForm(form)
63
+ @subform_controller = self.class.alloc.initWithForm(form)
64
64
 
65
65
  if self.navigationController
66
66
  self.navigationController.pushViewController(@subform_controller, animated: true)
@@ -104,10 +104,14 @@ module Formotion
104
104
  end
105
105
 
106
106
  def row(key)
107
+ found = nil
107
108
  each_row do |row|
108
- return row if row.key == key
109
+ if row.key == key
110
+ found = row
111
+ break
112
+ end
109
113
  end
110
- nil
114
+ found
111
115
  end
112
116
 
113
117
  #########################
@@ -34,6 +34,7 @@ class UITextView
34
34
 
35
35
  if (@shouldDrawPlaceholder)
36
36
  self.placeholder_color.set
37
+ self.font ||= UIFont.systemFontOfSize(17) # ios7 seems to have a bug where font of uitextview isn't set by default
37
38
  self.placeholder.drawInRect(placeholder_rect, withFont:self.font)
38
39
  end
39
40
  end
@@ -7,6 +7,7 @@
7
7
  #################
8
8
  module Formotion
9
9
  class RowCellBuilder
10
+ extend BW::KVO
10
11
 
11
12
  # PARAMS row.is_a? Formotion::Row
12
13
  # RETURNS [cell configured to that row, a UITextField for that row if applicable or nil]
@@ -16,8 +17,16 @@ module Formotion
16
17
  cell = UITableViewCell.alloc.initWithStyle(row.object.cell_style, reuseIdentifier:row.reuse_identifier)
17
18
 
18
19
  cell.accessoryType = cell.editingAccessoryType = UITableViewCellAccessoryNone
20
+
19
21
  cell.textLabel.text = row.title
22
+ observe(row, "title") do |old_value, new_value|
23
+ cell.textLabel.text = new_value
24
+ end
25
+
20
26
  cell.detailTextLabel.text = row.subtitle
27
+ observe(row, "subtitle") do |old_value, new_value|
28
+ cell.detailTextLabel.text = new_value
29
+ end
21
30
 
22
31
  edit_field = row.object.build_cell(cell)
23
32
 
@@ -28,7 +28,7 @@ module Formotion
28
28
  end
29
29
  if row.section.select_one and !row.value
30
30
  row.section.rows.each do |other_row|
31
- other_row.value = (other_row == row)
31
+ other_row.value = (row == other_row)
32
32
  end
33
33
  elsif !row.section.select_one
34
34
  row.value = !row.value
@@ -1,3 +1,3 @@
1
1
  module Formotion
2
- VERSION = "1.5.1"
2
+ VERSION = "1.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formotion
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: '1.6'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Clay Allsopp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-14 00:00:00.000000000 Z
11
+ date: 2013-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bubble-wrap
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: 1.3.0
19
+ version: 1.4.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ~>
25
25
  - !ruby/object:Gem::Version
26
- version: 1.3.0
26
+ version: 1.4.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: motion-require
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -42,14 +42,14 @@ dependencies:
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  description: Making iOS Forms insanely great with RubyMotion
@@ -78,6 +78,7 @@ files:
78
78
  - examples/FormModel/app/users_controller.rb
79
79
  - examples/FormModel/spec/main_spec.rb
80
80
  - examples/KitchenSink/.gitignore
81
+ - examples/KitchenSink/Gemfile
81
82
  - examples/KitchenSink/README.md
82
83
  - examples/KitchenSink/Rakefile
83
84
  - examples/KitchenSink/app/app_delegate.rb
@@ -222,17 +223,17 @@ require_paths:
222
223
  - lib
223
224
  required_ruby_version: !ruby/object:Gem::Requirement
224
225
  requirements:
225
- - - ! '>='
226
+ - - '>='
226
227
  - !ruby/object:Gem::Version
227
228
  version: '0'
228
229
  required_rubygems_version: !ruby/object:Gem::Requirement
229
230
  requirements:
230
- - - ! '>='
231
+ - - '>='
231
232
  - !ruby/object:Gem::Version
232
233
  version: '0'
233
234
  requirements: []
234
235
  rubyforge_project:
235
- rubygems_version: 2.0.7
236
+ rubygems_version: 2.0.3
236
237
  signing_key:
237
238
  specification_version: 4
238
239
  summary: Making iOS Forms insanely great with RubyMotion