Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display Custom View in Interface Builder

I have an objective-c custom view, I marked it as IB_DESIGNABLE and I got error in the storyboard:

MainStoryboard_iPhone.storyboard: error: IB Designables: Failed to update auto layout status: dlopen(example.app, 1): no suitable image found. Did find: example.app: mach-o, but wrong architecture

and another one:

MainStoryboard_iPhone.storyboard: error: IB Designables: Failed to render instance of CustomView: dlopen(example.app, 1): no suitable image found. Did find: example.app: mach-o, but wrong architecture

I am working on Xcode 6.1 beta. I tried to make a framework as described in the WWDC session 411, but I got same error.

any idea, what's missing?

like image 553
Noura Avatar asked Sep 15 '14 16:09

Noura


People also ask

How do I add a custom view in ViewController?

Open the storyboard. Drag and drop a Custom View onto the view controller scene. Under the identity inspect, set the class name to TestView.

How do I create a view in Swift?

Choose File > New > File to open the template selector again. In the User Interface section, select “SwiftUI View” and click Next. Name the file CircleImage.swift and click Create. You're ready to insert the image and modify its display to match the desired design.

What is Xib in Swift?

NIBs and XIBs are files that describe user interfaces, and are built using Interface Builder. In fact, the acronym "NIB" comes from "NeXTSTEP Interface Builder", and "XIB" from "Xcode Interface Builder".


2 Answers

Valid Architectures: arm64

you should add arm64 to Valid Architectures. Designables need it!

like image 92
corichen Avatar answered Oct 17 '22 01:10

corichen


Adding arm64 to to Build settings->Architectures, cleaning and deleting derived data worked for me.

like image 42
Jelly Avatar answered Oct 16 '22 23:10

Jelly