Skip to content

Instantly share code, notes, and snippets.

View SofiaMNC's full-sized avatar

Sofia Chevrolat SofiaMNC

View GitHub Profile
@SofiaMNC
SofiaMNC / WaveSort.swift
Last active June 26, 2023 21:42
WaveSort
import UIKit
// MARK: - IMPLEMENTATION
extension Array where Element: Comparable & Hashable {
// MARK: Internal
/// Solves the problem as requested
/// - Returns The wave sorted array
func solve() -> [Element] {
@SofiaMNC
SofiaMNC / CleanBackwardCompatibility.swift
Last active November 2, 2021 16:13
An example of a back port implementation to facilitate backward compatibility handling in Swift.
//
// Demo.swift
// bedtimefanlite
//
// Created by Sofia Chevrolat on 02/11/2021.
// Inspired by [Dave DeLong's post](https://davedelong.com/blog/2021/10/09/simplifying-backwards-compatibility-in-swift/)
//
// Two small examples of a "backport" implementation to facilitate backward compatibility.
//
// USAGE :