-
Notifications
You must be signed in to change notification settings - Fork 427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(iOS): Migrate RCTOnPageSelected to swift #939
base: feature/switch-to-swift-pt1
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import Foundation | ||
import React | ||
|
||
@objc public class RCTOnPageSelected: NSObject, RCTEvent { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's add @objcMembers |
||
private var position: NSNumber | ||
@objc public var viewTag: NSNumber | ||
@objc public var coalescingKey: UInt16 | ||
|
||
@objc public var eventName: String { | ||
return "onPageSelected" | ||
} | ||
|
||
@objc public init(reactTag: NSNumber, position: NSNumber, coalescingKey: UInt16) { | ||
self.viewTag = reactTag | ||
self.position = position | ||
self.coalescingKey = coalescingKey | ||
super.init() | ||
} | ||
|
||
@objc public func canCoalesce() -> Bool { | ||
return false | ||
} | ||
|
||
Comment on lines
+20
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If |
||
public func coalesce(with newEvent: RCTEvent) -> RCTEvent { | ||
return newEvent | ||
} | ||
|
||
@objc public class func moduleDotMethod() -> String { | ||
return "RCTEventEmitter.receiveEvent" | ||
} | ||
|
||
@objc public func arguments() -> [Any] { | ||
return [ | ||
viewTag, | ||
RCTNormalizeInputEventName(eventName) ?? eventName, | ||
[ | ||
"position": position | ||
] | ||
] | ||
} | ||
} |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
#import <React/RCTUIManager.h> | ||
#import <React/UIView+React.h> | ||
#import <React/RCTUtils.h> | ||
#import <React/RCTAssert.h> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it needed? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: rename file so it matches class name