tgios 0.0.26 → 0.0.27

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,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- N2E5YmI3NTA2Y2I3NzEzYWU3MTkzZTg5YjZmN2FlZmI3N2NmMzkwYg==
4
+ OGZhNTM4MzNjNzZmMzQzOWI4NjU0YjA5MTQ4NWQxNTc2ZmNjMGZmYg==
5
5
  data.tar.gz: !binary |-
6
- M2VjY2NiZTBkYWExNTk3NmQyZmI5MjgxNGJhZmYwMmE2NmI1N2Y5Yw==
6
+ M2QyMWIyZDQ0YTljZTNlNWM2NjI3ZmM4OWNjYmY1ZmZmZmYyN2QwNg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZGZmODdmM2YxNmEzMTU5Yjk5NzYzNGNiYjI2MGQ4NTQ5Y2U2OThjZDA5Nzkx
10
- M2YxMjJkNGQ3Njc0NDE2Nzk4OGNhNjY4NTIzYzVkYTZlMmRhODVmNDY3NGZm
11
- Y2NjOWUwNTdkOGU3MWY4YjJjMWU2ZDc2OTM2ZDJhNGJhNWVjMzY=
9
+ NjMwZmIxNGI3MDQ0NjUyNjA3OGNiYjQ4YTczYTU0N2FmYjY5ZjE3N2JiMDc4
10
+ MjM3OTZmMWM0OTJhZDUwNzU1NTg5ZDQ3Nzc5ZGZlNzRlYWQ4NGY2NGM0MzI4
11
+ ODRjZTZlMDdkZjAxZDgyOGI4YjYzY2RiYjczY2ZmNjYzNzczZmU=
12
12
  data.tar.gz: !binary |-
13
- NzQ4NTVmNDI2ZTRkNzg0ZDZmNTQxYjhjYzkyYWE0ZDg5ZDJlNjljZjMyMjg3
14
- YTkxMWY3YzliYzczNWYzNTgyZDI4NTcwOWJhMDkzMTMwZDM4YWNmYjc4Nzg0
15
- OTVmOThiNTBjOGFmZmFhNTRhYmJkYTI1YjUxYWUzNWE1MTM1NmE=
13
+ MjdmMDVlOTYyZjVlMTZhOThiN2M0MDQ0MmQ3NTdlN2I3NTZmZjJlM2QwYmM0
14
+ ODFlOGRhNzRhNGFkMzEwODNjNGRkZDlhYTY5OTc5NWVjYjBhMmE1MTJhNzIy
15
+ NmFjZmFhOGMxZjQ2NjQzZGM1MmM4M2QyNjI4ZDMyNWQ4YzdmMTA=
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tgios (0.0.26)
4
+ tgios (0.0.27)
5
5
  awesome_print_motion
6
6
  motion-layout
7
7
  plastic_cup (>= 0.1.1)
@@ -6,6 +6,7 @@ module Tgios
6
6
  @events={}
7
7
  @events[:build_cell]=->(cell_identifier, type) { build_cell(cell_identifier, type)}
8
8
  @events[:update_cell]=->(field_set, cell, index_path) { update_field(field_set, cell, index_path)}
9
+ @events[:update_cell_height]=->(field_set, index_path) { update_cell_height(field_set, index_path) }
9
10
  self
10
11
 
11
12
  end
@@ -144,9 +145,25 @@ module Tgios
144
145
 
145
146
  def tableView(tableView, heightForRowAtIndexPath: index_path)
146
147
  field_set = field_set_at_index_path(index_path)
148
+ @events[:update_cell_height].call(field_set, index_path)
149
+ end
150
+
151
+ def update_cell_height(field_set, index_path)
147
152
  field_set = field_set[:child_field] unless field_set[:child_index].nil?
153
+ return field_set[:height] if field_set[:height]
148
154
  if field_set[:type] == :big_label || field_set[:type] == :checkbox
149
155
  26 + 19 * (field_set[:lines] || 2)
156
+ elsif field_set[:type] == :text_view
157
+ 110
158
+ elsif field_set[:type] == :dynamic_label
159
+ return 45 if @model.send(field_set[:name]).nil?
160
+ width = 284
161
+ width -= 20 unless field_set[:accessory].nil? || field_set[:accessory] == :none
162
+ width -= 94 if field_set[:show_label]
163
+ height = @model.send(field_set[:name]).sizeWithFont(UIFont.systemFontOfSize(14),
164
+ constrainedToSize: [width, 9999],
165
+ lineBreakMode: UILineBreakModeCharacterWrap).height + 20
166
+ [height, 45].max
150
167
  else
151
168
  45
152
169
  end
data/lib/tgios/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tgios
2
- VERSION = '0.0.26'
2
+ VERSION = '0.0.27'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tgios
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.26
4
+ version: 0.0.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - April Tsang
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-05-15 00:00:00.000000000 Z
12
+ date: 2014-05-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sugarcube