meismyles / SwiftWebVC

A drop-in inline browser for your Swift iOS app.
MIT License
330 stars 117 forks source link

Title not centered #25

Closed marbetschar closed 7 years ago

marbetschar commented 7 years ago

Seems like the title of subpages is not always centered. If I open the viewController as follows and navigate back and forth in the pages, sometimes the title is aligned left, instead of center (see screenshot below: Kontakte title in bar on top).

UINavigationController(rootViewController: SwiftWebVC(urlString: "https://mandelkind.help/valletti"))

simulator screen shot 26 06 2017 21 12 53

marbetschar commented 7 years ago

Any Ideas how to fix this?

meismyles commented 7 years ago

Not sure why this is occurring without looking properly as it should be calling sizeToFit() on the title label after setting its text value.

However, one quick fix you could do is add the following line into SwiftWebVC.swift until I can push a fix into the live version:

navBarTitle.textAlignment = .center

at line 134 - immediately following this line:

navBarTitle.font = UIFont(name: "HelveticaNeue-Medium", size: 17.0)

Let me know if this solves it for you in the short term. Cheers 👍

marbetschar commented 7 years ago

@meismyles I've installed SwiftWebVC as Carthage module and can't see any possibility to add the fix you mention:

Trying to set the property from the external calling code results in 'navBarTite' is inaccessible due to internal protection level and trying to subclass SwiftWebVC results in Cannot inherit from non-open class 'SwiftWebVC' outside from it's defining module.

Can you please push a new version containing the fix? That would be awesome!

meismyles commented 7 years ago

Going to try and get all the open issues in the tracker looked at this weekend and fixes pushed for them. Hopefully on Sunday.

marbetschar commented 7 years ago

@meismyles any news? :)

meismyles commented 7 years ago

Sorry, super busy at the moment. Fixes are in progress, hopefully not too long.

marbetschar commented 7 years ago

Alright! Glad to hear; keep things rollin! 🚂