Skip to content

Instantly share code, notes, and snippets.

View Calendar Guts Gist
import Cocoa
class ViewController: NSViewController,NSCollectionViewDelegate,NSCollectionViewDataSource,NSCollectionViewDelegateFlowLayout {
private let concurrentQueue = DispatchQueue(label: "calendarQueue", attributes: .concurrent)
//next 2 variables or speed and smoothness in loading
private var currentSection : Int!
private var currentOffset = 0
private let calendar = Calendar.current
View gist:1f1e5ae1d4b98468aa7947d66297f28c
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
View gist:d59b940df8055068ad9a0278fdaf859e
import React, { Component } from 'react';
import {
View,
PanResponder,
Animated,
} from 'react-native';
class Draggable extends Component {
constructor(props){
View gist:60bcf2f97e8eced0381bc7ab9208ee7f
//
// PathView.swift
//
// Created by Alex Gibson on 7/23/17.
// Copyright © 2017 AG. All rights reserved.
//
import UIKit
@IBDesignable
@agibson73
agibson73 / CutOutBluredText
Last active Jun 13, 2017
Animated Text CGPath with an image background
View CutOutBluredText
import UIKit
import CoreMotion
@IBDesignable
class CutOutBluredText: UIView {
@IBInspectable var backgroundImage : UIImage? = nil{
didSet{
setUp()
}
View CAAnimations
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
[self longAnimation];
}
View gist:adc79b6f06d2fc92a93a9cc75ca5ec68
//In the controllers to not rotate
override var shouldAutorotate : Bool {
return false
}
override var supportedInterfaceOrientations : UIInterfaceOrientationMask {
return UIInterfaceOrientationMask.portrait
}
//otherwise i did not change anything. and as long as all orientations are supported if you don't set above it will rotate.
// on dismiss i think it reoriented but i might have ask for layout or something cannot remember.
View Change image at the end
CATransaction.begin()
let animation = CABasicAnimation(keyPath: "position")
animation.toValue = NSValue(cgPoint: CGPoint(x: self.view.bounds.width - 100, y: self.view.bounds.height - 100))
animation.fromValue = NSValue(cgPoint: position)
animation.duration = 5
animation.isRemovedOnCompletion = false
animation.fillMode = kCAFillModeForwards
CATransaction.setCompletionBlock({
self.airplane.layer.position = CGPoint(x: self.view.bounds.width - 100, y: self.view.bounds.height - 100)
@agibson73
agibson73 / PulseTouchCollectionViewCell
Created Mar 12, 2017
Just a UICollectionview cell animation on touch although it could be performed on any uiview.
View PulseTouchCollectionViewCell
import UIKit
@IBDesignable class PulseTouchCollectionViewCell: UICollectionViewCell {
@IBInspectable var scaleFactor : CGFloat = 1.3
@IBInspectable var animationColor : UIColor = UIColor.green
@IBInspectable var startingOpacity : Float = 0.2
@IBInspectable var animationDuration : Double = 0.8
View Help
#import "SettingsViewController.h"
#import "HomeViewController.h"
#import "AppDelegate.h"
#import "Location+CoreDataClass.h"
#import "LocationManager.h"
#import "DarkSkyAPI.h"
@interface SettingsViewController ()<UISearchBarDelegate>