This file contains hidden or 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
| // Pure function | |
| func sum(_ num1: Int, _ num2: int) -> Int { | |
| return num1 + num2 | |
| } | |
| // Impure function | |
| var accumulated = 0 | |
| func add(_ num: Int) -> Int { | |
| accumulated = num + accumulated |
This file contains hidden or 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
| import UIKit | |
| class VerticalScrollableStackViewController: UIViewController { | |
| let scrollView: UIScrollView = UIScrollView(frame: .zero) | |
| let stackView: UIStackView = UIStackView(frame: .zero) | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| self.view.backgroundColor = .gray |
This file contains hidden or 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
| var shouldLogTextAnalyzer = false | |
| if ProcessInfo.processInfo.environment["text_analyzer_log"] == "verbose" { | |
| shouldLogTextAnalyzer = true | |
| } | |
| if shouldLogTextAnalyzer { | |
| /// Actual logger code | |
| } |
This file contains hidden or 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
| var shouldLogTextAnalyzer = false | |
| if ProcessInfo.processInfo.environment["text_analyzer_log"] == "verbose" { | |
| shouldLogTextAnalyzer = true | |
| } | |
| if shouldLogTextAnalyzer { | |
| /// Actual logger code | |
| } |
OlderNewer