일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Firebase authentication apple login 최신
- Firebase authentication android apple login
- no such module '__ObjC'
- Spring google SMTP settings
- invite user for supabase project
- 소개팅앱 만들기
- DT_TOOLCHAIN_DIR cannot be used
- supabase storage public url not working
- Spring LocalDateTime response array
- 소개팅앱 만들기 flutter
- stable-diffusion-webui local 네트워크에서 접속
- Supabase edge function
- Firebase authentication android apple login setting
- Android apple login identifier
- Android apple login 인증서 설정
- Stomp user connection event
- supabase storage feature not enabled for this tenant
- Firebase authentication apple login
- Android apple login
- 주 4일 근무제
- Stomp socket connection event
- 주 4일 근무제 log
- 주 4일 근무제 경험담
- 로컬 서버 접속
- Spring boot swagger blank screen
- supabase edge function deploy error supabaseurl is required
- Supabase edge function insert data
- stable-diffusion-webui local 접속
- 소개팅앱 만들기 stomp
- supabase edge function deploy error
- Today
- Total
꿀맛코딩
iOS WKWebView dynamic height (iOS WKWebView 동적 높이) 본문
WKWebView height 를 가져와서
TableView Item의 height를 동적으로 변경 하고 싶다면,
아래의 코드를 사용하면 된다.
var webViewHeight: CGFloat = 40
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
webView.evaluateJavaScript("document.readyState", completionHandler: { (complete, error) in
if complete != nil {
webView.evaluateJavaScript("document.body.scrollHeight", completionHandler: { (height, error) in
self.webViewHeight = webView.scrollView.contentSize.height
})
}
})
}
위에서 가져온 높이는 아래처럼 TableView 의 높이 계산에 사용할수 있다.
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
switch headerList[indexPath.section] {
case .header_content:
return indexPath.row == 0 ? webViewHeight : 76
}
}