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

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.

Related

Using Pages in iPad Playgrounds

The documentation mentions:
add pages to your playground to help organize your code.
But I’m unable to access a class from a different Page. I tried setting everything public, and even creating the class in the Sources folder by starting the playground in Xcode but it crashes on launch with Problem Running Playground
I would really appreciate some help. I’m trying to use Playgrounds more, but don’t want to have all my classes & extensions in one Page.

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

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.

Extension project templates not appearing in Xcode 6

I'm not sure if I am the only one experiencing this program, but I have tried searching and have not been able to find anyone in my current situation. I downloaded Xcode 6 beta and was interested in Extension programming for iOS 8. However, I have been unable to locate the extensions in my project templates when creating a new project in Xcode, I saw a YouTube video (unrelated to extension programming) but I did notice that the option was not there for the said video. Now, I have had a look through the contents of the Xcode 6 beta package and have been able to locate the actual templates themselves, so I have no doubt they are present, it just seems that they are not actually being loaded.
For the record, I also downloaded some example custom keyboard code from GitHub in order to see whether Xcode will recognise it and it does, going as far as actually displaying the 'E' icon beside the build target. I should also mention that I do have a build of Xcode 5 also present on my machine.
Is anyone else experiencing this issue, or does anyone know how to overcome it?
Thanks
You create a extension by creating a new target in an existing project.
Check this link for more information
I had the same problem. The solution was to not try to add the extension in File/new/File... menu but in File/new/Target... menu.
You can add extension to any existing project.

Creating an iOS library or framework using libgdx (roboVM)

Is it possible to create an iOS library or framework using libgdx (RoboVM) that can be imported into Xcode?
Background:
One of my colleagues has created a 3D visualisation app as a libgdx project for android and windows desktop. It can be compiled to run on iOS using RoboVM. However, I would like to wrap extra native user interface elements around it using Xcode. I know its possible to build the user interface programmatically via RoboVM but I would be keen to investigate if its possible to bring the existing work into Xcode. I don't need to edit the 3D visualisation component but add extra GUI elements around the 3D Vis window. I thought compiling the libgdx (RoboVM) code to a framework or library might be a solution that could be imported?!
Yes you can do it.
All you need to create a method, say initRoboVM(), This will be called by your code when you want to initialize libgdx. You'll need to pass the app path in, which you can hardcode when you're testing.
initRoboVM() will need some modifications, namely it should not call your Java app's main method, well, at least, that's what well behaving libraries should not do IMO. It should also not call rvmShutdown.
You can get further information from here
Thanks :)
I asked the RoboVM team directly. Their answer: It's not a native function, but it certainly can be done.
The complete message...
Hi,
Sorry for the late reply. This use case is not something we're going
to do now. It is possible though if you're prepared to do some
patching of RoboVM. Search the RoboVM Google Group and you should find
others who have managed to get this working.
We get this request every know and then so we will add support for
this eventually.
Regards, Niklas

xcode build settings for imported libraries (xcode 5)

I'm having a small issue with xcode (I'm assuming it's mostly due to being unfamiliar with xcode itself) and was hoping someone could lend me a hand.
I'm working with a group of people and we're using the GPUimage framework.
The problem is this:
For every person referencing GPUimage we get additional entries in the build settings for the xcode project.
For example build products path would be:
/Users/username/project/application_name/GPUImage-master/GPUimage.framework
I would rather it be:
/application_name/GPUImage-master/GPUimage.framework
The reason I want to fix this is because we need to package up our application and library together so that whoever wants to use it only needs to open the xcode project file to see what we've done (to mark it, school project).
Can anyone suggest what I should do or look for here?
Try adding the following to the beginning of the user path:
$(SRCROOT)/application_name/GPUImage-master/GPUimage.framework
That should instruct XCode to use the user path of whoever is using the library
Hope this helps!

Resources