tombenner / nui

Style iOS apps with a stylesheet, similar to CSS
MIT License
3.76k stars 461 forks source link

Not able to run it without using CocoaPods #358

Open P-Panayotov opened 8 years ago

P-Panayotov commented 8 years ago

Hi there, being trying to run NUI manually as a module of my main project. I have followed the instructions, but no mater what I tried it just didn't work. I am trying to avoid using CocoaPods as we use Carthage in our project currently and this will mess everything up. Any chance you make NUI work with Carthage as well?

I am getting 'NUIParse.h' file not found error in NUIDefenition.h here

#if __has_include(<NUIParse/NUIParse.h>)
#    import <NUIParse/NUIParse.h>
#else
#    import "NUIParse.h"
#endif

when I try to build the project and I can't get around it.

caiodias commented 8 years ago

I had the same result when I removed the CocoaPods elements.

Stunner commented 8 years ago

This issue seems awfully similar to #355.

Yeah, as soon as I get some free time I'll look into getting NUI on Carthage.

P-Panayotov commented 8 years ago

Just ended up doing a work around with CocoaPods. If someone else is looking at the same issue here is my solution.

In your project create a podfile with the following content:

platform :ios, '8.0'
use_frameworks!

target "NUI" do
  pod "NUI"
end

then run pod install --no-integrate this will build the project with CocoaPods. As you noticed there is --no-integrate flag which basically tells CocoaPods to build the project but not to create the Workspace. Open the Pods folder in your project and drag Pods.xcodeproj file in your project navigator. Add Pods_NUI.framework in Linked Frameworks and Libraries in your project and last just #import <NUI/NUISettings.h> in your bridging header and Voala :) it's all working and you can use it as a module in your project avoiding the Workspace hassle.

caiodias commented 8 years ago

Interesting approach @PanPanayotov. However, Cocoa Pods doesn't have this install option. https://guides.cocoapods.org/terminal/commands.html#pod_install

And you're using Cocoa Pods.

Stunner commented 8 years ago

They moved it to be a specification inside of the Podfile for 1.0: https://github.com/CocoaPods/CocoaPods/issues/5240#issuecomment-216445173