Skip to content

Instantly share code, notes, and snippets.

@lilianerhan
lilianerhan / CircleShaderWithMask.shader
Created December 13, 2017 18:05
Circle shader that uses RectMask2D
Shader "Unlit/CircleWithMask"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
[Enum(Low,0,Medium,1,High,2)] _Quality ("Quality", Int) = 1
}
SubShader
{
@lilianerhan
lilianerhan / UIView+CustomTimingFunction.h
Created February 28, 2017 13:42 — forked from nuthinking/UIView+CustomTimingFunction.h
UIView Custom Timing Functions
//
// UIView+CustomTimingFunction.h
// Instants
//
// Created by Christian Giordano on 16/10/2013.
// Copyright (c) 2013 Christian Giordano. All rights reserved.
//
#import <UIKit/UIKit.h>
@lilianerhan
lilianerhan / Image.m
Created November 22, 2016 11:05
iOS: How to retrieve image dimensions without loading into memory
#import <ImageIO/ImageIO.h>
- (CGSize)sizeOfImageAtURL:(NSURL *)imageURL
{
CGSize imageSize = CGSizeZero;
CGImageSourceRef imageSource = CGImageSourceCreateWithURL((CFURLRef)imageURL, NULL);
if (imageSource == NULL) return imageSize;
NSDictionary *options = @{(NSString *)kCGImageSourceShouldCache : @(NO)};