I know it is easy to create a NIB file easily with interface builder but I was wondering if there is a way to archive an existing UIView into a NIB for use later.
It looks like a NIB file is just a special type of bundle where each of the UIView objects are archived using NSCoding but I cannot seem to find any more info beyond that. All the resources I’ve found talk about using interface builder to create the proper NIB file.
Any help would be appreciated!
I’m afraid you can’t. You can archive an
UIViewto whatever file, but you can’t use it as a nib file.You can dump the content of a nib file to an Objective-C code using nib2objc, but I guess it’s not what you want.