Rename to rossler\\attix

This commit is contained in:
James Magahern
2020-07-31 17:35:03 -07:00
parent 030c1db45c
commit c723b3de88
30 changed files with 25 additions and 207 deletions

View File

@@ -0,0 +1,32 @@
//
// 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)
}
}
public func avoiding(verticalInsets insets: UIEdgeInsets) -> CGRect {
var rect = self
rect.origin.y += insets.top
rect.size.height -= insets.top
return rect
}
public func centeredY(inRect: CGRect) -> CGRect {
var rect = self
rect.origin.y = CGRound((inRect.height - rect.height) / 2.0)
return rect
}
}