Dark tabs for Zenith! Mirror of https://github.com/mac-user669/ZenithDark
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

ZNDarkPrefsRootListController.m 3.7KB

hace 4 años
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #import "ZNDarkPrefsRootListController.h"
  2. @implementation ZNDarkPrefsRootListController
  3. -(void)viewWillAppear:(BOOL)animated {
  4. [super viewWillAppear:animated];
  5. // share button for our tweak :P
  6. self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCompose target:self action:@selector(shareTapped)];
  7. }
  8. //share button action
  9. - (void)shareTapped {
  10. NSString *shareText = @"Turn off the lights! It's too bright! Get dark tabs for #Zenith (@Muirey03) by using #ZenithDark from @mac_user669 and @iKilledAppl3! https://mac-user669.github.io/repo/";
  11. UIImage *image = [UIImage imageWithContentsOfFile:kImagePath];
  12. NSArray * itemsToShare = @[shareText, image];
  13. UIActivityViewController *controller = [[UIActivityViewController alloc]initWithActivityItems:itemsToShare applicationActivities:nil];
  14. // and present it
  15. [self presentActivityController:controller];
  16. }
  17. - (void)presentActivityController:(UIActivityViewController *)controller {
  18. // for iPad: make the presentation a Popover
  19. controller.modalPresentationStyle = UIModalPresentationPopover;
  20. [self presentViewController:controller animated:YES completion:nil];
  21. UIPopoverPresentationController *popController = [controller popoverPresentationController];
  22. popController.permittedArrowDirections = UIPopoverArrowDirectionAny;
  23. popController.barButtonItem = self.navigationItem.rightBarButtonItem;
  24. }
  25. - (NSArray *)specifiers {
  26. if (!_specifiers) {
  27. _specifiers = [[self loadSpecifiersFromPlistName:@"Root" target:self] retain];
  28. }
  29. return _specifiers;
  30. }
  31. -(void)followMe {
  32. NSURL *twitter = [NSURL URLWithString:@"https://twitter.com/mac_user669"];
  33. [[UIApplication sharedApplication] openURL:twitter options:@{} completionHandler:nil];
  34. }
  35. -(void)followiKA {
  36. NSURL *twitter = [NSURL URLWithString:@"https://twitter.com/iKilledAppl3"];
  37. [[UIApplication sharedApplication] openURL:twitter options:@{} completionHandler:nil];
  38. }
  39. -(void)followSkitty {
  40. NSURL *twitter = [NSURL URLWithString:@"https://twitter.com/SkittyBlock"];
  41. [[UIApplication sharedApplication] openURL:twitter options:@{} completionHandler:nil];
  42. }
  43. -(void)respring {
  44. NSTask *task = [[[NSTask alloc] init] autorelease];
  45. [task setLaunchPath:@"/usr/bin/killall"];
  46. [task setArguments:[NSArray arrayWithObjects:@"backboardd", nil]];
  47. [task launch];
  48. }
  49. -(void)doAFancyRespring {
  50. UIAlertController *confirmRespringAlert = [UIAlertController alertControllerWithTitle:@"Apply Settings?" message:@"This will respring your device." preferredStyle:UIAlertControllerStyleActionSheet];
  51. UIAlertAction *confirm = [UIAlertAction actionWithTitle:@"Respring" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
  52. // blur then respring our device!
  53. self.mainAppRootWindow = [UIApplication sharedApplication].keyWindow;
  54. self.respringBlur = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
  55. self.respringEffectView = [[UIVisualEffectView alloc] initWithEffect:self.respringBlur];
  56. self.respringEffectView.frame = [[UIScreen mainScreen] bounds];
  57. [self.mainAppRootWindow addSubview:self.respringEffectView];
  58. [UIView beginAnimations:nil context:NULL];
  59. [UIView setAnimationDuration:5.0];
  60. [self.respringEffectView setAlpha:0];
  61. [UIView commitAnimations];
  62. [self performSelector:@selector(respring) withObject:nil afterDelay:3.0];
  63. }];
  64. UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil];
  65. [confirmRespringAlert addAction:cancel];
  66. [confirmRespringAlert addAction:confirm];
  67. [self presentViewController:confirmRespringAlert animated:YES completion:nil];
  68. }
  69. @end