Skip to content

[feat/MAT-361] 네이티브 스타일러스 입력 (iOS)#303

Open
b0nsu wants to merge 1 commit intorefactor/mat-360-input-eraserfrom
refactor/mat-361-native-stylus
Open

[feat/MAT-361] 네이티브 스타일러스 입력 (iOS)#303
b0nsu wants to merge 1 commit intorefactor/mat-360-input-eraserfrom
refactor/mat-361-native-stylus

Conversation

@b0nsu
Copy link
Copy Markdown
Collaborator

@b0nsu b0nsu commented Apr 30, 2026

Summary

iOS Apple Pencil 네이티브 입력을 위한 Fabric 컴포넌트(StylusInputView)와 PencilGestureRecognizer를 추가합니다.
coalesced touch(240Hz) 지원으로 입력 정밀도를 높입니다.

Stacked PR 6/10 — base: refactor/mat-360-input-eraser

Linear

Changes

  • ios/PencilGestureRecognizer.h/.m — Apple Pencil 제스처 인식기
  • ios/StylusInputView.h/.mm — Fabric 네이티브 컴포넌트
  • src/input/nativeStylusAdapter.tsx — 네이티브 스타일러스 어댑터
  • src/specs/StylusInputViewNativeComponent.ts — codegen spec
  • package.json codegenConfig 추가, podspec 생성

Testing

  • pnpm typecheck 통과
  • pnpm lint 통과

Risk / Impact

  • 영향 범위: iOS 네이티브 레이어 추가
  • 확인이 필요한 부분: iOS 빌드, StylusInputView 컴포넌트 등록, Apple Pencil 입력
  • 배포 시 유의사항: iOS pod install 필요

@linear
Copy link
Copy Markdown

linear Bot commented Apr 30, 2026

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pointer-admin Ready Ready Preview, Comment May 8, 2026 3:27pm

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

iOS에서 Apple Pencil 네이티브 입력(코얼레스드 터치/예측 터치 포함)을 React Native New Architecture(Fabric) 컴포넌트로 수집하고, JS 입력 콜백 모델로 전달하기 위한 기반을 추가합니다.

Changes:

  • Fabric 네이티브 컴포넌트 StylusInputViewPencilGestureRecognizer로 Pencil/손가락 터치(코얼레스드/예측 샘플) 이벤트 방출
  • JS 측 useNativeStylusAdapter 훅으로 네이티브 이벤트를 DrawingInputCallbacks로 변환/전달
  • RN codegen 설정 및 iOS Podspec 추가

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/pointer-native-drawing/src/specs/StylusInputViewNativeComponent.ts StylusInputView codegen 스펙(병렬 배열 이벤트 페이로드) 정의
packages/pointer-native-drawing/src/input/nativeStylusAdapter.tsx 네이티브 stylus 이벤트를 InputEvent로 변환해 draw/erase 콜백으로 라우팅
packages/pointer-native-drawing/src/index.ts 신규 어댑터 훅 export 추가
packages/pointer-native-drawing/pointer-native-drawing.podspec iOS 소스 포함 Podspec 추가
packages/pointer-native-drawing/package.json codegenConfig 및 배포 파일 목록에 iOS 디렉터리 추가
packages/pointer-native-drawing/ios/StylusInputView.mm Fabric 컴포넌트 구현 및 이벤트 emit
packages/pointer-native-drawing/ios/StylusInputView.h Fabric 컴포넌트 헤더 추가
packages/pointer-native-drawing/ios/PencilGestureRecognizer.m coalesced/predicted touch 수집 및 finger-input 지연 시작 로직 구현
packages/pointer-native-drawing/ios/PencilGestureRecognizer.h recognizer + delegate + 데이터 모델 선언

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

onStylusTouch={handleStylusTouch}
/>
) : null,
[handleStylusTouch]
"dist",
"src"
"src",
"ios"
Comment on lines +36 to +47
- (instancetype)initWithFrame:(CGRect)frame
{
if (self = [super initWithFrame:frame]) {
self.userInteractionEnabled = YES;
self.backgroundColor = [UIColor clearColor];

_pencilRecognizer = [[PencilGestureRecognizer alloc] initWithTarget:nil action:nil];
_pencilRecognizer.pencilDelegate = self;
_pencilRecognizer.cancelsTouchesInView = NO;
_pencilRecognizer.delaysTouchesBegan = NO;
[self addGestureRecognizer:_pencilRecognizer];
}
@b0nsu b0nsu force-pushed the refactor/mat-360-input-eraser branch from 6ecb49f to 51d4099 Compare May 8, 2026 15:12
…nvas iOS 통합

- ios/PencilGestureRecognizer.{h,m}: UIGestureRecognizer 서브클래스 (Apple Pencil precise + 240Hz coalesced + predicted touches)
- ios/StylusInputView.{h,mm}: Fabric component — UITouch 좌표/force/altitude/azimuth 패킹
- src/specs/StylusInputViewNativeComponent.ts: codegen spec
- src/input/nativeStylusAdapter.tsx: native overlay 어댑터
  - state.phase 외부 미노출 (consumer 0건 — PR #302 인터페이스와 일관)
  - acceptFingerInput 미전달 (textbox 비활성화 정책 — native default false)
- pointer-native-drawing.podspec + package.json: codegen 등록
- DrawingCanvas.tsx: Platform 분기
  - iOS = native overlay (240Hz pencil 풀 활용), rngh pan 비활성
  - Android/Web = rngh pan 그대로

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

2 participants