Reputation: 7906
As the IBDesignable
attribute needs the designable class to be in a seperate target I created a second target which worked great in the designer. When I then tried to use the new class in my code I get the error
"Use of unresolved identifier 'CustomMarker'"
I have imported the second target in my main target -- import CustomViews
-- and I can cmd+click the target name to see the main .h file that describes the target; where the class is included. The compiler still can't find the class in my code though.
Any thoughts?
Upvotes: 0
Views: 69
Reputation: 42977
I had the same issue. Fixed this by changing access modifier of the class to public.
@IBDesignable public class MyCustomView: UIView {
}
By default classes and methods will be at internal
access level. If you want to use that out side of the target, you should mark it as public
. Then only it will be the part of public interface(visible to outside of target)
Upvotes: 1
Reputation: 56
second target must be of type "framework". you must also link it in build phases like as an external framework. link binary with libraries must have a link to your customViews framework and embed framework must have that link too.
that should be enough.
Upvotes: 0