Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Conversation

@jtreanor
Copy link
Contributor

@jtreanor jtreanor commented Apr 5, 2019

In #67, as part of converting to a static framework, I moved images and assets to WordPressAuthenticatorResources.bundle. .storyboard and .xib files remained in the main bundle.

This mostly worked fine for WordPress-iOS, but has proved to be problematic in some cases there and in all cases for WooCommerce-iOS. Image references in storyboards were not resoving, with errors like this:

2018-12-11 09:21:31.650079-0800 WordPress[91387:1155878] Could not load the "beveled-blue-button-down" image referenced from a nib in the bundle with identifier "org.cocoapods.WordPressAuthenticator"

Fixes #38.

The solution I have implemented is as follows:

  • Move .xib and .storyboard files into the resource_bundle. This means images will be loaded from the same bundle and it will find them correctly.
  • Rename WordPressAuthenticatorResources.bundle to WordPressAuthenticator.bundle. This is a surprising quirk of CocoaPods to ensure they are all in the same target. More info here.
  • Related code changes to load the right bundle. It's simpler now.

To test:

  • Point WordPress-iOS to this branch (I have made a branch here to save some effort).
    • Smoke test the login flow, making sure images are loaded correctly.
  • Point WooCommerce-iOS to this branch (I have made a branch here to save some effort).
    • Smoke test the login flow, making sure images are loaded correctly.

@jtreanor jtreanor requested review from a user and mindgraffiti April 5, 2019 09:12
Copy link
Contributor

@mindgraffiti mindgraffiti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This worked perfectly for Woo. Thank you @jtreanor!

@jtreanor
Copy link
Contributor Author

jtreanor commented Apr 5, 2019

That's great, thanks @mindgraffiti!

I have tested WordPress-iOS quite thoroughly with this and I'm satisfied that all is well now so I'm going to go ahead with the merge.

@jtreanor jtreanor merged commit c2ff8ec into develop Apr 5, 2019
@jtreanor jtreanor deleted the resources-fix branch April 5, 2019 14:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants