Skip to content

Instantly share code, notes, and snippets.

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')
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]
if __name__ == '__main__':
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment