ruby_native 0.10.11 → 0.10.12

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,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ac513c84f990a0a7e941a473d7716d2378cfc181025bcb64e5254d55ab6670f6
4
- data.tar.gz: 46bd471f9a9fe986d87f4d4e3bef763a947dc6072c46e3214b34a83218edc77d
3
+ metadata.gz: a0c3d95e45afd32971cc8dc042ae37411aae04748b7b49cde8e9b94c9bc60a15
4
+ data.tar.gz: 047153c52db88fca1315f83ee8447509cc5ff28cb11abd802d9ad368a5864dff
5
5
  SHA512:
6
- metadata.gz: 8b5789805d6d25d8f74b2a2d20d6ec3ae89d3366d440bad818981dfbf74d8b83a02258ceb81831ec729986a3be3c48a02e24a24aca390953af6bf60d6201c7a1
7
- data.tar.gz: 99109eb6b6c7e6c887ed360129e5e38959d9a848be7320bf6c9a076344d6aedbc13ca69f79982eff55a0298b1957953313ac019f2f1e78cc241dad0b74fd8fc6
6
+ metadata.gz: 1fe808f45eeff4c420ce915bb53b1267f39e5139c0b9626e0e0d1ac2829e169136b8248f1665de5bfb88251617949c570b293475324b4b254582e535bef51b79
7
+ data.tar.gz: 9ae961899223792d3936309e098dbd3caa3e4bc6f09b0877fa88029973a5d582807cab250bedc10577b8790f8b7e2a80c23e2601ea7207c76e2c2a68704a1c39
@@ -126,6 +126,19 @@ module RubyNative
126
126
  end
127
127
  end
128
128
 
129
+ # Adds a segment to the nav bar. On iOS the segments render as a centered
130
+ # segmented control (the same control the App Store uses for Apps/Games).
131
+ # Mark the current page's segment `selected: true`. Tapping a segment
132
+ # navigates to its `href` (or clicks the `click` selector), replacing
133
+ # history so the back button doesn't walk back through segment switches.
134
+ def segment(title, href: nil, click: nil, selected: false)
135
+ data = { native_segment: "", native_title: title }
136
+ data[:native_href] = href if href
137
+ data[:native_click] = click if click
138
+ data[:native_selected] = "" if selected
139
+ @items << @context.tag.div(data: data)
140
+ end
141
+
129
142
  # Adds a native share button to the nav bar. Tapping it opens the
130
143
  # platform share sheet for `url:` (defaults to the current page on the
131
144
  # web side) so it works even where embedded web views don't support
@@ -1,3 +1,3 @@
1
1
  module RubyNative
2
- VERSION = "0.10.11"
2
+ VERSION = "0.10.12"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_native
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.11
4
+ version: 0.10.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Masilotti