diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 00000000..18e385b0 Binary files /dev/null and b/.DS_Store differ diff --git a/Project 24 - HitList/.DS_Store b/Project 24 - HitList/.DS_Store new file mode 100644 index 00000000..a2a1a8e0 Binary files /dev/null and b/Project 24 - HitList/.DS_Store differ 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 {