KeyboardMovementObserver is already pretty big file (250+ lines of the code). When we add new code then we get a lint warning telling, that files shouldn't be bigger than 250 lines of the code (excluding comments).
So in this PR I'm moving findKeyboardView function into separate file - this is a pure function with a clearly defined functionality, so it's an ideal candidate for splitting the code.
Initially I wanted to add it as extensions, but since we already have traversal folder - I decided to put it there, because in order to find a keyboardView we need to traverse through windows 🙂
📢 Changelog
iOS
added new KeyboardView file in traversal folder;
moved findKeyboardView function as static function of KeyboardView class;
removed findKeyboardView from KeyboardMovementObserver;
started to use KeyboardView.find() instead of findKeyboardView;
🤔 How Has This Been Tested?
Tested on iPhone 14 Pro (iOS 17.2, real device) + CI.
📝 Checklist
[x] CI successfully passed
[x] I added new mocks and corresponding unit-tests if library API was changed
📜 Description
Moved
findKeyboardView
in separate file.💡 Motivation and Context
KeyboardMovementObserver
is already pretty big file (250+ lines of the code). When we add new code then we get a lint warning telling, that files shouldn't be bigger than 250 lines of the code (excluding comments).So in this PR I'm moving
findKeyboardView
function into separate file - this is a pure function with a clearly defined functionality, so it's an ideal candidate for splitting the code.Initially I wanted to add it as extensions, but since we already have
traversal
folder - I decided to put it there, because in order to find akeyboardView
we need to traverse through windows 🙂📢 Changelog
iOS
KeyboardView
file intraversal
folder;findKeyboardView
function as static function ofKeyboardView
class;findKeyboardView
fromKeyboardMovementObserver
;KeyboardView.find()
instead offindKeyboardView
;🤔 How Has This Been Tested?
Tested on iPhone 14 Pro (iOS 17.2, real device) + CI.
📝 Checklist