kstenerud / iOS-Universal-Framework

An XCode project template to build universal frameworks (arm7, arm7s, and simulator) for iOS / iPhone.
2.95k stars 474 forks source link

Adds support for compiled storyboards in embeddedframework #218

Closed ekilah closed 7 years ago

ekilah commented 7 years ago

Note: I'm aware this project is a bit abandoned, but I'm adding this PR so the issue gets some visibility and others may be able to utilize my solution for themselves (or improve it, if need be).

Tested with the "Fake Framework" approach. Xcode 7.3.1 rejects an app install when an embeddedframework built with this tool (prior to my fix) is included in the project. The error is App installation failed: Could not write to the device. The device logs complain about the symlink to the .storyboardc file being invalid as it attempts to install. The error is along the lines of [MIFileManager realPathForURL:ifChildOfURL:]: Rejecting [embeddedframework/Resources/*.storyboardc] -> ../[.framework]/Resources/[*.storyboardc], as it is points outside or to the base

Since the Resources inside the .framework file are not used, I chose to just move the .storyboardc out of the .framework and into the .embeddedframework's Resources directory (it used to symlink rather than be moved). This allows the app to install and run properly.

There may be another way to fix the symlink to iOS's liking that I don't know of - this was the first thing that worked for me.

kstenerud commented 7 years ago

It's only abandoned so far as I don't have time to work on it myself anymore, but I'll gladly accept PRs :)

ekilah commented 7 years ago

Oh, @kstenerud - yes, the PR will need cleaning if you wish to merge it, I wasn't actually anticipating a response! I will clean it up

ekilah commented 7 years ago

@kstenerud ok I cleaned that stuff up (I can squash things if/when you're happy with it to merge if you'd prefer).

let me know if/when you have time to test this out yourself to see the problem & the solution!

kstenerud commented 7 years ago

Cool. I knew that storyboards were problematic, and this looks like a good solution. Thanks!