Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How build a custom control in Xcode for the iPhone SDK?

I want to build a custom control to reuse in my project which consists of two UITextFields that are linked together + a label.

It is starting to become repetitive across my App and smells of code duplication ;)

However, I wonder what is the best aproach here.

Is it best do everything by code in a controller or is posible do a visual thing like the ones built-in in Xcode?

like image 269
mamcx Avatar asked Jan 31 '09 20:01

mamcx


People also ask

How do I create a custom control in Swift?

In the storyboard, open the Assistant editor; it should display ViewController. swift. To create the outlet, click the Knob and control-drag it right underneath the animateSwitch IBOutlet . Release the drag and, in the pop-up window, name the outlet knob then click Connect.

Which SDK is used for iOS?

The central component of the iOS SDK is Xcode, Apple's interactive development environment (IDE). Xcode facilitates building apps for OS X, iOS and WatchOS. Xcode includes the interface, the LLVM compiler, instruments and iOS simulator tools that make development and testing possible without an Apple device.


1 Answers

You can build an Interface Builder plug-in for this. It's fairly straight-forward. To get started, read the Interface Builder Plug-In Programming Guide. It even has a quick, step-by-step tutorial to get you started. Apple recommends creating a plug-in to IB for just your case...

like image 53
Jason Coco Avatar answered Oct 19 '22 14:10

Jason Coco