Last active
December 7, 2016 12:50
-
-
Save hammadzz/02bdd2c0656529c371e0be1af521f248 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Put this line in application did finish launching | |
[[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], nil] setTintColor:[UIColor whiteColor]]; | |
[[UIBarButtonItem appearance] setTintColor:[UIColor whiteColor]]; | |
//Another option | |
//Also use this to prevent to Cancel button text on the popup to disappear | |
[activityController.view setTintColor:[UIColor redColor]]; | |
//What is this | |
[[UINavigationBar appearance] setBarTintColor:[UIColor whiteColor]]; | |
//THis works too | |
UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:applicationActivities]; | |
activityViewController.excludedActivityTypes = @[UIActivityTypePrint, UIActivityTypeCopyToPasteboard, UIActivityTypeAssignToContact, UIActivityTypeSaveToCameraRoll, UIActivityTypeAddToReadingList, UIActivityTypePostToVimeo, UIActivityTypePostToFlickr, UIActivityTypeAirDrop]; | |
[activityViewController setCompletionHandler:^(NSString *activityType, BOOL completed) { | |
// back to normal color | |
[[UINavigationBar appearance] setBarTintColor:AAColorInputBorder]; | |
[[UINavigationBar appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: | |
[UIFont fontWithName:@"Avenir-Medium" size:18], NSFontAttributeName, | |
[UIColor whiteColor], NSForegroundColorAttributeName, | |
nil]]; | |
}]; | |
[self presentViewController:activityViewController animated:YES completion:^{ | |
// change color temporary | |
[[UINavigationBar appearance] setBarTintColor:[UIColor whiteColor]]; | |
[[UINavigationBar appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: | |
[UIFont fontWithName:@"Avenir-Medium" size:18], NSFontAttributeName, | |
AAColorInputBorder, NSForegroundColorAttributeName, | |
nil]]; | |
[activityController setCompletionWithItemsHandler:^(NSString * __nullable activityType, BOOL completed, NSArray * __nullable returnedItems, NSError * __nullable activityError) | |
{ | |
//Your Code goes here | |
// [[UIBarButtonItem appearance] setTintColor:[UIColor blackColor]]; | |
}]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment