2020-07-24 19:26:35 -07:00
|
|
|
//
|
|
|
|
|
// CGPoint+Utils.swift
|
|
|
|
|
// SBrowser
|
|
|
|
|
//
|
|
|
|
|
// Created by James Magahern on 7/23/20.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
|
|
|
|
|
|
extension CGRect
|
|
|
|
|
{
|
|
|
|
|
var center: CGPoint {
|
|
|
|
|
get {
|
|
|
|
|
return CGPoint(x: size.width / 2.0, y: size.height / 2.0)
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-07-29 14:16:25 -07:00
|
|
|
|
|
|
|
|
public func avoiding(verticalInsets insets: UIEdgeInsets) -> CGRect {
|
|
|
|
|
var rect = self
|
|
|
|
|
rect.origin.y += insets.top
|
|
|
|
|
rect.size.height -= insets.top
|
|
|
|
|
|
|
|
|
|
return rect
|
|
|
|
|
}
|
2020-07-24 19:26:35 -07:00
|
|
|
}
|