How much legacy Objective-C code can Hyperloop work with? - appcelerator

Hyperloop looks like an exciting way forward for Appcelerator. I've read the very basic Hyperloop docs and watched the intro video. In the intro video I can see that simple Swift or Objective-C files can be used,
I'm interested to find out how much of an exisiting Swift/Objective-C codebase could be dropped into a Hyperloop project?
Could we for example, take an entire project written in Swift/Objective-C and work on it using Hyperloop?
Does anyone have any hands on experience?
Cheers!

You can potentially use a lot of the code but you can't (today) easily drop in a full xcodeproject without a bit of work.
If you look at the example iOS project that comes alongside Hyperloop (http://labs.appcelerator.com/project/55f74a9f421c44837717716b/Hyperloop-Module) you can see some drop in examples of both swift and objective-c code.

I recommend looking at the examples at Loop Modules since they provide a lot of how-to for using Swift-Objective C in Hyperloop. From my own experience, you can't drop and drag a current X-Code project, every piece that is integrated into Hyperloop works as a module (they call it framework, but for me it is a module) which needs to be adapted to be used inside Titanium.
My personal experience, with enough tinkering (or knowledge) you can integrate any native Swift-Objective C component you want. I even went as far as compiling source C and integrating that in Hyperloop and calling the functions in that with C as well.
Currently I'm using Javascript, Swift, Objective-C and C in the same project and it works great so far :)
Also the latest documentation from Appcelerator is here
Another good news is Hyperloop is now available to the free Indie program at Appcelerator.

Related

Where is the Swift CocoaTouch documentation?

I imagine the Swift language has gotten the attention of a boatload of iOS programmers - many of whom never wrote a single line of Objective-C in their life.
For example I have dozens of apps on the app store, written in Titanium.
In the Titanium world every property and event available is documented, for example like this for UILabel:
http://docs.appcelerator.com/titanium/3.0/#!/api/Titanium.UI.Label
Is there an Apple equivalent? I read the Apple iBook on Swift - it discusses the core language, it doesn't list out the methods available in the Cocoa touch framework, and leaves it to the programmer to intuitively guess based on their Objective-C experience.
Is that a fair assessment, that that you have to learn Objective-C first and then use that as a bridge language to Swift - or is Swift intended to be stand-alone? If so, where is the documentation of Cocoa Touch, in swift?
The documentation is included in Xcode6 (or can be downloaded). You can currently access it by going to Window -> Documentation and API Reference. (or by pressing shift, command & 0)
You will then have full access to search and find resources here. You can also option click on something in Xcode to pull up the docs for that specific thing.
As you will see it shows you the declarations for Obj-C and Swift together. This technically isn't Swift documentation (it is the iOS8 library documentation) but it should be similar to what you were looking for.
Note: this post originally included screen shots but I removed them as developers are not supposed to post screen shots of pre-released software.
The Cocoa Touch APIs and frameworks are the same between Swift and Objective-C. There are only minor syntax differences used when you call the APIs. The framework documentation is currently pre-release, so if you aren't a registered developer then you can't see it yet.

Common coding language for Sphero developers?

I just discovered Sphero and I love this little ball, so I want to develop apps!
Is there a common coding language that most of Sphero's app developers use so that I can learn it and start building?
From glancing over this page http://developer.gosphero.com. You can use Java for developing on the Android platform and Objective-C for iOS. Looks like there is also a plugin for Unity that uses C#.
That webpage also contains guides for the individual platforms and examples.
You could also use ruby with artoo framework: http://artoo.io/documentation/platforms/sphero/ or javascript with cylon framework: http://cylonjs.com/documentation/platforms/sphero/ or even go, with gobot.io/documentation/platforms/sphero/ framework too.
If you want to use Python, there are 2 options beyond the ROS Python plugin currently listed on the developer page.
SpheroNav
SpheroNav was written by Simon Nistad for his master's thesis in 2014, designed to support the control of multiple Spheros. I have forked his code, and will be extending it in upcoming months.
https://github.com/hydrosquall/SpheroNav
Kulka
This is a project by Karol Szuster, aimed at new programmers. Unfortunately I wasn't able to get his example code to work on my windows laptop, but maybe you'll have better luck.
https://github.com/zdanowiczkonrad/PythonSphero

Languages in XCode

I'm just about to start learning how to program using XCode. I've had Java lessons in my school for half a year now, and will continue with that for the next 2 years.
As far as I've looked into XCode, it looks like it just uses Objective C, which at my brief first sight, looks pretty different from Java syntax-wise.
Look at C at the other hand, looks a lot more like Java.
Now I am wondering, is it possible to write iOS applications in C using XCode? It definitely would easen up my learning curve not having to learn a whole new syntax on top of a new language.
Edit: If it is indeed possible, would there be any disadvantages in using C instead of the (seems encouraged?) Objective-C?
First of all welcome in XCode.
XCode is just an IDE. Now it is on you, whether you want to learn iOS or MacOS Applications.
And I would suggest you if you have a good knowlegde of C, then have some knowledge on Object oriented language like C++ or Java. Then you will feel comfortable with Objective-C.
Objective-C is a language, superset of C, so not much to think only one day learning is required to see the changeover from C to Obj-C.
And Obj-C language makes framework called "Cocoa" which is the core for ios and mac based development. This will take some time, but mind you, you will get thousands of API, which are easier to use and remember than what you will make and use from 'C'.
You can refer many sites, I would like to share my learning process with you.
You can follow these, even I started learning with these sources.
Stanford lectures CS193
Lynda's Videos
Cocoa Programming for Mac OS X by Aaron Hillegas
Cocoadevcentral.com
Last one is of course Stack Overflow... This is the best place to sort out all your doubts.
You can effectively write most of your app in C but when you interact with the iOS SDK, the part that communicates with the device, you will need to use obj-c. Objective-c isn't hard to learn really, don't feel daunted about it.
You definitely can write code in C. Objective-C is a C language wrapped by defines.
However, I'd recommend to learn Objective-C. This allows you to write code using Object Oriented principles. There are numerous online tutorials for this.

Cinder or pure OpenGL for iOS development

As im quite new to obj-C but on the other hand a common user of CPP and ANSI C, im a bit out of my comfortzone working with obj-C.
So people might ask, why i dont learn obj-C? Id love to learn it, but unfortunately im in a very tight schedule due to my uni project i would like to get as much working as possible.
I have worked a little with obj-C and run through tutorials, but i dont see myself being capable of creating big amounts of precious code as i would with CPP.
Yesterday i got familiar with Cinder framework and tried out some examples, which resulted in quite rapid results, especially with OpenGL and math libraries.
What bothers me right now is the capability of working with the XCode interface builder and binding the storyboard or xib files to the project.
Is there a creative way to combine the great GUI with Cinder in XCode, or am i "forced" to go back to pure obj-C and my libraries?
Thanks.
Have you looked into any of the frameworks built using other languages you may be more comfortable with that are specifically designed for iOS (and Android) game and app development?
ImpactJS - http://impactjs.com/
Corona SDK - http://www.anscamobile.com/corona/
The key features with these as well is that you write your code once and it works across multiple platforms, and may be easier and quicker for you if you know JavaScript or Lua (and the learning curve is smaller on these languages typically anyways).

Tutorials for Writing Common Code for use on Windows, OS X, iOS, and potentially Android

I'm looking at writing an application that I would like to use on Windows, OSX, and iOS (maybe pushing into Android if other people want to use it). I want to duplicate as little work as possible and I'm having a hard time finding information on the best way to do this.
From what I've found so far I can't use a framework like QT because iOS doesn't support QT so it looks like I'm stuck recreating the interface for each target. I'm looking at writing the business logic in C++ because it seems to be supported by the native tools (Visual Studio and xCode).
Has anyone had experience with a setup like this and if so can you point me towards a good reference for this kind of development?
Really there it not a lot of choice right now. Qt is certainly coming to iOS and WP7 so C++ is a good solid evolving platform.
However there is also the mono project which offers C# across platforms.
http://xamarin.com/monoforandroid
From my understanding, you write in c# and it compiles to the platforms preferred language.

Resources