Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override Navigation Bar Appearance #59

Open
ragaie opened this issue Sep 7, 2022 · 2 comments
Open

Override Navigation Bar Appearance #59

ragaie opened this issue Sep 7, 2022 · 2 comments

Comments

@ragaie
Copy link

ragaie commented Sep 7, 2022

	This code  Override the navigation bar appearance on all app which cause an issue when we open SDK and close it.
	The navigation bar changed on all apps.
	
	Please take look at this part and find another way to get your navigation controller and adjust it not all the navigation bar of all app.
	
	// what we have done we just set the navigation bar again after closing SDK, when I deleted this part also app worked fine.
	
	// Override the navigation bar appearance from iOS 15
	if #available(iOS 15.0, *) {
		let navigationBarAppearance = UINavigationBarAppearance()
		navigationBarAppearance.configureWithDefaultBackground()
		UINavigationBar.appearance().standardAppearance = navigationBarAppearance
		UINavigationBar.appearance().compactAppearance = navigationBarAppearance
		UINavigationBar.appearance().scrollEdgeAppearance = navigationBarAppearance
	}
@lipka
Copy link
Contributor

lipka commented Sep 26, 2022

Thank you for filing this issue. It seems your ticket was incorrectly formatted and the link to "this code" seems to have gotten lost. Could you please share which specific code you were referring to?

@pbodsk
Copy link

pbodsk commented Nov 15, 2023

I noticed this issue...oddly enough because I was having similar issues 😉

I think the issue raised here is that we have no way - out of the box - to control the navigation bar of the Tink view (that is the issue I'm facing right now at least).

When I call createReport(configuration:market:locale:sessionID:inputProvider:inputUsername:completion:) I get a view back with this topbar

Topbar

And no way to control if I want a close button at the top or how that should look.

What @ragaie mentions above - I guess (apologies in advance if I'm butchering your intent 😄) - is that we can use something like what he suggests:

// Override the navigation bar appearance from iOS 15
if #available(iOS 15.0, *) {
    let navigationBarAppearance = UINavigationBarAppearance()
    navigationBarAppearance.configureWithDefaultBackground()
    UINavigationBar.appearance().standardAppearance = navigationBarAppearance
    UINavigationBar.appearance().compactAppearance = navigationBarAppearance
    UINavigationBar.appearance().scrollEdgeAppearance = navigationBarAppearance
}

But that is a bit of a sledgehammer as it will change the appearance of all UINavigationBars in the app and that is not what he is interested in.

You can also do something a little less drastic, like so for instance:

let navigationBarAppearance = UINavigationBarAppearance()
navigationBarAppearance.configureWithDefaultBackground()

let navCtrl = Tink.AccountCheck.createReport(
    configuration: configuration,
    market: viewConfiguration.market,
    completion: viewConfiguration.onTinkFlowCompleted
)

navCtrl.navigationBar.standardAppearance = navigationBarAppearance
navCtrl.navigationBar.compactAppearance = navigationBarAppearance
navCtrl.navigationBar.scrollEdgeAppearance = navigationBarAppearance
navCtrl.navigationBar.tintColor = .lightGray

Which gives us this
Topbar styled

But still..it would be nice with more control over how that topbar should look.

I hope you can help us (me) out here 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants