-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
91 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Binary file modified
BIN
+3.1 KB
(100%)
...deproj/project.xcworkspace/xcuserdata/shamanec.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// | ||
// TextFieldWrapper.swift | ||
// xcuitest-sample-proj | ||
// | ||
// Created by Nikola Shabanov on 23.07.23. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct TextFieldWrapper: UIViewRepresentable { | ||
@Binding var text: String | ||
|
||
func makeUIView(context: Context) -> UITextField { | ||
let textField = UITextField() | ||
textField.delegate = context.coordinator | ||
|
||
// Apply the black border to the UITextField | ||
textField.layer.borderColor = UIColor.black.cgColor | ||
textField.layer.borderWidth = 1.0 | ||
|
||
return textField | ||
} | ||
|
||
func updateUIView(_ uiView: UITextField, context: Context) { | ||
uiView.text = text | ||
} | ||
|
||
func makeCoordinator() -> Coordinator { | ||
Coordinator(text: $text) | ||
} | ||
|
||
class Coordinator: NSObject, UITextFieldDelegate { | ||
@Binding var text: String | ||
|
||
init(text: Binding<String>) { | ||
_text = text | ||
} | ||
|
||
func textFieldDidChangeSelection(_ textField: UITextField) { | ||
text = textField.text ?? "" | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
xcuitest-sample-projUITests/Extensions/XCUIApplication+Extensions.swift
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// XCUIApplication+Extensions.swift | ||
// xcuitest-sample-projUITests | ||
// | ||
// Created by Nikola Shabanov on 23.07.23. | ||
// | ||
|
||
import XCTest | ||
|
||
extension XCUIApplication { | ||
|
||
/// Tap the zero coordinate of the app, useful for closing keyboards or triggering UIApplicationMonitor | ||
func tapZero() { coordinate(withNormalizedOffset: .zero).tap() } | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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