File tree Expand file tree Collapse file tree
documentscanner-compose/src/iosMain/kotlin/io/github/kalinjul/easydocumentscan Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,13 +61,24 @@ actual fun rememberDocumentScanner(
6161 }
6262
6363 private fun VNDocumentCameraViewController.setManualMode () {
64+ // iOS < 26
6465 val autoButton = view.findChild {
6566 it.hasChild {
6667 val text = (it as ? UILabel )?.text
6768 text == " Auto" || text == " Automatisch"
6869 } != null
6970 }
7071 (autoButton as ? UIButton )?.sendActionsForControlEvents(UIControlEventTouchUpInside )
72+
73+ // iOS 26
74+ val shutterButton = view.findChild {
75+ it.hasChild {
76+ val text = (it as ? UILabel )?.text
77+ text == " Shutter" || text == " Verschluss"
78+ } != null
79+ }
80+
81+ (shutterButton?.subviews?.firstOrNull() as ? UIButton )?.sendActionsForControlEvents(UIControlEventTouchUpInside )
7182 }
7283 }
7384}
@@ -91,11 +102,11 @@ private fun UIView.findChildren(predicate: (UIView) -> Boolean): List<UIView> {
91102private fun UIView.findChild (predicate : (UIView ) -> Boolean ): UIView ? {
92103 subviews.forEach {
93104 val view: UIView ? = it as ? UIView
94- when (view) {
95- is UIButton -> println (view)
96- is UILabel -> println (view.text)
97- else -> println (view)
98- }
105+ // when(view) {
106+ // is UIButton -> println(view)
107+ // is UILabel -> println(view.text)
108+ // else -> println(view)
109+ // }
99110
100111 if (view != null && predicate(view)) {
101112 return view
You can’t perform that action at this time.
0 commit comments