swift CGSize + Geometry.swift
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了swift CGSize + Geometry.swift相关的知识,希望对你有一定的参考价值。
//
// CGSize+Geometry.swiftt
//
// Created by Artem Krachulov.
// Copyright (c) 2016 Artem Krachulov. All rights reserved.
// http://www.artemkrachulov.com
//
import UIKit
// MARK: - Geometry
extension CGSize {
/// Return size where width and height property increased by multiplier times.
///
/// Usage:
///
/// var size = CGSizeMake(500, 200)
/// size.increaseBy(multiplier: 10) // {w 5,000 h 2,000}
///
public func increaseBy(multiplier multiplier: CGFloat) -> CGSize {
return CGSizeMake(width * multiplier, height * multiplier)
}
public func increase(byDx dx: CGFloat, dy: CGFloat) -> CGSize {
return CGSizeMake(width + dx, height + dy)
}
}
以上是关于swift CGSize + Geometry.swift的主要内容,如果未能解决你的问题,请参考以下文章