Skip to content

Instantly share code, notes, and snippets.

Avatar
🇺🇦

Ilya Kharlamov ilia3546

🇺🇦
View GitHub Profile
@ilia3546
ilia3546 / UIColor+Blend.swift
Created January 19, 2023 11:32
Blending two UIColor's. Swift implementation of JordanDelcros's JS algorithm https://gist.github.com/JordanDelcros/518396da1c13f75ee057
View UIColor+Blend.swift
import UIKit
public extension UIColor {
/**
Blend current color with some overlay
Source - [JordanDelcros's JS algorithm](https://gist.github.com/JordanDelcros/518396da1c13f75ee057)
*/
func blended(with overlay: UIColor) -> UIColor {
@ilia3546
ilia3546 / UIStatusBarManager+ScrollToTop.swift
Last active December 22, 2022 08:55
Tap simulation on UIStatusBar for manual scrolling to top. Dangerous - Private API!
View UIStatusBarManager+ScrollToTop.swift
import UIKit
public extension UIStatusBarManager {
func scrollToTop() {
let selector = NSSelectorFromString("handleTapAction:")
let action = UIStatusBarTapAction()
perform(selector, with: action)
}
}