Skip to content
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

Open
wants to merge 1 commit into
base: feature/switch-to-swift-pt1
Choose a base branch
from

Conversation

MrRefactor
Copy link
Collaborator

Summary

Test Plan

What's required for testing (prerequisites)?

What are the steps to reproduce (after prerequisites)?

Compatibility

OS Implemented
iOS
Android

Checklist

  • I have tested this on a device and a simulator
  • I added the documentation in README.md
  • I updated the typed files (TS and Flow)

@MrRefactor MrRefactor self-assigned this Dec 2, 2024
@@ -2,3 +2,4 @@
#import <React/RCTUIManager.h>
#import <React/UIView+React.h>
#import <React/RCTUtils.h>
#import <React/RCTAssert.h>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it needed?

Copy link
Member

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

import Foundation
import React

@objc public class RCTOnPageSelected: NSObject, RCTEvent {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add @objcMembers

Comment on lines +20 to +23
@objc public func canCoalesce() -> Bool {
return false
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If canCoalesce is false you don't need to have coalescingKey and public func coalesce(with newEvent: RCTEvent) -> RCTEvent

Reference: https://github.com/facebook/react-native/blob/67bff8734f4b92fe399910eecad5b67511a749c1/packages/react-native/React/Base/RCTEventDispatcherProtocol.h#L51-L56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants