Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
'Show Tab Overview' script for Pythonista - adds button to toolbar to show tab overview
# coding: utf-8
from objc_util import *
UIApplication = ObjCClass('UIApplication')
UIBarButtonItem = ObjCClass('UIBarButtonItem')
@on_main_thread
def main():
rootVC = UIApplication.sharedApplication().keyWindow().rootViewController()
tabVC = rootVC.detailViewController()
tabVC.tabCollectionView().collectionViewLayout().itemSize = CGSize(328,200)
tabVC.tabCollectionView().contentInset = UIEdgeInsets(58,0,0,0)
overviewItem = UIBarButtonItem.alloc().initWithImage_style_target_action_(UIImage.imageNamed_('ShowTabs'), 0, tabVC, sel('showTabOverview:'))
tabVC.persistentLeftBarButtonItems = [overviewItem]
tabVC.reloadBarButtonItemsForSelectedTab()
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.