I'm using XCode 4.5.2 to create an iOS universal application.
I'd like to use its storyboard for my application. Normally, I create new project by choosing New > Project > Single view project > check Use storyboard.
Sometimes in my application, I need to use Cocos2D for complex animation (no need to interactive with it, only for presentation).
My animation was created using CocosBuilder which works with Cocos2D 2.0 and CCBReader library.
I tried to add Cocos2D to my existing project by:
Adding Cocos2D folder (include Support, Platforms, kazmath folders).
Try thing like edit -fno-obj-arc to those *.m files in Build Phases/Compile Sources.
But when I build project, the ARC errors are still there.
#Question:
How could I implement Cocos2D into existing XCode 4.3/4.5 project?
If I create a Cocos2D template project, could I activate ARC for rest of my project, those non-Cocos2D classes?
I successfully created an project with Cocos2D inside a UIView from a Cocos2D template as Ray's post but now I want things (may be) a little more complicated.
With many help from #Setrio, #LearnCocos2D and lot of Googling, I finally fixed it.
My project is combined from Cocos2D, Storyboard, ARC enabled and CocosBuilder.
First, create a project with SingleView selection (ARC enabled of course).
Then download the Cocos2D ARC enabled here https://github.com/LearnCocos2D/cocos2d-iphone-arc-templates thanks to Steffen!
Add its libs into your project as pointed out here http://www.learn-cocos2d.com/2012/04/enable-arc-cocos2d-project-video-tutorial/ (brilliant, works like charm)
Create storyboard with Cocos2D as this tutorial (sample included) http://www.tinytimgames.com/2012/02/07/cocos2d-and-storyboards/
All things work together now. Beautiful. I love Cocos2D :)
I don't know off the top of my head.
Yes, I have done this very thing with my latest Cocos2D-iOS project. I converted my project to ARC with the automatic refactoring tool, and I simply excluded all the Cocos2D library files from the process. for the most part the refactoring went smoothly and my project was up and running again in no time.
I found this link/tutorial useful for a project similar to this one.
http://www.tinytimgames.com/2012/02/07/cocos2d-and-storyboards/
Basically you add support for cocos2d inside the view controllers. You have to use cocos2d as a library and that solves most of the issues.
Related
I have a basic understanding of how to make iOS apps with Swift in Xcode Projects (I can make apps like flappy birds and an adapted variation of pong). My main target for this year is to be able to at least apply for the Apple WWDC student scholarship. I have read online that the scholarship submission needs to be completed and uploaded in Swift playgrounds.
As I am self-taught, I have little to no experience with Swift playgrounds. So my main question is: how do I make an application in playgrounds? I am used to beginning with a main.storyboard, but I can't find that in Swift playgrounds.
How do you go about creating an interactive application in Swift playgrounds?
You cannot use storyboards directly in a playground, which is why Xcode doesn't support creating a storyboard inside of a playground. You can access a framework from a storyboard inside of a workspace (including cocoapods), so one solution is to make a framework to load your storyboards. This doesn't seem to fit with your criteria of making everything in playgrounds though. So you can either make all of your view programmatically or you can drag in compiled nib files to your Playground Resources folder and load the nibs from there (the playground cannot load xib, which is the XML representation of the nib).
Environment
OS: OS X Yosemite Version 10.10.3IDE: Xcode Version 6.3.1
Precondition(s)
Project created as Single View Application.
XCode configuration
state is in the default state (same as when initially downloaded).
Problem
This problem is less about source code in that it pertains in part to the IDE tool. XCode offers this feature to design UIs and workflows in an interface builder called Storyboards. Every Storyboard has a scene, and from videos of XCode 5+, it appears you can drag these scenes around to organize them along with the segues. For my IDE instance, I can drag-n-drop scenes from the Object Library into the editor, but once there, I can no longer adjust or move them around. The scenes appear "pinned" to the editor. This results in scenes overlapping one another. Basically, I have a ball of scenes in the middle of my editor currently.
Research Background
I have spent the better part of the day exploring XCode for ways to enable adjustments and/or googling. Googling this issue has not helped as XCode documentation seems to assume this is intuitive and works out-of-the-box (which is how it should be IMO). Results for developers having issues with dragging-n-dropping objects/scenes into the editor seems to be more common so any results for this, if any, gets eclipsed.
Questions
So I have the following questions:
Is there a switch or configuration that I have somehow missed in XCode that essentially "unpins" these scenes from the editor?
Or is it a bug/new feature that has either a workaround/new concept to apply/learn?
I'm currently working on a project that is being developed without using a single XIB and it is a huge project. We are gonna release a new version by changing the user interface. It require for me to build a Slider Menu like we find in facebook app. I have plenty of sample coding which do it and every project uses Storyboard to set it up. My question is,
Is it possible to develop that without using Storyboard?
Thanks.
The below links might help you :
https://github.com/stefanoa/SASlideMenu
https://github.com/mikefrederick/MFSideMenu
Have a look to the following link:-
https://github.com/Inferis/ViewDeck
This is one of the best slide menu example code I have used.
I literally have been pulling my hair out over this for a few days now. I am simply trying to implement Cocos2D into my UIKit app but I am not sure which files I need. I know to download it from http://www.cocos2d-iphone.org/ so I did, I open up the cocos2d-ios .xcodeproj but I have absolutely no idea which files to drag into my to properly implement it in my app.
I really need help with this!!!!
Thanks,
MyApps
You need to copy the entire cocos2D library into your project (all the files from the unarchived download).
You can then #import "cocos2D.h" into your view controller and assign your EAGLView (create one in the view controller if your project doesn't have one already) to cocos2D
(eg: [[CCDirector sharedDirector] setOpenGLView: glView];)
I know it's a bit backward, but it might be easier to create a template cocos2D project and from there migrate your existing files to the new project (your mileage may vary depending on how complex your existing project/build is).
I have downloaded the latest cocos2d from their site, and I have unzipped it. Now I am confused exactly how to implement it into an already existing project. What files do I drag over and is there anything else I have to do besides that?
Thanks!
You can link cocos2d into your project as shown here. He uses a special version that supports arc, but it works in exactly the same way with the original version. Then in a next step make sure that you import all the important libraries:
QuartzCore.framework
OpenGLES.framework
AVFoundation.framework
UIKit.framework
Foundation.framework
CoreGraphics.framework
If you use sound you also will need:
OpenAL.framework
AudioToolbox.framework
libcocosDenshion.a
Now you need to set up a rootview that supports OpenGL. Look at the Hello World example how they did this there. You should now be able to implement and display Cocos2d scenes on screen.
Here straight from the source:
Cocos2D tutorial