robreuss / VirtualGameController

Software-based game controllers for iOS, tvOS, OS X and watchOS in Swift 4.2.
MIT License
462 stars 44 forks source link

CocoaPods Integration #12

Closed ClintChil closed 8 years ago

ClintChil commented 8 years ago

Where is CocoaPods support in your roadmap? I saw it is forthcoming from the Read Me file.

I'm struggling to implement this framework in my project in a clean way that allows for easy updating. Do you have any tips for integration? Thank you for all of your work on this project!

robreuss commented 8 years ago

Hey Clint. Not sure when I'll get to CocoaPods - don't have any experience with creating pods, so will need to learn. In the meantime, I suggest the following: clone VGC and keep it separate from your project - you'll see a set of projects in a folder called "Framework Projects", one for each platform. If you drill down on any one of those, into the "Products" folder, you'll find the framework files that get generated when you build the project. You can drag that into your project, and rather than copying it, just set up a reference to it. That way when you pull updates to VGC, all you need to do is rebuild the frameworks. Let me know if I can help more!

ClintChil commented 8 years ago

Thanks! That will work. I added this repo to my project as a git submodule and made the references like you said.

I'm not experienced with CocoaPod creation either but hopefully this issue will attract a guru who can help. :+1:

robreuss commented 8 years ago

A couple of things to consider with the submodule approach (you probably already know these, but just in case):

jakubknejzlik commented 8 years ago

https://cocoapods.org/?q=virtualgamecontroller :)

ClintChil commented 8 years ago

Wow! That was fast. I'll give it a shot. Thank you.

jakubknejzlik commented 8 years ago

Well, I created it few weeks ago. It's tested on iOS and tvos. OS X should be fine too

robreuss commented 8 years ago

Thanks Jakub!

ClintChil commented 8 years ago

I was able to test iOS to tvos this morning. CocoaPods integration works very well!

At first I ran into an issue with my iOS peripheral not connecting. It didn't take me long to realize it was caused by my iOS_peripheral app being out of date. Easy fix. Thanks Rob & Jakub!

kajensen commented 8 years ago

I'm running into issues getting this to work with cocoapods... Just trying to get essentially the sample project with tvOS central and iOS peripheral working. I'm no cocapods guru, but have spent some time trying to get it work to no avail. I am trying to get a workspace with both tvOS and iOS projects and cocoapods, maybe thats the issue? screenshot: http://puu.sh/me7Rx/2e7a2f5a5d.png

The error that seems to be the main one is: "Umbrella header for module 'VirtualGameController' does not include header 'VirtualGameControllerIOS.h'" (not sure what that means.. but the issue is with my iOS project- tvOS compiles and runs) EDIT: this warning is not cocoapods related..

Also, why are things like vgcCentralViewController.swift and vgcCustomElements.swift included? Seems like those are highly customizable and should be done outside of the framework

In the meantime I'm probably just going to use projects and frameworks like the samples because that seems like the intended way. Anyways great lib, excited to work with it!

robreuss commented 8 years ago

I haven't tested the CocoaPods implementation yet myself, nor am I a guru either. I test by cloning.

I recommend you clone the project. You should be able to build both the tvOS Central sample and the iOS Peripheral sample. You can then drag the framework subprojects you need into your project, and it should automatically include them by reference (rather than copying) which will enable you to do subsequent pulls of the latest code without having to copy it in again, etc.

You’re right about vgcCentralViewController.swift and vgcCustomElements.swift - in fact, those are not compiled into the framework currently. That’s why they appear in a folder called External, and are not added to the framework projects. They are only added to my sample projects. You only need to have vgcCustomElements.swift in your project - vgcCentralViewController.swift is just code that is shared among my Central sample projects.

Let me know if it gives you any more trouble, or if I can help in any way!