Last active
July 25, 2016 07:42
-
-
Save artemkrachulov/ec923f20b8f2c3f42dd592fae4c3f8f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment