@@ -89,21 +89,36 @@ Always reference these instructions first and fallback to search or bash command
8989** ALWAYS** test these scenarios after making changes to keyboard management:
9090
91911 . ** Basic Keyboard Management** :
92- - Run DemoSwift app in iOS Simulator
92+ - Run DemoSwift app in iOS Simulator
9393 - Navigate to "UITextField/UITextView example"
9494 - Tap text fields - verify keyboard shows/hides smoothly
9595 - Verify toolbar appears above keyboard with Previous/Next/Done buttons
9696 - Test scrolling behavior when keyboard appears
97+ - ** Validate** : No text fields are obscured by keyboard
9798
98- 2 . ** Configuration Testing** :
99- - Open Settings in demo app
99+ 2 . ** Multi-Field Navigation** :
100+ - Use Previous/Next buttons in toolbar to navigate between text fields
101+ - Verify focus moves correctly between fields
102+ - Test with different keyboard types (number pad, email, etc.)
103+ - ** Validate** : All fields are accessible via keyboard navigation
104+
105+ 3 . ** Configuration Testing** :
106+ - Open Settings in demo app
100107 - Toggle "Enable IQKeyboardManager" - verify keyboard behavior changes
101108 - Test different toolbar management options
102109 - Verify appearance customization works
110+ - ** Validate** : Settings changes take effect immediately
103111
104- 3 . ** Both Platform Testing** :
112+ 4 . ** Both Platform Testing** :
105113 - Test identical scenarios in both DemoSwift and DemoObjC apps
106114 - Ensure Objective-C and Swift versions behave identically
115+ - ** Validate** : Feature parity between both implementations
116+
117+ 5 . ** Edge Cases** :
118+ - Test with collection views and table views containing text fields
119+ - Test with modal presentations and popovers
120+ - Test device rotation during text input
121+ - ** Validate** : Keyboard management works in complex UI scenarios
107122
108123### CI Validation
109124The project uses Travis CI (` .travis.yml ` ) with these validation steps:
@@ -189,6 +204,40 @@ pod install --repo-update
189204
190205## Common Tasks
191206
207+ ### Repository Structure Overview
208+ ```
209+ IQKeyboardManager/
210+ ├── README.md (236 lines) - Main documentation
211+ ├── CONTRIBUTING.md (52 lines) - Contribution guidelines
212+ ├── Package.swift - Swift Package Manager configuration
213+ ├── Podfile - CocoaPods configuration for demo apps
214+ ├── Demo.xcworkspace - Xcode workspace (use this, not .xcodeproj)
215+ ├── IQKeyboardManager/ - Objective-C version (legacy)
216+ ├── IQKeyboardManagerSwift/ - Swift version (current)
217+ │ ├── IQKeyboardManager/ - Core keyboard management (~40KB main file)
218+ │ │ ├── Configuration/ - Runtime configuration classes
219+ │ │ ├── Debug/ - Debug utilities
220+ │ │ ├── Deprecated/ - Backward compatibility
221+ │ │ ├── IQKeyboardManagerExtension/ - UIKit extensions
222+ │ │ └── UIKitExtensions/ - Additional UIKit helpers
223+ │ ├── Appearance/ - UI appearance customization
224+ │ ├── Resign/ - Keyboard dismissal handling
225+ │ └── IQKeyboardToolbarManager/ - Toolbar management
226+ ├── Demo/
227+ │ ├── Swift_Demo/ - Swift demonstration app (45 Swift files)
228+ │ │ ├── AppDelegate.swift - Shows basic integration
229+ │ │ └── ViewController/ - Various usage examples
230+ │ └── Objective_C_Demo/ - Objective-C demonstration app (28 .m files)
231+ ├── DemoObjCUITests/ - UI test suite
232+ └── Documentation/ - Migration guides for major versions
233+ ```
234+
235+ ### Key Files to Check After Changes
236+ - ` IQKeyboardManagerSwift/IQKeyboardManager/IQKeyboardManager.swift ` - Main library class
237+ - ` Demo/Swift_Demo/AppDelegate.swift ` - Basic integration example
238+ - ` Demo/Objective_C_Demo/AppDelegate.m ` - Objective-C integration example
239+ - Any files in ` IQKeyboardManagerSwift/IQKeyboardManagerExtension/ ` when modifying UIKit behavior
240+
192241### Basic Usage Integration
193242** Swift** :
194243``` swift
@@ -216,4 +265,62 @@ IQKeyboardManager.shared.enableAutoToolbar = true
216265- `Documentation/` - Migration guides for major versions
217266- `README.md` - Installation and basic usage
218267- `CONTRIBUTING.md` - Development guidelines
219- - Demo apps serve as comprehensive usage examples
268+ - Demo apps serve as comprehensive usage examples
269+
270+ ## Troubleshooting
271+
272+ ### Common Issues and Solutions
273+
274+ **"No such module 'UIKit'" error:**
275+ - Expected on Linux - this is an iOS-only library
276+ - Build and test only on macOS with Xcode
277+
278+ **CocoaPods installation fails:**
279+ - Check internet connectivity and firewall restrictions
280+ - Try `pod install --verbose` for detailed error messages
281+ - In sandboxed environments, network access may be limited
282+
283+ **Xcode build fails:**
284+ - Ensure you're opening `Demo.xcworkspace`, not `Demo.xcodeproj`
285+ - Clean build folder: `cmd+shift+k` in Xcode
286+ - Reset simulators if needed
287+
288+ **UI tests fail:**
289+ - Ensure iOS Simulator is available and running
290+ - Check that test devices match requirements (iOS 13.0+)
291+ - Verify simulator has sufficient disk space
292+
293+ ## CRITICAL: Timeout and Cancellation Guidelines
294+
295+ ### NEVER CANCEL These Commands
296+ Set appropriate timeouts and wait for completion:
297+
298+ **Swift Package Manager (works on any platform):**
299+ - `swift package resolve` - Takes ~2 seconds, set 60 second timeout
300+ - `swift package show-dependencies` - Takes ~1 second, set 30 second timeout
301+
302+ **CocoaPods (macOS only):**
303+ - `pod install --repo-update` - Takes 5-10 minutes, set 15+ minute timeout
304+ - NEVER CANCEL during "Installing" or "Generating Pods project" phases
305+
306+ **Xcode Builds (macOS only):**
307+ - Clean builds: 10-15 minutes, set 30+ minute timeout
308+ - Incremental builds: 2-5 minutes, set 15+ minute timeout
309+ - UI test runs: 15-20 minutes, set 45+ minute timeout
310+
311+ **Expected Command Failures:**
312+ - `swift build` on Linux - WILL FAIL with UIKit error (this is correct)
313+ - `pod install` in restricted networks - MAY FAIL due to network access
314+
315+ ### Build Command Examples with Timeouts
316+ ```bash
317+ # Swift Package Manager (any platform)
318+ timeout 60 swift package resolve
319+
320+ # CocoaPods (macOS only)
321+ timeout 900 pod install --repo-update # 15 minutes
322+
323+ # Xcode builds (macOS only)
324+ timeout 1800 xcodebuild -workspace Demo.xcworkspace -scheme DemoSwift -sdk iphonesimulator clean build # 30 minutes
325+ timeout 2700 xcodebuild -workspace Demo.xcworkspace -scheme DemoObjC -sdk iphonesimulator test # 45 minutes
326+ ```
0 commit comments