Skip to content

Instantly share code, notes, and snippets.

@olKull
olKull / UITextViewPlaceholder.swift
Created August 24, 2020 16:25 — forked from tijme/UITextViewPlaceholder.swift
The correct way to implement a placeholder in a UITextView (Swift)
//
// UITextViewPlaceholder.swift
// TextViewPlaceholder
//
// Copyright (c) 2017 Tijme Gommers <tijme@finnwea.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@olKull
olKull / CGFloat+normalization.swift
Created August 31, 2020 13:28 — forked from mcichecki/CGFloat+normalization.swift
Normalized value of CGFloat between two values
extension CGFloat {
func normalize(min: CGFloat, max: CGFloat, from a: CGFloat = 0, to b: CGFloat = 1) -> CGFloat {
return (b - a) * ((self - min) / (max - min)) + a
}
}
@olKull
olKull / Switch.swift
Created November 23, 2020 09:00 — forked from nathantannar4/Switch.swift
Re-Engineering UISwitch
//
// Switch.swift
// Re-Engineering UISwitch
//
// Created by Nathan Tannar on 15/12/18.
// Copyright © 2018 Nathan Tannar. All rights reserved.
//
import UIKit