class UITabBarItem
Factory methods for UITabBarItem
. I've never understood why UITabBarItem
makes it so easy to set the view tag, but these methods do not require you to do so.
Public Class Methods
bookmarks(options={})
click to toggle source
# File lib/ios/sugarcube-factories/uitabbaritem.rb, line 67 def bookmarks(options={}) return self.system(UITabBarSystemItemBookmarks, options) end
contacts(options={})
click to toggle source
# File lib/ios/sugarcube-factories/uitabbaritem.rb, line 59 def contacts(options={}) return self.system(UITabBarSystemItemContacts, options) end
downloads(options={})
click to toggle source
# File lib/ios/sugarcube-factories/uitabbaritem.rb, line 75 def downloads(options={}) return self.system(UITabBarSystemItemDownloads, options) end
favorites(options={})
click to toggle source
# File lib/ios/sugarcube-factories/uitabbaritem.rb, line 43 def favorites(options={}) return self.system(UITabBarSystemItemFavorites, options) end
featured(options={})
click to toggle source
# File lib/ios/sugarcube-factories/uitabbaritem.rb, line 47 def featured(options={}) return self.system(UITabBarSystemItemFeatured, options) end
history(options={})
click to toggle source
# File lib/ios/sugarcube-factories/uitabbaritem.rb, line 63 def history(options={}) return self.system(UITabBarSystemItemHistory, options) end
more(options={})
click to toggle source
# File lib/ios/sugarcube-factories/uitabbaritem.rb, line 39 def more(options={}) return self.system(UITabBarSystemItemMore, options) end
most_recent(options={})
click to toggle source
# File lib/ios/sugarcube-factories/uitabbaritem.rb, line 79 def most_recent(options={}) return self.system(UITabBarSystemItemMostRecent, options) end
most_viewed(options={})
click to toggle source
# File lib/ios/sugarcube-factories/uitabbaritem.rb, line 83 def most_viewed(options={}) return self.system(UITabBarSystemItemMostViewed, options) end
recents(options={})
click to toggle source
# File lib/ios/sugarcube-factories/uitabbaritem.rb, line 55 def recents(options={}) return self.system(UITabBarSystemItemRecents, options) end
search(options={})
click to toggle source
# File lib/ios/sugarcube-factories/uitabbaritem.rb, line 71 def search(options={}) return self.system(UITabBarSystemItemSearch, options) end
system(type, options={})
click to toggle source
# File lib/ios/sugarcube-factories/uitabbaritem.rb, line 28 def system(type, options={}) type = type.uitabbarsystemitem if type.respond_to?(:uitabbarsystemitem) tag = options.fetch(:tag, 0) badge = options[:badge] item = self.alloc.initWithTabBarSystemItem(type, tag: tag) if badge item.badgeValue = badge.to_s end return item end
titled(title, options={})
click to toggle source
# File lib/ios/sugarcube-factories/uitabbaritem.rb, line 7 def titled(title, options={}) tag = options.fetch(:tag, 0) image = options[:image] badge = options[:badge] if image && image.respond_to?(:uiimage) image = image.uiimage end selected_image = options[:selected_image] if selected_image && selected_image.respond_to?(:uiimage) selected_image = selected_image.uiimage end item = self.alloc.initWithTitle(title, image: image, selectedImage: selected_image) if tag item.tag = tag end if badge item.badgeValue = badge.to_s end return item end
top_rated(options={})
click to toggle source
# File lib/ios/sugarcube-factories/uitabbaritem.rb, line 51 def top_rated(options={}) return self.system(UITabBarSystemItemTopRated, options) end