title: Call selector from nother class - Swift 3
body: <p>I'm creating an UIbutton from "Utils_class", and return it to my "getBtsDetails" class.
  I successfully achieve to call "buttonAction" function implemented into "getBtsDetails", but then it return an error </p>
  
  <blockquote>
    <p>"Unexpectedly found nil while unwrapping an Optional value"</p>
  </blockquote>
  
  <pre><code>getBtsDetails :
  
  let Utils_Class = Utils()
  var labelY : Int = 90
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
      WS_Class.GetDiplomaSubject(id: Int(self.BTS_id)!) { number, responseObject, error in
          if((error) == nil) {
  
              #let's create an UIbutton from Utils_class which gonna call the buttonAction below
  self.scrollview.addSubview(self.Utils_Class.createButton(text: "Calcul", buttonY:self.labelY+30))
              self.scrollview.contentSize.height = CGFloat(self.labelY+40)
          }
      }
  }
  
  @objc func buttonAction(_ sender:UIButton!)
  {
      #the error occurs here
      print(self.Utils_Class.getTextFields(view : self.scrollview)/1)
  }
  </code></pre>
  
  <p>And my second class, Utils :</p>
  
  <pre><code>public func createButton(text: String!, buttonY: Int!) -&gt; UIButton {
      helpClasses = GetBTSDetails.init()
      let button = UIButton(type: UIButtonType.system) as UIButton
      button.frame = CGRect(x:0, y:buttonY, width:self.screenWidth/5, height:15)
      button.backgroundColor = UIColor.lightGray
      button.setTitle(text, for: UIControlState.normal)
      button.tintColor = UIColor.black
      button.addTarget(btsClasse, action: #selector(btsClasse.buttonAction(_:)), for: .touchUpInside)
  
      return button
  }
  
  var btsClasse: GetBTSDetails!
  </code></pre>