title: How to create Dynamic Widgets in custom function and call them in viewDidLoad?
body: <p>as i am new to iOS Developing, i was wondering how should i create a custom method to create a TextField or a button because if i place all the dynamic widget in <code>viewdidLoad</code> method, it becomes so huge and also not a good practice to place whole code in one functions.</p>
  
  <p>Here is my <code>viewDidLoad</code> method</p>
  
  <pre><code>-(void)viewDidLoad{
  [super viewdidLoad];
  self.textFiled = [[UITextField alloc] initWithFrame: CGRectMake(10.0f,30.0f,3000.0f,30.0f)];
  self.textField.delegate = self;
  self.textField.borderStyle = UItextBorderStyleRoundedRect;
  [self.view addSubView:self.textField];
  }
  </code></pre>
  
  <p>and many more dynamic widgets like this in this method. Now i tried to create a custom function to create a Dynamic TextField and call it here in <code>viewdidLoad</code></p>
  
  <pre><code>-(TextField)createDynamicTextField :(TextField *) textField{
  //Do Something Here
  }
  </code></pre>
  
  <p>I am at a loss as what should i do after here. </p>
  
  <p>Please tell me how should i create dynamic TextField  in this custom UITextField type method and call it in viewDidLoad. As it is a UITextField type function , i will return the textfield and store in the global textfield i created above</p>