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
Binary file added .DS_Store
Binary file not shown.
Binary file added Project 24 - HitList/.DS_Store
Binary file not shown.
7 changes: 5 additions & 2 deletions Project 24 - HitList/HitList.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@
TargetAttributes = {
193BC8681C8F4E66003E6D2D = {
CreatedOnToolsVersion = 7.2.1;
DevelopmentTeam = 466F2TNFRB;
LastSwiftMigration = 1020;
};
193BC87F1C8F4E66003E6D2D = {
Expand Down Expand Up @@ -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;
};
Expand All @@ -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;
};
Expand Down
11 changes: 11 additions & 0 deletions Project 24 - HitList/HitList/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down