mirror of
https://github.com/zhigang1992/GitHawk.git
synced 2026-06-17 02:52:01 +08:00
28 lines
658 B
Swift
28 lines
658 B
Swift
//
|
|
// UICollectionViewCell+SafeAreaContentView.swift
|
|
// Freetime
|
|
//
|
|
// Created by Ryan Nystrom on 10/16/17.
|
|
// Copyright © 2017 Ryan Nystrom. All rights reserved.
|
|
//
|
|
|
|
import UIKit
|
|
|
|
extension UICollectionViewCell {
|
|
|
|
func layoutContentViewForSafeAreaInsets() {
|
|
layoutContentViewForSafeAreaInsets(bounds: self.bounds)
|
|
}
|
|
|
|
func layoutContentViewForSafeAreaInsets(bounds: CGRect) {
|
|
let insets: UIEdgeInsets = safeAreaInsets
|
|
contentView.frame = CGRect(
|
|
x: insets.left,
|
|
y: bounds.minY,
|
|
width: bounds.width - insets.left - insets.right,
|
|
height: bounds.height
|
|
)
|
|
}
|
|
|
|
}
|