์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- TCA
- designpattern
- realm
- ๋ฐฑ์ค
- raywenderlich
- UIKit
- BOJ
- ํ๋ก๊ทธ๋๋จธ์ค
- ํจ์คํธ์บ ํผ์ค
- BFS
- RxSwift
- Kuring
- visionOS
- MVVM
- XCTest
- Xcode
- SnapKit
- rxcocoa
- Flutter
- arkit
- tableView
- swift
- CollectionView
- Swfit
- node.js
- SwiftUI
- reactorkit
- ios
- combine
- Lv2
Archives
- Today
- Total
lgvv98
[iOS] UITableView BackgroundView didTapped โจ ๋ณธ๋ฌธ
โ ๏ธ deprecated โ ๏ธ/Calendar
[iOS] UITableView BackgroundView didTapped โจ
๐ฅ ์บ๋ฟ๋งจ 2022. 5. 4. 15:21UITableView BackgroundView didTapped
โ ์ด๋ฒ์๋ ํ ์ด๋ธ ๋ทฐ์์ ์ ๋ฐ๊นฅ ๋ถ๋ถ์ ํฐ์น๋ฅผ ์ ์ฉํ๋ ๋ฐฉ๋ฒ์ ๋ํด์ ์์๋ณด์.
โ ๋ด๊ฐ ํด๊ฒฐํ ๋ฐฉ๋ฒ์ ์ฝ๋๋ ์๊ฐ๋ณด๋ค ๊ฐ๋จํ๋๋ฐ
let tableView = UITableView()
let didTapView = UITapGestureRecognizer(
target: self,
action: #selector(didTapView)
)
tableView.backgroundView = UIView()
tableView.backgroundView?.addGestureRecognizer(didTapView)
@objc
func didTapView() {
print("DidTap")
dismiss(animated: false, completion: nil)
}
stackOverflow์์ ํด๋ต์ ์ฐพ์๋ค.
https://stackoverflow.com/questions/24141254/how-to-detect-tap-on-clear-part-of-uitableview
โ ๋ค๋ง ๋ด๊ฐ ์ง์ง ํ๊ณ ์ถ์๊ฑด ํ ์ด๋ธ ๋ทฐ์ ์ ์ ๊ฐฏ์์ ๋์ด๋ฅผ ๊ณ์ฐํ์ฌ tableView ์์ฒด์ constraints๋ฅผ height์ ๋ง๊ฒ๋ ํ์ฌ backgroundView๊ฐ ๋ํ๋์ง ์๊ฒ๋ ๋ง๋ค๊ณ ์ถ์๋๋ฐ, ๊ทธ๊ฑด ์ด๋ป๊ฒ ํ๋์ง ์ ๋ชจ๋ฅด๊ฒ ๋ค.
ํน์๋ผ๋ ์๋ ์ฌ๋์ด ์๋ค๋ฉด ๋๊ธ ๋ฐ๋๋๋ค:)
'โ ๏ธ deprecated โ ๏ธ > Calendar' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[iOS] UIButton SystemIamge ํฌ๊ธฐ ์กฐ์ (0) | 2022.05.04 |
---|---|
[iOS] Swift Calendar ์ฒซ ๋ ๊ณผ ๋ง์ง๋ง ๋ ์ฐพ๊ธฐ (0) | 2022.05.03 |
[iOS] collectionViewCell ์ฌ์ด์ ๊ณต๋ฐฑ์์ ๊ธฐ (0) | 2022.05.02 |
[iOS15] Device width, height in safeAreaLayoutGuide (0) | 2022.05.02 |
Comments