2

I have a viewA is loaded from Xib. My question is that how to subClass this viewA.

Every time when the my SubClass inited, and call [super init], it will return [viewA class].

Similar situation happened in Storyboard, when I want to subClass a viewController which loaded from Storyboard.

JerryZhou
  • 4,566
  • 3
  • 37
  • 60
  • 1
    do simple subclass and then in storyboard builder select view you want "subclass" and change its type by: select identity inspector (view on the right, third icon) and in `class` text field type desired class name. – Marek R Apr 08 '15 at 07:46
  • @MarekR this will change the original View. Actually I want both the original View and the sub view can all load from the original Storyboard, and I will add some special logic for the subClass one. – JerryZhou Apr 08 '15 at 07:50
  • 1
    JerryZhou, welcome to our community of devs which are waiting for XIB subclass feature ;) http://stackoverflow.com/questions/18564729/subclassing-a-uiview-subclass-loaded-from-a-nib , http://stackoverflow.com/questions/5547649/subclassed-uiview-from-nib-file-not-typed-to-subclass, http://stackoverflow.com/questions/25334007/subclassing-a-custom-collection-view-cell-created-from-a-nib ... – brigadir Apr 08 '15 at 08:41
  • @brigadir thanks. Sad to just wait. – JerryZhou Apr 08 '15 at 11:04

0 Answers0