From d37ab0b6fbe7a01795faf09d211cf3964f3507ed Mon Sep 17 00:00:00 2001 From: Jasneet Kaur Date: Sat, 6 May 2023 18:11:20 -0400 Subject: [PATCH] adding checkmarks --- .DS_Store | Bin 0 -> 6148 bytes Project 24 - HitList/.DS_Store | Bin 0 -> 6148 bytes .../HitList.xcodeproj/project.pbxproj | 7 +++++-- .../HitList/ViewController.swift | 11 +++++++++++ 4 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 .DS_Store create mode 100644 Project 24 - HitList/.DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..18e385b00b09297c46f000d3c4d4597d33a311b7 GIT binary patch literal 6148 zcmeHKyGjF55Iv(Q0yZfuEbk9kD1N{aB3M`m{(zWRD1n6}_FMT~ewt?<&9d4AY{D6s zIrq+;bC*5E&JF-uer|4n1%Nr-5nmpr=I8DcJFAQl>Ad3&YaGyUi@Qnn?+NE#;t4zS z_!#jUu6fe~-g)CA;~t02e!YF|`>m5?Qa}nw0VyB_q`*-MR2!XN9K{w%3P^!dR=~dx zjqcbL4vF#UV2BZbIAc1D>zE~o%@f3~a7bi^W=SO`)oR4Bq%+^Dt}7f8lMbul!|KUa z6N<&td4G#?SeK|M1*E`Of%Duhy#L?R|Cs;BB<-Yt6gVjbY_@t{E%{2-TPH8)y|&R` v=w9(T=(Cc6=2@S=W5c^R9463_9~cC+cUwb&*Md|5o4!ypb0| literal 0 HcmV?d00001 diff --git a/Project 24 - HitList/.DS_Store b/Project 24 - HitList/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..a2a1a8e0b3f5a55a887ca115d564c8b156ed131d GIT binary patch literal 6148 zcmeHK%}N6?5dLC&SnyIo!DF64=o_qM1rOeO@ghjOqLr3i|G=9I-h2&Tz?bl`1izU{ ztBZTslZebf=9^4rvdLGPNdSb&LpcUU05UegAV!CXyK`tO1rLcq=UCtl_c*{K<{cCL zMVG972gg`&-6zyv>#tDa0yS6f*tiek2`W{l2uPd{Fs2k(b{ zGs{ip>(kj@|IGU8+e(A{t}f1iGvEw31I|E;0oH7hY}?SaGvEw30~-e9e28p+ml)w+0NNS tB(4#ILR(8QQA;s9a*pilpp8edIi4qM3}qJaYdX;{0!oN0XW$nY_yln?JOKaz literal 0 HcmV?d00001 diff --git a/Project 24 - HitList/HitList.xcodeproj/project.pbxproj b/Project 24 - HitList/HitList.xcodeproj/project.pbxproj index 327570c3..1faa8e9a 100644 --- a/Project 24 - HitList/HitList.xcodeproj/project.pbxproj +++ b/Project 24 - HitList/HitList.xcodeproj/project.pbxproj @@ -196,6 +196,7 @@ TargetAttributes = { 193BC8681C8F4E66003E6D2D = { CreatedOnToolsVersion = 7.2.1; + DevelopmentTeam = 466F2TNFRB; LastSwiftMigration = 1020; }; 193BC87F1C8F4E66003E6D2D = { @@ -429,9 +430,10 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + DEVELOPMENT_TEAM = 466F2TNFRB; INFOPLIST_FILE = HitList/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.yigu.HitList; + PRODUCT_BUNDLE_IDENTIFIER = com.yigu.HitList2oi1o2i; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; }; @@ -441,9 +443,10 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + DEVELOPMENT_TEAM = 466F2TNFRB; INFOPLIST_FILE = HitList/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.yigu.HitList; + PRODUCT_BUNDLE_IDENTIFIER = com.yigu.HitList2oi1o2i; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; }; diff --git a/Project 24 - HitList/HitList/ViewController.swift b/Project 24 - HitList/HitList/ViewController.swift index c846f6ad..6285077d 100644 --- a/Project 24 - HitList/HitList/ViewController.swift +++ b/Project 24 - HitList/HitList/ViewController.swift @@ -53,8 +53,19 @@ class ViewController: UIViewController, UITableViewDataSource { let person = people[indexPath.row] cell.textLabel!.text = person.value(forKey: "name") as? String + cell.accessoryType = cell.isSelected ? .checkmark : .none return cell } + +func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + let cell = tableView.cellForRow(at: indexPath) + if cell?.accessoryType == .checkmark { + cell?.accessoryType = .none + } else { + cell?.accessoryType = .checkmark + } + tableView.deselectRow(at: indexPath, animated: true) +} func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) { switch editingStyle {