This repository was archived by the owner on Dec 13, 2017. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -139,6 +139,14 @@ typedef enum
139139
140140#pragma mark - Toolbar items
141141
142+ /* *
143+ * @brief Makes a toolbar item visible or hidden
144+ *
145+ * @param tag WPEditorViewControllerElementTag of the item to alter.
146+ * @param visible YES to make the item visible, NO to hide it.
147+ */
148+ - (void )toolBarItemWithTag : (WPEditorViewControllerElementTag)tag setVisible : (BOOL )visible ;
149+
142150/* *
143151 * @brief Enables and disables the toolbar items.
144152 *
Original file line number Diff line number Diff line change @@ -189,6 +189,21 @@ - (void)setSelectedItemTintColor:(UIColor *)selectedItemTintColor
189189
190190#pragma mark - Toolbar items
191191
192+ - (void )toolBarItemWithTag : (WPEditorViewControllerElementTag)tag setVisible : (BOOL )visible
193+ {
194+ for (ZSSBarButtonItem *item in self.leftToolbar .items ) {
195+ if (item.tag == tag) {
196+ item.customView .hidden = !visible;
197+ }
198+ }
199+
200+ for (ZSSBarButtonItem *item in self.regularToolbar .items ) {
201+ if (item.tag == tag) {
202+ item.customView .hidden = !visible;
203+ }
204+ }
205+ }
206+
192207- (void )enableToolbarItems : (BOOL )enable
193208 shouldShowSourceButton : (BOOL )showSource
194209{
You can’t perform that action at this time.
0 commit comments