From 4de9bc85c73a589eaebca654070ea9d992f57bf2 Mon Sep 17 00:00:00 2001 From: emil Date: Thu, 16 May 2024 10:29:28 +0200 Subject: [PATCH 1/4] Commit for Graph cycle error testing. --- Case-102.swift | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 Case-102.swift diff --git a/Case-102.swift b/Case-102.swift new file mode 100644 index 0000000..4cc5cd5 --- /dev/null +++ b/Case-102.swift @@ -0,0 +1,48 @@ +// +// iPhoneNumberFieldTest.swift +// Neuro20 PRO (iOS) +// +// Created by Emil Kaczmarek on 16/05/2024. +// + +import iPhoneNumberField +import SwiftUI + +struct iPhoneNumberFieldTestView: View { + var placeholderText: String + @Binding var mainText: String + var formX: CGFloat = 0 + var formY: CGFloat = 0 + var textXPos: CGFloat = 16 + var mainForegroundColor: Color = .red + var cornerRadius: CGFloat = 4 + var disabled: Bool = false + var borderColor: Color = Color.black + + var body: some View { + iPhoneNumberField(placeholderText, text: $mainText) + .autofillPrefix(true) + .flagHidden(false) + .flagSelectable(true) + .prefixHidden(false) + .maximumDigits(10) + .clearsOnEditingBegan(true) + .clearsOnInsert(true) + .textInputAutocapitalization(.never) + .disabled(disabled) + .foregroundColor(mainForegroundColor) + .overlay( + RoundedRectangle(cornerRadius: cornerRadius) + .stroke(borderColor) + ) + .frame(200, 200) + .background(Color.white) + } +} + +struct iPhoneNumberFieldTest: View { + @State var number: String = "" + var body: some View { + iPhoneNumberFieldTestView(placeholderText: "GOTACHA", mainText: $number) + } +} From 381494dc257f7f207b51550597cb682dcba0ea2c Mon Sep 17 00:00:00 2001 From: Seyed Mojtaba Hosseini Zeidabadi Date: Sat, 18 May 2024 11:50:27 +0330 Subject: [PATCH 2/4] style: move the test case file where it belong --- .../MultiplatformDemo/Test-Case_PRs/Case-102.swift | 0 Demo/iPhoneNumberFieldDemo.xcodeproj/project.pbxproj | 12 ++++++++++++ 2 files changed, 12 insertions(+) rename Case-102.swift => Demo/MultiplatformDemo/Test-Case_PRs/Case-102.swift (100%) diff --git a/Case-102.swift b/Demo/MultiplatformDemo/Test-Case_PRs/Case-102.swift similarity index 100% rename from Case-102.swift rename to Demo/MultiplatformDemo/Test-Case_PRs/Case-102.swift diff --git a/Demo/iPhoneNumberFieldDemo.xcodeproj/project.pbxproj b/Demo/iPhoneNumberFieldDemo.xcodeproj/project.pbxproj index e9dde5a..bc2165c 100644 --- a/Demo/iPhoneNumberFieldDemo.xcodeproj/project.pbxproj +++ b/Demo/iPhoneNumberFieldDemo.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 2A4F34632BF89D0500868921 /* Case-102.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A4F34612BF89CDE00868921 /* Case-102.swift */; }; 2AA44DC728A11687001BF8F0 /* MultiplatformDemoApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AA44DC628A11687001BF8F0 /* MultiplatformDemoApp.swift */; }; 2AA44DC928A11687001BF8F0 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AA44DC828A11687001BF8F0 /* ContentView.swift */; }; 2AA44DCB28A11688001BF8F0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2AA44DCA28A11688001BF8F0 /* Assets.xcassets */; }; @@ -15,6 +16,7 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 2A4F34612BF89CDE00868921 /* Case-102.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Case-102.swift"; sourceTree = ""; }; 2AA44DC328A11687001BF8F0 /* iPhoneNumberFieldDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iPhoneNumberFieldDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 2AA44DC628A11687001BF8F0 /* MultiplatformDemoApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MultiplatformDemoApp.swift; sourceTree = ""; }; 2AA44DC828A11687001BF8F0 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; @@ -36,6 +38,14 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 2A4F34622BF89CDE00868921 /* Test-Case_PRs */ = { + isa = PBXGroup; + children = ( + 2A4F34612BF89CDE00868921 /* Case-102.swift */, + ); + path = "Test-Case_PRs"; + sourceTree = ""; + }; 2AA44DBA28A11687001BF8F0 = { isa = PBXGroup; children = ( @@ -57,6 +67,7 @@ 2AA44DC528A11687001BF8F0 /* MultiplatformDemo */ = { isa = PBXGroup; children = ( + 2A4F34622BF89CDE00868921 /* Test-Case_PRs */, 2AA44DC628A11687001BF8F0 /* MultiplatformDemoApp.swift */, 2AA44DC828A11687001BF8F0 /* ContentView.swift */, 2AA44DCA28A11688001BF8F0 /* Assets.xcassets */, @@ -162,6 +173,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 2A4F34632BF89D0500868921 /* Case-102.swift in Sources */, 2AA44DC928A11687001BF8F0 /* ContentView.swift in Sources */, 2AA44DC728A11687001BF8F0 /* MultiplatformDemoApp.swift in Sources */, ); From c77f8964e856f95d6b346e0fc2f43f65a4a21fea Mon Sep 17 00:00:00 2001 From: Seyed Mojtaba Hosseini Zeidabadi Date: Sat, 18 May 2024 11:55:28 +0330 Subject: [PATCH 3/4] fix: correct the modifiers --- Demo/MultiplatformDemo/Test-Case_PRs/Case-102.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Demo/MultiplatformDemo/Test-Case_PRs/Case-102.swift b/Demo/MultiplatformDemo/Test-Case_PRs/Case-102.swift index 4cc5cd5..451cbf0 100644 --- a/Demo/MultiplatformDemo/Test-Case_PRs/Case-102.swift +++ b/Demo/MultiplatformDemo/Test-Case_PRs/Case-102.swift @@ -35,7 +35,7 @@ struct iPhoneNumberFieldTestView: View { RoundedRectangle(cornerRadius: cornerRadius) .stroke(borderColor) ) - .frame(200, 200) + .frame(width: 200, height: 200) .background(Color.white) } } From 4f320f42b477a93169b4451a1b0368138147e960 Mon Sep 17 00:00:00 2001 From: Seyed Mojtaba Hosseini Zeidabadi Date: Sat, 18 May 2024 11:55:45 +0330 Subject: [PATCH 4/4] feat: make it ready for the demo project --- Demo/MultiplatformDemo/Test-Case_PRs/Case-102.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Demo/MultiplatformDemo/Test-Case_PRs/Case-102.swift b/Demo/MultiplatformDemo/Test-Case_PRs/Case-102.swift index 451cbf0..3a5b31a 100644 --- a/Demo/MultiplatformDemo/Test-Case_PRs/Case-102.swift +++ b/Demo/MultiplatformDemo/Test-Case_PRs/Case-102.swift @@ -8,6 +8,7 @@ import iPhoneNumberField import SwiftUI +@available(iOS 15.0, *) /// because of the `textInputAutocapitalization` modifier struct iPhoneNumberFieldTestView: View { var placeholderText: String @Binding var mainText: String @@ -40,6 +41,7 @@ struct iPhoneNumberFieldTestView: View { } } +@available(iOS 15.0, *) struct iPhoneNumberFieldTest: View { @State var number: String = "" var body: some View {