title: swift4: TableView setSelected function called twice on iPad click
body: <p>I am new in swift4 and this is my first table view implementation.</p>
  
  <p>I am using iPad for developing application and I can not resolve issue that table view setSelected function is called twice on click and always selected value is equals to true</p>
  
  <p>As I saw in Web such behavior is only on <a href="https://stackoverflow.com/a/31836542/556526">iPad</a></p>
  
  <p>So what is workaround fir this issue</p>
  
  <p>My code is:</p>
  
  <pre><code>@IBOutlet weak var checkImage: UIImageView!    
  var showing = false
  
   override func setSelected(_ selected: Bool, animated: Bool) {
  
          super.setSelected(selected, animated: animated)
          if selected {
              if showing == false {
                  checkImage.isHidden = false
                  showing = true
              }
              else {
                  checkImage.isHidden = true
                  showing = false
              }
          }
      }
  </code></pre>