Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions iOSTestApp/iOSTestApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
E636554F29D4086F00307D70 /* String+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = E636554E29D4086F00307D70 /* String+Extension.swift */; };
E636555129D4087600307D70 /* ContentViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = E636555029D4087600307D70 /* ContentViewModel.swift */; };
E636555529D4111700307D70 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E636555429D4111600307D70 /* ContentView.swift */; };
E6655F2229EC23360017F712 /* CheckboxView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6655F2129EC23360017F712 /* CheckboxView.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -48,6 +49,7 @@
E636554E29D4086F00307D70 /* String+Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+Extension.swift"; sourceTree = "<group>"; };
E636555029D4087600307D70 /* ContentViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContentViewModel.swift; sourceTree = "<group>"; };
E636555429D4111600307D70 /* ContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
E6655F2129EC23360017F712 /* CheckboxView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckboxView.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -102,6 +104,7 @@
E636552229D34BAF00307D70 /* iOSTestAppApp.swift */,
E636555029D4087600307D70 /* ContentViewModel.swift */,
E636555429D4111600307D70 /* ContentView.swift */,
E6655F2129EC23360017F712 /* CheckboxView.swift */,
E636552629D34BB000307D70 /* Assets.xcassets */,
E636552829D34BB000307D70 /* Preview Content */,
);
Expand Down Expand Up @@ -266,6 +269,7 @@
E636555129D4087600307D70 /* ContentViewModel.swift in Sources */,
E636554F29D4086F00307D70 /* String+Extension.swift in Sources */,
E636555529D4111700307D70 /* ContentView.swift in Sources */,
E6655F2229EC23360017F712 /* CheckboxView.swift in Sources */,
E636552329D34BAF00307D70 /* iOSTestAppApp.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -428,6 +432,7 @@
DEVELOPMENT_TEAM = K7XJG666ZW;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSCameraUsageDescription = "Requires access to your phone’s camera.";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
Expand Down Expand Up @@ -457,6 +462,7 @@
DEVELOPMENT_TEAM = K7XJG666ZW;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSCameraUsageDescription = "Requires access to your phone’s camera.";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
Expand Down
37 changes: 37 additions & 0 deletions iOSTestApp/iOSTestApp/CheckboxView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// CheckBoxView.swift
// SwiftUI Boilerplate
//
// Created by Purvesh Dodiya on 28/02/23.
//

import SwiftUI

struct CheckBoxView: View {

// MARK: - Variables
@Binding var isChecked: Bool
}

// MARK: - Body
extension CheckBoxView {
var body: some View {
ZStack {
Rectangle()
.frame(width: 25, height: 25, alignment: .topLeading)
.foregroundColor(isChecked ? Color.red : Color.white)
.overlay(
RoundedRectangle(cornerRadius: 4)
.stroke(isChecked ? Color.brown : Color.blue, lineWidth: 3)
)
.cornerRadius(4)

Image(systemName: "check")
.font(.system(size: 20, weight: .bold, design: .default))
.foregroundColor(Color.white)
.onTapGesture {
self.isChecked.toggle()
}
}
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AIReviewRadar

The patch for iOSTestApp/iOSTestApp/CheckboxView.swift looks good. It follows the Swift style guidelines and there are no issues with the code formatting or syntax.

Please note that this file should not be added to the gitignore list for iOS.