diff --git a/Demo/MultiplatformDemo/Test-Case_PRs/Case-102.swift b/Demo/MultiplatformDemo/Test-Case_PRs/Case-102.swift new file mode 100644 index 0000000..3a5b31a --- /dev/null +++ b/Demo/MultiplatformDemo/Test-Case_PRs/Case-102.swift @@ -0,0 +1,50 @@ +// +// iPhoneNumberFieldTest.swift +// Neuro20 PRO (iOS) +// +// Created by Emil Kaczmarek on 16/05/2024. +// + +import iPhoneNumberField +import SwiftUI + +@available(iOS 15.0, *) /// because of the `textInputAutocapitalization` modifier +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(width: 200, height: 200) + .background(Color.white) + } +} + +@available(iOS 15.0, *) +struct iPhoneNumberFieldTest: View { + @State var number: String = "" + var body: some View { + iPhoneNumberFieldTestView(placeholderText: "GOTACHA", mainText: $number) + } +} 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 */, );