title: Swift 3.0: "objc_setAssociatedObject" issue
body: <pre><code>import UIKit
  import ObjectiveC
  
  var SubRowObjectKey: String = &quot;subRow&quot;
  extension IndexPath {
  
      var subRow: Int {
          get {
              let subRowObj = objc_getAssociatedObject(self, &amp;SubRowObjectKey)
          
              if subRowObj != nil {
                  return (subRowObj as! Int)
              }
          
              return 0
          }
          set {
              let subRowObj = (newValue as NSInteger)
              objc_setAssociatedObject(self, &amp;SubRowObjectKey, subRowObj, .OBJC_ASSOCIATION_RETAIN)
          
          }
      }
  
      static func indexPathForSubRow(_ subRow: NSInteger, inRow row: NSInteger, inSection section: NSInteger) -&gt; IndexPath {
      
          var indexPath = IndexPath(row: row, section: section)
          indexPath.subRow = (subRow as Int)
          print(subRow)
          print(indexPath.subRow)
          return indexPath
      }
  }
  
  let indexPath = IndexPath.indexPathForSubRow(5, inRow: 1, inSection: 2)
  print(indexPath.subRow)
  </code></pre>
  <p><a href="https://i.stack.imgur.com/sLIo7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sLIo7.png" alt="enter image description here" /></a></p>
  <ul>
  <li><p>In static func indexPathForSubRow -&gt; 'subRow' Count = 5 (line no: 30 in attached image)</p>
  </li>
  <li><p>But after assigning subRow to indexPath.subRow, 'indexPath.subRow' count = 0 instead of 5 (line no 29 &amp; 31 in attached image)</p>
  </li>
  <li><p>Tested in Xcode version 8.2.1 &amp; Swift 3.0</p>
  <p>Any help will be appreciated.</p>
  </li>
  </ul>