Example of react native swift component implementation
Created
December 23, 2017 01:46
-
-
Save nkt/a50728d891babaeadd57cd04b7b63cf5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <React/RCTBridgeModule.h> | |
#import <React/RCTViewManager.h> | |
@interface RCT_EXTERN_MODULE(RNPhoneInputSwift, RCTViewManager) | |
RCT_EXPORT_VIEW_PROPERTY(value, NSString); | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
@objc(RNPhoneInput) | |
public class RNPhoneInput : UITextField { | |
@objc(setValue:) | |
public func setValue(value: String) { | |
self.text = value | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
@objc(RNPhoneInputSwift) | |
class RNPhoneInputManager : RCTViewManager { | |
override static func requiresMainQueueSetup() -> Bool { | |
return false | |
} | |
override func view() -> UIView! { | |
return RNPhoneInput() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment