Created
February 3, 2022 11:00
-
-
Save dcangulo/a93713c31a90d48d78298134f2c7bef4 to your computer and use it in GitHub Desktop.
React Native iOS MapView example in Swift
This file contains hidden or 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 { requireNativeComponent } from 'react-native'; | |
export default requireNativeComponent('RNMap'); |
This file contains hidden or 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 | |
import AVFoundation | |
import MapKit | |
class RNMap : MKMapView { | |
} |
This file contains hidden or 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(RNMapManager, RCTViewManager) | |
@end |
This file contains hidden or 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(RNMapManager) | |
class RNMapManager : RCTViewManager { | |
override class func requiresMainQueueSetup() -> Bool { | |
return true | |
} | |
override func view() -> UIView! { | |
return RNMap() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment