iOS 8 App Extension and Host App in separate project files. Is it possible in Xcode 6? - ios

Currently we're using premake5 to generate our project files, as we develop multi-platform. Obviously we don't need premake to know anything about the extension (as it's iOS8 exclusive feature) but we're facing a problem: Every time we regenerate the main app project file (which happens sometimes) we're forced to manually add all the files and configure the extension, which is dull and error-prone.
Is there a way to add the app extension (a Today Widget) to a separate project? Pbxproj files aren't version control friendly as its contents seem to be shuffled every time you save. So, saving a patch file with all the changes needed doesn't seem like an alternative.
I know this is a broad question about a convenience issue, maybe seasoned Xcode devs know some trickery (or maybe it's just something obvious we're missing here).
Thanks all in advance.

Related

Transferring Xcode Project from one computer to another brings random errors?

I have a Xcode project I got from another developer. Initially when I opened it it has a bunch of errors (most of which were un-updated frameworks). I got it to work after a while and I fixed it. I want pass it back to the manager since I'm leaving uni in a few months. I copied it over to my friends Mac to see what would happen if I just took the project and all it's folders and made it a zipfile. It didn't work for some reason. It gave me an error:
error: using bridging headers with framework targets is unsupported
But why did that come up? I mean it's the same code on the slightly different versions of Xcode (13.1 versos 14.1) but I doubt there was a massive change between the two that would cause this. I want to be able to pass these app later in the future without having to care about this stuff. I made a GitHub (link below) would cloning that work? Also the laptop I chose was just a fresh reset. Would it be due to not having coco-pods installed?
I feel like I could go through and fix it all on that laptop and document that but then I'm afraid that every time I put it on a new one it would come up with random errors every single time making my documentation moot.
https://github.com/AbdullahMSaid/SonicExperiment-Works
With big help this was Fixed.
Things that fixed it.
Having the correct version of Xcode
Turning everything from absolute path to relative
Lots of other code fixes. But those are my project specific.
You don't need bridging headers in framework. Use should have something like "YourFramework.h" where you can import your .h files.

Updating .stringsdict localization files over-the-air

I'm looking for a way to update stringsdict localization files over-the-air without having to release a new version in the appStore. So ideally I want my stringdict files on a webserver, and the iOS app should download these files from the website and update the local strings.
After doing some research, I realized that we cannot update files in the bundle it was shipped in however I found some reports saying we could store/load localizations in/from the application support folder.
source #1
source #2
source #3
Can this also be applied to stringsdict files because I'm trying but no success so far.
Basically you need to create a .bundle with your new strings and make your app download it. After that, I think it's possible to create a NSBundle object using your freshly downloaded translations and swizzle a couple of methods from the main NSBundle currently used by the system.
I've tried something similar, but found out that it's much easier to integrate an existing service such as Smartling or Lokalise. They already have an SDK that allows you to update your translation over the air.
Also I found it's much easier to manage all my translations there.

How can I transform my iOS/Swift project to a state where I will be able to use live views?

I have been working on my first iOS/Swift application for the past month or so, and have created all of my class declaration files (i.e. my .Swift files) in my main project folder. I would really like to use live views in my app, because as of right now I cannot build/run the app at all due to errors I don't know how to fix (I'll be posting about those later today in hope of finding someone who can help me fix them).
What would be the best way to go about converting all of my views into embedded frameworks so that I could use the Live Views feature of Xcode ? I am running Xcode 7 and wrote my app in Swift 2.0
Thanks
You apparently don't need to use frameworks for that anymore. At least it works just fine in Xcode 7 for me - for classes that are part of the main project. Just mark your class as #IBDesignable.
But in order to show the preview, your code needs to be able compile, so you will need to resolve your issues first.

Is application bundle fully replaced on upgrade from App Store?

The following use case:
create a strings file (not localized) and deploy the application to your test device
localize the file (en.lproj or similar), make some changes to the new file and remove the original file
deploy the application on the device
What I noticed that very often (always?) the application will still use the old non-localized file. The reason is that apparently the file is still in somewhere the application bundle, even though it has been removed from the project. iOS's logic is that if a file of a specific type is looked up, it first checks in the root of the bundle for the non-localized version, and only if it doesn't find it does it go deeper into the localized folders. (Is it just me, or is this logic kind of backwards? I'm used to first looking for language specific file, and then falling back to some defaults, but it might be my Java background.)
Sometimes (always?) removing the app from the device completely doesn't help either. What does in this case is a CMD+SHIFT+K, which cleans the build folder, and after the app is built and deployed again, the correct file is used.
A worse problem would be if such a thing leads to an app crash, like some strange issues with Nibs or whatever - I have seen those as well...
The question is: what would happen if the first version of my app in the apple store had the non-localized file, and the second version localized it? When the user upgrades the app, would they get the same behavior as me during development (i.e. outdated, non-localized file used)?
I can't imagine because I think this would be a cause of a lot of grieving and bug requests, but I can't tell for sure as I haven't yet published any iOS app.
If the behavior is correct when upgrading from the store, why is it? What is so different? Are the files stored locally on my computer somewhere and used when I deploy?
Can anybody share their experiences?

Can PhoneGap be used in apps built with theos?

I want to use PhoneGap to make a Cydia app, however the iOS instructions on their website only show how to use it with Xcode.
I don't have a Mac, but I'd like to be able to make my app for Cydia, with theos. Is this possible with PhoneGap, or is it only usable with Xcode?
I've never done this, but YES it should be entirely possible. The Xcode instructions set it up for you to have a specific template with all of the phonegap files already in the proper locations. So it's easy to get going. But it doesn't do anything else that is particularly special. Theoretically you could simply setup all of the files in a theos project.
To do this you will need to 'reconstruct' exactly what goes into a phonegap template. I have no experience with theos, but a rough idea of what you will need to be able to do includes the following:
Import PhoneGap.framework
Reconstruct AppDelegate code
Import Supporting Files (PhoneGap.plist)
Additionally you will need to configure the folder structure with the www folder (that the webview loads from) including the index.html file and the phonegap-1.0.0.js file.
So yes, it should be possible. Let me know if you are successful. Good luck!

Resources