Last active
October 25, 2019 08:52
-
-
Save bitbreakr/c281013dc16ea53d70d072edb2663b84 to your computer and use it in GitHub Desktop.
Swift: Int incrementation
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
// | |
// Int.swift | |
// | |
// Created by Yan Philippe on 4/22/19. | |
// Copyright © 2019 Yan Philippe. All rights reserved. | |
// | |
import Foundation | |
extension Int { | |
mutating func increment(with value: Int = 1) -> Void { | |
self = self + value | |
} | |
mutating func decrement(with value: Int = 1) -> Void { | |
self = self - value | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment