I have simple UITableView with some data. The table\'s height is greater than the screen size. Now I need to catch screenshot of this table (a whole table). I k
My solution for Swift 4 !
import Foundation
import UIKit
extension UITableView {
func asFullImage() -> UIImage? {
guard self.numberOfSections > 0, self.numberOfRows(inSection: 0) > 0 else {
return nil
}
self.scrollToRow(at: IndexPath(row: 0, section: 0), at: .top, animated: false)
var height: CGFloat = 0.0
for section in 0..