Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBDesignable issue and CocoaPods #28

Open
pronebird opened this issue Dec 1, 2014 · 27 comments
Open

IBDesignable issue and CocoaPods #28

pronebird opened this issue Dec 1, 2014 · 27 comments

Comments

@pronebird
Copy link
Contributor

Did you manage to make it work on IB and CocoaPods?

While properties show up in IB, they are not rendered, I get this error:

Storyboard.storyboard: error: IB Designables: Failed to update auto layout status: Failed to load designables from path (null)

@tobihagemann
Copy link
Owner

I haven't heard of this issue yet. Are you sure this is a CocoaPods issue? Are you using Xcode 6? I'm not sure where to go from here, have you tried the example project?

@pronebird
Copy link
Contributor Author

I use Xcode 6.1.1 GM. I assume it's a problem with pods but I may be wrong.
I'll re-check again. Haven't tried example project.

On Monday, December 1, 2014, Tobias Hagemann [email protected]
wrote:

I haven't heard of this issue yet. Are you sure this is a CocoaPods issue?
Are you using Xcode 6? I'm not sure where to go from here, have you tried
the example project?


Reply to this email directly or view it on GitHub
#28 (comment).

@tobihagemann
Copy link
Owner

If you still find this issue, it would be great if you could send me a minimal project example to [email protected] so that I can look into it!

@pronebird
Copy link
Contributor Author

I integrated THLabel in one of my apps but later dropped it as the idea of labels customizations has been cancelled. I'll let you know if this pops up in further when I use it next time.

@chakming
Copy link

chakming commented Dec 4, 2014

@pronebird seems the issue is related to Cocoapods: CocoaPods/CocoaPods#2792

@MuscleRumble trying the example project cannot simulate the issue. It's not using Cocoapods to use THLabel.

@tobihagemann
Copy link
Owner

Thanks for the info @chakming! :) So... I have to wait for Frameworks support?

@chakming
Copy link

chakming commented Dec 4, 2014

I guess so. At this moment, the only way to render them correctly in Interface Builder, is to import THLabel manually, instead through Cocoapods...but I still prefer Cocoapods installation haha

@tobihagemann
Copy link
Owner

Yeah, CocoaPods should be the way to go. Too bad. 😁

@pronebird
Copy link
Contributor Author

I'll check if this bug fixed in 6.1.1.

@gurgeous
Copy link

I attempted to use THLabel through cocoapods and IBDesignable didn't work. Interface Builder complained and then stopped updating the label. After that it wouldn't let me update any properties either.

Eventually I worked around the problem by moving THLabel.* into my project and commenting out IBDesignable/IBInspectable.

IBDesignable in general seems to be quite buggy, especially with Swift. Sigh. You might want to consider removing support for IBDesignable until Xcode gets its act together.

@tobihagemann
Copy link
Owner

Thanks for your suggestion @gurgeous! I've released 1.4.6 and I'll just wait with IBDesignable until it all works out. :)

@pronebird
Copy link
Contributor Author

NOOOOOOOooooooooooo! God damn it Apple, why you so broken.

@troyzhao
Copy link

oh, I have the same problem, I just drag the source code to my Xcode project and remove it from CocoaPods, it works well. I think this is a Xcode bug, Xcode can`t parse @IBDesignable class from a static lib

@Eddpt
Copy link

Eddpt commented Jan 23, 2015

This is now working with Cocoapods (0.36.1.beta.1) and by adding use_frameworks! in your Podfile. More information here.

@tobihagemann
Copy link
Owner

Thanks for the info @Eddpt! To everyone who's interested in using THLabel with Interface Builder, should follow @Eddpt's instructions and use the ibdesignable branch:

pod 'THLabel', :git => 'https://github.com/MuscleRumble/THLabel.git', :branch => 'ibdesignable'

I'll keep this issue open until the new version of CocoaPods is out of beta. And when that happens, I'll merge the ibdesignable branch into master.

@tobihagemann
Copy link
Owner

CocoaPods 0.36 is now out of beta, but I'm not sure if I should merge ibdesignable branch into master. By adding use_frameworks! to your Podfile, you have to set your deployment target to at least iOS 8. Is this correct?

@pronebird
Copy link
Contributor Author

Yep


Cheers,
Andrej

On Thu, Mar 12, 2015 at 1:10 AM, Tobias Hagemann [email protected]
wrote:

CocoaPods 0.36 is now out of beta, but I'm not sure if I should merge ibdesignable branch into master. By adding use_frameworks! to your Podfile, you have to set your deployment target to at least iOS 8. Is this correct?

Reply to this email directly or view it on GitHub:
#28 (comment)

@tobihagemann
Copy link
Owner

Hmmm... now I'm not 100% sure how to deal with this. I can think of several scenarios:

  1. Just keep the two branches and explain it in README.
    => Pro: Clean separation.
    => Con: Maintaining two branches. ;)
  2. Use __IPHONE_OS_VERSION_MIN_REQUIRED macro to check for deployment target. If it's >= __IPHONE_8_0, then activate IBDesignable features, otherwise not. ;) But this wouldn't check if Podfile is including use_frameworks! at all. Hmmm... :/
    => Pro: One branch.
    => Con: Possible confusion for deployment targets >= iOS 8.0, when use_frameworks! is not specified in Podfile.

@pronebird
Copy link
Contributor Author

What if pod built as framework you activate ibdesignable? I am sure there is some magic define for that ...

@tobihagemann
Copy link
Owner

That would be great! I've opened an issue at CocoaPods: CocoaPods/CocoaPods#3265

Maybe there is some magic. :D If not, you just gave me another idea, which I like most now: Define my own macro (which defaults to NO) to flag if the user wants to use IBDesignable or not.

@pronebird
Copy link
Contributor Author

custom define is PITA, CocoaPods should help to resolve that as it clearly impacts all of pods out there.

@x2on
Copy link

x2on commented Apr 9, 2015

Any news on that?

@tobihagemann
Copy link
Owner

Unfortunately not, I'm still waiting for feedback from CocoaPods. If you want to use IBDesignable with THLabel, you can use the ibdesignable branch as mentioned here.

@Kentzo
Copy link

Kentzo commented May 8, 2015

I confirm this issue with another view with and without the use_frameworks! flag: https://github.com/Kentzo/ShortcutRecorder/tree/cocoapods

@drekka
Copy link

drekka commented May 13, 2015

Cocoa pods 3.7.1 does NOT fix the issue if your target < iOS 8 and you cannot use use_frameworks! in any such project. So this is not a fix.

@Blackjacx
Copy link

What is the fix now for projects supporting iOS versions lower than 7?!

@tobihagemann
Copy link
Owner

Just use the master branch and you should be good to go. I must admit, I haven't tested THLabel on iOS versions lower than 7 for a while now (and am unable to), but I believe it should still work with iOS 4 and higher.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants