-
Notifications
You must be signed in to change notification settings - Fork 19
Fix dark mode issues #178
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
Fix dark mode issues #178
Conversation
…ith UIView and simplify initialization
… UIView and simplify view management
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
_view = UIView() | ||
_channel = FlutterMethodChannel( | ||
name: "\(SmileIDDocumentCaptureView.VIEW_TYPE_ID)_\(viewId)", | ||
binaryMessenger: messenger | ||
) | ||
_childViewController = nil | ||
|
||
super.init() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: The super.init()
call should occur before initializing instance properties to ensure proper initialization order. Moving it before property assignments prevents potential issues with the parent class initialization. [general, importance: 8]
_view = UIView() | |
_channel = FlutterMethodChannel( | |
name: "\(SmileIDDocumentCaptureView.VIEW_TYPE_ID)_\(viewId)", | |
binaryMessenger: messenger | |
) | |
_childViewController = nil | |
super.init() | |
super.init() | |
_view = UIView() | |
_channel = FlutterMethodChannel( | |
name: "\(SmileIDDocumentCaptureView.VIEW_TYPE_ID)_\(viewId)", | |
binaryMessenger: messenger | |
) | |
_childViewController = nil |
private func setupHostingController(frame: CGRect) { | ||
_childViewController.view.frame = frame | ||
_childViewController.view.autoresizingMask = [.flexibleWidth, .flexibleHeight] | ||
_childViewController = embedView(rootView, in: _view, frame: frame) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: The embedView
function is called but not defined in the visible code. Ensure this function properly handles the view controller lifecycle and returns a valid UIViewController
instance. [general, importance: 4]
_childViewController = embedView(rootView, in: _view, frame: frame) | |
_childViewController = embedView(rootView, in: _view, frame: frame) | |
// Ensure embedView returns a valid UIViewController and handles lifecycle properly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested this, the issue is now fixed🚀
User description
Story: https://app.shortcut.com/smileid/story/16965/
Summary
Known Issues
N/A.
Test Instructions
Screenshot
N/A.
PR Type
Bug fix
Description
• Refactored iOS platform views to fix dark mode issues
• Replaced UIHostingController with UIView for consistent view management
• Standardized view controller lifecycle using embedView pattern
• Updated changelog to document the fixes
Changes walkthrough 📝
SmileIDDocumentCaptureView.swift
Refactor document capture view implementation
ios/Classes/SmileIDDocumentCaptureView.swift
• Replaced UIHostingController with UIView for view management
•
Simplified initialization by removing setupHostingController method
•
Added embedView pattern for consistent view controller lifecycle
•
Changed view() method to return _view instead of
_childViewController.view
SmileIDSmartSelfieCaptureView.swift
Refactor smart selfie capture view implementation
ios/Classes/SmileIDSmartSelfieCaptureView.swift
• Replaced UIHostingController with UIView for view management
•
Simplified initialization by removing setupHostingController method
•
Added embedView pattern for consistent view controller lifecycle
•
Removed commented code and cleaned up view() method
CHANGELOG.md
Document dark mode fixes in changelog
CHANGELOG.md
• Added new unreleased section documenting dark mode fixes
• Updated
version 11.0.2 release date to June 16, 2025
• Documented refactoring
of iOS platform view implementations