title: how could I pass swift custom component's properties from js world
body: <p>I have custom component written by swift and I want to pass some custom properties from js world,</p>
  <p>but I really don't know how to do it, provide some main code below.</p>
  <hr />
  <p><strong>Demo-Bridging-Header.h</strong></p>
  <pre><code>#import &quot;RCTBridgeModule.h&quot;
  #import &quot;RCTViewManager.h&quot;
  </code></pre>
  <p><strong>CollectionViewManagerBridge.m</strong></p>
  <pre><code>#import &quot;RCTView.h&quot;
  #import &quot;RCTViewManager.h&quot;
  
  
  @interface RCT_EXTERN_MODULE(CollectionViewManagerSwift, RCTViewManager)
  
  @end
  </code></pre>
  <p><strong>CollectionViewManagerSwift.swift</strong></p>
  <pre><code>@objc(CollectionViewManagerSwift)
  
  class CollectionViewManagerSwift : RCTViewManager, UICollectionViewDataSource, UICollectionViewDelegate {
    
    let contentCellIdentifier = &quot;CellIdentifier&quot;
    var collectionView: UICollectionView
    
    override init() {
      let layout = CustomCollectionViewLayout()
      let collectionView = UICollectionView(frame: CGRectZero, collectionViewLayout: layout)
      
      collectionView.registerClass(CustomCell.self, forCellWithReuseIdentifier: contentCellIdentifier)
      collectionView.directionalLockEnabled = false
      collectionView.backgroundColor = UIColor.whiteColor()
      
      self.collectionView = collectionView
    }
    
    override func view() -&gt; UICollectionView! {
      self.collectionView.delegate = self
      self.collectionView.dataSource = self
      
      return self.collectionView;
    }
  
    // ... some other code
  
  }
  </code></pre>
  <p>In addition, I also have <strong>CustomCell.swift</strong> and <strong>CustomCollectionViewLayout.swift</strong> which be used above,</p>
  <p>these code work fine when I call <code>&lt;CollectionViewManagerSwift /&gt;</code> in <code>render()</code> method from js world,</p>
  <p>but how could I pass properties from js world like <code>&lt;CollectionViewManagerSwift customProperty={customProperties} /&gt;</code>, and how could I define <code>customProperty</code> in my swift code?</p>
  <p>maybe I don't express clearly, thanks for your time.</p>
  <hr />
  <h3>follow-up</h3>
  <p>I try to add <code>customProperty</code> in <strong>CollectionViewManagerBridge.m</strong></p>
  <pre><code>#import &quot;RCTView.h&quot;
  #import &quot;RCTViewManager.h&quot;
  
  
  @interface RCT_EXTERN_MODULE(CollectionViewManagerSwift, RCTViewManager)
  
  RCT_CUSTOM_VIEW_PROPERTY(customProperty, NSArray, CollectionViewManagerSwift)
  {
    NSLog(@&quot;%@ -- %@&quot;, json[0], json[1]);
  }
  
  @end
  </code></pre>
  <p>then I call it from js world</p>
  <pre><code>&lt;CollectionViewManagerSwift customProperty={['foo', 'bar']} /&gt;
  </code></pre>
  <p>I get the value in Xcode output</p>
  <pre><code>2016-02-27 17:58:07.167 Demo[49690:12639774] foo -- bar
  </code></pre>
  <p>but how could I get the <code>customProperty</code> in <strong>CollectionViewManagerSwift.swift</strong>?</p>
  <p>thanks again.</p>
  <p>regards</p>