Skip to content

Instantly share code, notes, and snippets.

View hilalbaig's full-sized avatar
🎯
Focusing

Baig hilalbaig

🎯
Focusing
View GitHub Profile
@hilalbaig
hilalbaig / CommentCell.swift
Last active March 1, 2019 05:49
Easy way to automatically manage height for growing UITextView embedded in UITableViewCell instead of manually calculating and providing it for each cell.
protocol CommentCellDelegate: class {
func updateHeight()
}
class CommentCell: UITableViewCell, UITextViewDelegate {
func textViewDidChange(_ textView: UITextView) {
delegate?.updateHeight()
}
}
@hilalbaig
hilalbaig / UINavigationBar+Height.swift
Last active November 13, 2020 19:24 — forked from siberianisaev/UINavigationBar+Height.swift
Change height of UINavigationBar - Swift 3
import Foundation
import UIKit
private var AssociatedObjectHandle: UInt8 = 0
extension UINavigationBar {
var height: CGFloat {
get {
if let h = objc_getAssociatedObject(self, &AssociatedObjectHandle) as? CGFloat {