Skip to content

Instantly share code, notes, and snippets.

@fruitcoder
fruitcoder / CA+Extensions.swift
Last active September 17, 2021 16:23
Returns the simulator drag coefficient when Slow Animations are enabled, otherwise (and non simulator builds) 1.0
import UIKit
#if targetEnvironment(simulator)
@_silgen_name("UIAnimationDragCoefficient") func UIAnimationDragCoefficient() -> Float
func simulatorDragCoefficient() -> CFTimeInterval {
let drag = UIAnimationDragCoefficient()
if drag > 1 {
return CFTimeInterval(drag)
}
return 1
@fruitcoder
fruitcoder / wait_for_ios_version.rb
Last active September 14, 2018 13:42
This script waits for a new version and sends a local notification via AppleScript when it's available on the App Store
#!/usr/bin/ruby
# It's so annoying that the 'Ready for Sale' status on AppStoreConnect doesn't mean that the app
# is available for your users, since the cache might not have been invalidated yet.
# This is why I created this script to run and scrape the App Store page of an app and its currently live version.
# Once the expected version is live, a local notification is sent. This can be easily extended to send a Slack message via a web hook.
require 'open-uri'
require 'nokogiri'
@fruitcoder
fruitcoder / gist:e3895060644d35b1b7c55bb87ce8919e
Created December 2, 2016 11:09
Adding loading and reloading UI to everything owning a UIView
````
import UIKit
import Foundation
public protocol LoadStateIndicating {
/// Shows a blur view over the current context with an animated activity indicator.
func startLoading()
/// Hides blur view and activity indicator.
func stopLoading()