Using CocoaPods and @IBDesignable together
Asked Answered
V

3

10

I have a project using @IBDesignable to control view properties from the Storyboard and everything is working correctly. However, if I integrate pods and add the bridging file as described here (https://medium.com/swift-programming/swift-cocoapods-da09d8ba6dd2) the Storyboard no longer displays correctly. It displays a blank view in the place where I had my custom view with @IBDesignable. The pods work correctly, just I can't see my changes in the Storyboard. Reverting my changes and removing the pods, solves the issue?

Is there anyway to use CocoaPods and @IBDesignable together, or is this just a bug in Xcode6?

Villager answered 12/6, 2014 at 11:8 Comment(1)
Still a problem in Xcode 8.3.3. Added CocoaPods (Alamofire) breaks my @IBDesignable code (stuff that is not even dependent on Alamofire).Carsick
S
0

Have you tried to set the proper module name to your custom view in the storyboard?

org.cocoapods.XXX

enter image description here

if you have only XXX works but adding org.cocoapods. fixes a lot of issues.

Swaim answered 27/10, 2016 at 14:31 Comment(0)
H
-1

If you don't want to support iOS versions below 8.0, you can have use_frameworks! in your pod file (as mentioned here http://guides.cocoapods.org/syntax/podfile.html#use_frameworks_bang). What happen here is instead of making static libraries for your dependencies cocopods will make frameworks. IBDesignable will not break with frameworks.

Hammy answered 22/8, 2015 at 4:15 Comment(0)
S
-4

Try opening using xcodeproj instead of xcodeworkspace. That worked for me.

Strafford answered 30/8, 2014 at 13:48 Comment(1)
That's not a solution, since you use the Workspace when using CocoaPods.Danikadanila

© 2022 - 2024 — McMap. All rights reserved.