cocos2d-objc icon indicating copy to clipboard operation
cocos2d-objc copied to clipboard

UIKit references in CCDirector.h

Open slembcke opened this issue 9 years ago • 2 comments

CCDirector inherits from from UIViewController on iOS. This causes a number of complications for x-platform and should be cleaned up. We should be able to remove the UIKit.h import at that time.

slembcke avatar Jan 29 '15 01:01 slembcke

Sounds like a good idea. One thing to think about: What will be the recommended way of integrating UIKit elements in the future (e.g. presenting a UIViewController)? A bunch of frameworks, such as Game Center have a dependency on UIKit.

Ben-G avatar Feb 01 '15 19:02 Ben-G

I'm not suggesting that we remove UIView references completely from Cocos. It should actually make it easier to integrate with larger UIKit applications since you can provide your own view controller for the Cocos view. At the iOS app delegate level, things would stay pretty much the same.

The problem that this is fixing is that the director and view have a different relationship on iOS that complicates a lot of things. There are a couple of issues that we've avoided fixing because of it.

slembcke avatar Feb 01 '15 20:02 slembcke