forked from trustwallet/trust-wallet-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix tinting issues (trustwallet#570)
* Fix tinting issues * Set completion in initializer * Use makeShareController func
- Loading branch information
1 parent
d18d63c
commit 2b4f545
Showing
8 changed files
with
46 additions
and
30 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright SIX DAY LLC. All rights reserved. | ||
|
||
import UIKit | ||
|
||
class ActivityViewController: UIActivityViewController { | ||
override func viewWillAppear(_ animated: Bool) { | ||
UINavigationBar.appearance().barTintColor = nil // This fixes the issue with notes | ||
UINavigationBar.appearance().titleTextAttributes = nil // This makes the text black for messages and mail | ||
} | ||
|
||
init(activityItems: [Any], applicationActivities: [UIActivity]?, navigation: UINavigationController) { | ||
super.init(activityItems: activityItems, applicationActivities: applicationActivities) | ||
// Set a default completion | ||
self.completionWithItemsHandler = { _, _, _, _ in | ||
// Set the tint globally via appearance proxy | ||
UINavigationBar.appearance().barTintColor = AppStyle.activityViewControllerNavigationBarTintColor | ||
UINavigationBar.appearance().titleTextAttributes = [ | ||
.foregroundColor: AppStyle.activityViewControllerNavigationBarText, | ||
] | ||
navigation.navigationBar.barTintColor = AppStyle.activityViewControllerNavigationBarTintColor | ||
navigation.navigationBar.titleTextAttributes = [ | ||
.foregroundColor: AppStyle.activityViewControllerNavigationBarText, | ||
] // Used to manually set the navBar tint/text back look at this for more info on why https://stackoverflow.com/a/21653004 | ||
} | ||
} | ||
static func makeShareController(url: Any, navigationController: UINavigationController) -> ActivityViewController { | ||
return ActivityViewController(activityItems: [url], applicationActivities: nil, navigation: navigationController) | ||
} | ||
} |