-
-
Notifications
You must be signed in to change notification settings - Fork 390
Fix for issue #261, Access to UIImagePickerController Object #262
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
Open
brt-manishp
wants to merge
146
commits into
develop
Choose a base branch
from
master
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Support for detection if TLPHAsset is created from camera using picker.
# Conflicts: # Example/TLPhotoPicker.xcodeproj/project.pbxproj # Example/TLPhotoPicker/Base.lproj/Main.storyboard # TLPhotoPicker/Classes/TLCollectionTableViewCell.swift
Introduce shared PHCachingImageManager for class methods to improve memory efficiency and cache reuse.
Implement async image loading, fix thread safety issues, and prevent memory leaks.
Fix compilation error where self.tableView was used but doesn't exist. Use the tableView parameter passed to tableView(_:cellForRowAt:) instead. Error: Value of type 'UIViewController' has no member 'tableView' Location: TLPhotosPickerViewController.swift:1267:40
Resolves critical crash: "Expected dequeued view to be returned"
- Separate configuration into dedicated file - Add 16 builder methods for fluent interface - Add 6 preset configurations (singlePhoto, videoOnly, etc.) - Update README with builder pattern examples
Improve code maintainability by extracting protocols from 1351-line ViewController
Add async/await usage guide and fix SPM documentation
- Rewrite README.md for modern, concise presentation - Remove outdated content (Carthage, Swift 4.2 references) - Update requirements (iOS 13.0+, Swift 5.0+) - Highlight modern features (Async/Await, Builder Pattern) - Add Quick Start section for immediate usage - Add Common Use Cases section - Reduce length from 589 to 282 lines (52% reduction) - Create comprehensive documentation structure - CONFIGURATION.md: Complete configuration guide with builder pattern and presets - ADVANCED.md: Custom cells, delegates, selection rules, and subclassing - API.md: Complete API reference for TLPHAsset and all components - MIGRATION.md: Upgrade guide from 1.x to 2.x with breaking changes - Improve documentation organization - Separate detailed content from main README - Category-based structure for easy navigation - Professional open-source project style - Better maintainability with independent documents 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Critical fixes: - Add missing shouldDismissPhotoPicker delegate method - Add missing isSelectedFromCamera property to TLPHAsset - Add missing TLPHAsset.asset(with:) static method - Fix TLBundle.bundle() return type (Bundle not Bundle?) - Add missing configuration options (defaultToFrontFacingCamera, startplayBack) Documentation improvements: - Remove 3D Touch feature claim (exists but disabled by default) - Remove non-existent cameraBgColor builder method - Fix cloudImageDownload signature (removed non-existent size parameter) - Fix tempCopyMediaFile signature (removed non-existent isExportTempFile parameter) - Clarify Force Touch/Context Menu behavior in MIGRATION.md All documentation now accurately reflects the actual source code implementation. Line-by-line verification completed against Classes/ directory. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…mples Major Improvements: - ✨ Add 3 new example methods (single photo, compact grid, async/await) - 🎨 Apply Builder Pattern throughout - 📚 Use configuration presets (.singlePhoto, .videoOnly, .compactGrid) - 🔄 Add async/await image loading example - ✅ Implement shouldDismissPhotoPicker validation - 🧹 Extract magic numbers to Constants enum - 📝 Add comprehensive inline documentation Code Quality: - Remove code duplication with setupCommonHandlers() - Improve alert messages with user-friendly text - Add Settings deep links for permission errors - Better error handling and logging - Clean MARK organization - Memory safe ([weak self] usage) New Features Demonstrated: - Modern Swift concurrency (Task, TaskGroup) - Preset configuration patterns - Fluent builder API - iCloud download with progress - Video export functionality - Media file copying - Custom validation before dismissal Documentation: - Add comprehensive Example/README.md - Document all 10 example methods - Include best practices guide - Add code pattern comparisons - Reference related files for each example File Changes: - ViewController.swift: 258 → 472 lines (better organized) - Example/README.md: New comprehensive guide This makes the Example app production-ready and educational for developers learning to integrate TLPhotoPicker. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Applied DRY principles to reduce boilerplate and improve maintainability:
**Phase 1: Generic Permission Alert Helper**
- Created `showPermissionAlert(for:message:on:)` to centralize alert logic
- Reduced 30+ lines of duplicated UIAlertController code
- Maintains Settings deep-link functionality
**Phase 2: Picker Factory Methods**
- Added `createPicker(modalStyle:withLogDelegate:configuration:)` for standard pickers
- Added overload for custom subclass support
- Comprehensive documentation with usage examples
- Centralizes: delegate setup, handler configuration, asset selection
**Phase 3: Refactored All 10 Examples**
- Example 1-10: Now use factory pattern
- Reduced boilerplate from ~10 lines to ~5 lines per example
- Improved readability with closure-based configuration
**Phase 4: Enhanced Documentation**
- Added detailed DocC-style comments
- Explains factory method benefits and usage patterns
**Impact:**
- ✅ Build verified: All examples compile successfully
- ✅ Zero functional changes: Maintains exact same behavior
- ✅ Reduced duplication: ~60 lines of setup code eliminated
- ✅ Better maintainability: Single source of truth for common setup
- ✅ Improved readability: Clearer intent with less noise
Pattern applied:
```swift
// Before (10+ lines)
let viewController = CustomPhotoPickerViewController()
viewController.delegate = self
setupCommonHandlers(for: viewController)
viewController.configure = /* config */
viewController.selectedAssets = self.selectedAssets
present(viewController, animated: true)
// After (5 lines)
let picker = createPicker(CustomPhotoPickerViewController()) { picker in
picker.configure = /* config */
}
present(picker, animated: true)
```
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Added comprehensive GitHub Sponsors integration for TLPhotoPicker: **What's Added:** 1. **GitHub Sponsors Button (.github/FUNDING.yml)** - Enables native "Sponsor" button in repository header - Links to https://github.com/sponsors/tilltue - Follows GitHub's official FUNDING.yml specification 2. **README Badge** - Added sponsor badge to header badge collection - Styled with pink heart emoji for visibility - Direct link to sponsor page 3. **Support This Project Section** - Comprehensive section before License - Explains what sponsorship helps fund: • Bug fixes and iOS compatibility • New features and improvements • Documentation and examples • Performance optimizations - Large, prominent sponsor badge 4. **CocoaPods Metadata** - Added funding_uri to TLPhotoPicker.podspec - CocoaPods.org will display sponsor link - Reaches iOS developers at install time **Why Sponsor?** TLPhotoPicker is a mature, widely-used iOS library maintained in free time. This integration makes it easy for users to support continued development. **Expected Impact:** - ✅ Visible sponsor button on GitHub - ✅ Multiple touchpoints (header, README, CocoaPods) - ✅ Clear value proposition for sponsors - ✅ Professional, non-intrusive presentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Applied ToT analysis to remove unnecessary parameter complexity:
**Problem:** modalStyle parameter was optional and only used in 2 examples
**Solution:** Fixed all pickers to .fullScreen modal presentation
**Changes:**
1. **Standard createPicker method**
- Removed `modalStyle` optional parameter
- Always applies `.fullScreen` presentation
- Simplified API surface
2. **Generic createPicker overload**
- Removed `modalStyle` parameter
- Consistent `.fullScreen` for all custom subclasses
- Updated documentation
3. **All Example Methods**
- Removed `modalStyle: .fullScreen` arguments
- Cleaner, more concise code
- Example 1: 9 lines → 7 lines
- Example 4: 7 lines → 5 lines
**Rationale:**
✅ Example app prioritizes consistency over flexibility
✅ All 10 examples now have uniform modal presentation
✅ Reduced parameter count improves readability
✅ Real users create pickers directly (no constraint)
✅ Verified: Build succeeds with no errors
**Before:**
```swift
let picker = createPicker(
CustomPhotoPickerViewController(),
modalStyle: .fullScreen,
withLogDelegate: true
) { ... }
```
**After:**
```swift
let picker = createPicker(
CustomPhotoPickerViewController(),
withLogDelegate: true
) { ... }
```
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
…vacy Changed NSPrivacyAccessedAPICategoryPhotoLibrary to NSPrivacyAccessedAPICategoryFileTimestamp per Apple's official privacy API categories documentation. The C617.1 reason code specifies accessing file metadata (timestamps, size) which corresponds to the FileTimestamp API category.
- Remove usedPrefetch condition from willDisplay to fix off-screen cell order display - Ensure cells always show correct selection state when scrolled into view
- Fix selection order not updating for off-screen cells 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In "showCamera()" there is a local variable called "picker" which I need it access to configure image picker for various use case. So I made a public optional variable of UIImagePickerController in "TLPhotosPickerConfigure" and used it in "showCamera()" with null check
Changes made are as follows in file named TLPhotosPickerViewController.swift