Created
February 3, 2022 11:00
Star
You must be signed in to star a gist
React Native iOS MapView example in Swift
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 { requireNativeComponent } from 'react-native'; | |
export default requireNativeComponent('RNMap'); |
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 | |
import AVFoundation | |
import MapKit | |
class RNMap : MKMapView { | |
} |
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(RNMapManager, RCTViewManager) | |
@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(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