"unrecognized selector sent to instance" when setting a property on react-native
<p>I'm trying to link my Swift view with my React-Native project. I figured out how to display it, but now when I'm trying to set a property, I'm having this error message:</p>

<pre><code>Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Switch setMessage:]: unrecognized selector sent to instance 0x7f96b270de70'
</code></pre>

<p>In my react-native code, I'm doing:</p>

<pre><code>const SwitchNative = requireNativeComponent('Switch', Switch);

class Switch extends Component {
  render() {
    return (
        &lt;SwitchNative message="message will be" style={this.props.style} /&gt;
    );
  }
}
</code></pre>

<p>Then doing this in my <strong>SwiftBridge</strong>:</p>

<pre><code>// SwiftBridge.h

#import "RCTView.h"

@interface SwitchBridge : RCTView

  @property (nonatomic, assign) NSString *message;

@end

// SwiftBridge.m

#import "RCTBridgeModule.h"
#import "RCTViewManager.h"
#import "SwitchBridge.h"

@interface RCT_EXTERN_MODULE(SwitchManager, RCTViewManager)

  RCT_EXPORT_VIEW_PROPERTY(message, NSString)

@end
</code></pre>

<p>Then finally I have this in my Swift class <code>Switch.swift</code>:</p>

<pre><code>...
public func setMessage(message: String) {
  NSLog("It's working well");
}
...
</code></pre>

<p>Not sure why it can't find my <code>setMessage</code> function.</p>