Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
manhpham90vn committed Oct 16, 2022
1 parent 0668be6 commit 13d8955
Show file tree
Hide file tree
Showing 10 changed files with 205 additions and 271 deletions.
12 changes: 12 additions & 0 deletions Push Notify.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@
BB13A8C928EE82A90073CFC2 /* ECSignature.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB13A8B528EE7F8B0073CFC2 /* ECSignature.swift */; };
BB13A8CA28EE82AB0073CFC2 /* EllipticCurve.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB13A8B128EE7F8B0073CFC2 /* EllipticCurve.swift */; };
BB13A8CB28EE82AD0073CFC2 /* SSLPointerTricks.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB13A8B228EE7F8B0073CFC2 /* SSLPointerTricks.swift */; };
BB32BD4128F872B90003C085 /* CheckboxView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB32BD4028F872B90003C085 /* CheckboxView.swift */; };
BB480C5D28ED1D7600958F38 /* Push_NotifyApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB480C4C28ED1D7500958F38 /* Push_NotifyApp.swift */; };
BB480C5F28ED1D7600958F38 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB480C4D28ED1D7500958F38 /* ContentView.swift */; };
BB480C6128ED1D7600958F38 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BB480C4E28ED1D7600958F38 /* Assets.xcassets */; };
BB4B51E528FBAA4100EB1657 /* TextFieldView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB4B51E428FBAA4100EB1657 /* TextFieldView.swift */; };
BB4B51E728FBAF6000EB1657 /* SelectFileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB4B51E628FBAF6000EB1657 /* SelectFileView.swift */; };
BBBBD4E328ED6454007CE31E /* Push.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBBBD4E128ED6454007CE31E /* Push.swift */; };
BBCE759128F1CFCF00599AD6 /* APNsPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBCE758F28F1CFCF00599AD6 /* APNsPayload.swift */; };
BBCE759428F1CFEE00599AD6 /* FCMiOSPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBCE759228F1CFEE00599AD6 /* FCMiOSPayload.swift */; };
Expand Down Expand Up @@ -58,11 +61,14 @@
BB13A8B328EE7F8B0073CFC2 /* ASN1.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ASN1.swift; sourceTree = "<group>"; };
BB13A8B428EE7F8B0073CFC2 /* ECEncryptable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ECEncryptable.swift; sourceTree = "<group>"; };
BB13A8B528EE7F8B0073CFC2 /* ECSignature.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ECSignature.swift; sourceTree = "<group>"; };
BB32BD4028F872B90003C085 /* CheckboxView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckboxView.swift; sourceTree = "<group>"; };
BB480C4C28ED1D7500958F38 /* Push_NotifyApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Push_NotifyApp.swift; sourceTree = "<group>"; };
BB480C4D28ED1D7500958F38 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
BB480C4E28ED1D7600958F38 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
BB480C5928ED1D7600958F38 /* Push Notify.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Push Notify.app"; sourceTree = BUILT_PRODUCTS_DIR; };
BB480C5B28ED1D7600958F38 /* macOS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = macOS.entitlements; sourceTree = "<group>"; };
BB4B51E428FBAA4100EB1657 /* TextFieldView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextFieldView.swift; sourceTree = "<group>"; };
BB4B51E628FBAF6000EB1657 /* SelectFileView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectFileView.swift; sourceTree = "<group>"; };
BBBBD4E128ED6454007CE31E /* Push.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Push.swift; sourceTree = "<group>"; };
BBCE758F28F1CFCF00599AD6 /* APNsPayload.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APNsPayload.swift; sourceTree = "<group>"; };
BBCE759228F1CFEE00599AD6 /* FCMiOSPayload.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FCMiOSPayload.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -172,6 +178,9 @@
children = (
BB480C4C28ED1D7500958F38 /* Push_NotifyApp.swift */,
BB480C4D28ED1D7500958F38 /* ContentView.swift */,
BB32BD4028F872B90003C085 /* CheckboxView.swift */,
BB4B51E428FBAA4100EB1657 /* TextFieldView.swift */,
BB4B51E628FBAF6000EB1657 /* SelectFileView.swift */,
);
path = View;
sourceTree = "<group>";
Expand Down Expand Up @@ -259,15 +268,18 @@
BB480C5F28ED1D7600958F38 /* ContentView.swift in Sources */,
BB13A8C628EE82A20073CFC2 /* ECPrivateKey.swift in Sources */,
BB13A8CB28EE82AD0073CFC2 /* SSLPointerTricks.swift in Sources */,
BB32BD4128F872B90003C085 /* CheckboxView.swift in Sources */,
BB13A8C728EE82A50073CFC2 /* ECPublicKey.swift in Sources */,
BBCE759728F1D03B00599AD6 /* FCMAndroidPayload.swift in Sources */,
BBCE759428F1CFEE00599AD6 /* FCMiOSPayload.swift in Sources */,
BB13A8CA28EE82AB0073CFC2 /* EllipticCurve.swift in Sources */,
BB4B51E528FBAA4100EB1657 /* TextFieldView.swift in Sources */,
BBBBD4E328ED6454007CE31E /* Push.swift in Sources */,
BB480C5D28ED1D7600958F38 /* Push_NotifyApp.swift in Sources */,
BB13A8C228EE82990073CFC2 /* Data+Extensions.swift in Sources */,
BB13A8C328EE829B0073CFC2 /* ECDecryptable.swift in Sources */,
BB13A8C828EE82A70073CFC2 /* ECSignable.swift in Sources */,
BB4B51E728FBAF6000EB1657 /* SelectFileView.swift in Sources */,
BBCE759128F1CFCF00599AD6 /* APNsPayload.swift in Sources */,
BBCE759A28F1D38600599AD6 /* SimulatorPayload.swift in Sources */,
BBEFE3A528F1345B00124F7B /* PKCS12.swift in Sources */,
Expand Down
27 changes: 27 additions & 0 deletions Source/View/CheckboxView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// CheckboxView.swift
// Push Notify
//
// Created by Manh Pham on 13/10/2022.
//

import SwiftUI

struct CheckboxView: View {

let text: String
@Binding var isChecked: Bool
let callback: (Bool) -> Void

var body: some View {
HStack {
Button {
isChecked.toggle()
callback(isChecked)
} label: {
Image(systemName: isChecked ? "checkmark.square" : "square")
}
Text(text)
}
}
}
Loading

0 comments on commit 13d8955

Please sign in to comment.