Skip to content

Instantly share code, notes, and snippets.

Stuart Morris StuartMorris0

Block or report user

Report or block StuartMorris0

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@StuartMorris0
StuartMorris0 / functions.php
Created Jul 3, 2019
Functions PHP - Example for WP Job Manager
View functions.php
<?php
/**
* @author Divi Space
* @copyright 2017
*/
if (!defined('ABSPATH')) die();
function ds_ct_enqueue_parent() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); }
function ds_ct_loadjs() {
View UIView-animateKeyframesWithDuration-example.m
[UIView animateKeyframesWithDuration:5.0 delay:0.0 options:0 animations:^{
[UIView addKeyframeWithRelativeStartTime:0.0 relativeDuration:0.5 animations:^{
self.verticalPosition.constant = 200.0;
[self.view layoutIfNeeded];
}];
[UIView addKeyframeWithRelativeStartTime:0.5 relativeDuration:0.25 animations:^{
self.verticalPosition.constant = 50.0;
[self.view layoutIfNeeded];
}];
[UIView addKeyframeWithRelativeStartTime:0.75 relativeDuration:0.125 animations:^{
@StuartMorris0
StuartMorris0 / Swift-find-constraint-by-identifier.swift
Created Mar 23, 2016
Get reference to a constraint by filtering through all constraints looking for a specific identifier in Swift
View Swift-find-constraint-by-identifier.swift
let foregroundTopConstraint = self.contentView.constraints.filter{ $0.identifier == "ForegroundViewTop"}.first
@StuartMorris0
StuartMorris0 / POP-Completion-sytanx.swift
Created Mar 16, 2016
Facebook POP Completion Block Syntax Swift
View POP-Completion-sytanx.swift
myPopAnimation.completionBlock = {(animation, finished) in
//Code goes here
}
@StuartMorris0
StuartMorris0 / selector_hiding.md
Created Aug 25, 2014
Hiding Selector Warnings for methods declared up the chain of responders.
View selector_hiding.md

With button selectors you can implement the @selector but might choose to implement the method in the View Controller and not the button subclass for example. You will receive an undeclared selector warning for this to let you know the method is not implemented but this is acceptable behaviour, so you can use the following to hide the warnings.

// Ignore undeclared selector warnings as this method is implemented in the VC
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wundeclared-selector"
[moreButton addTarget:nil action: @selector(userPressedShareBasementButton:) forControlEvents: UIControlEventTouchUpInside];
#pragma clang diagnostic pop
@StuartMorris0
StuartMorris0 / CocoaPodsCheatSheet.md
Last active Dec 26, 2015
CocoaPods Cheat Sheet
View CocoaPodsCheatSheet.md

Cocoa Pods Cocoapods Basic Cheat Sheet

Create a Podfile at the root of your project

platform :ios, '5.0'

pod 'AFNetworking'
pod 'OHAttributedLabel'
You can’t perform that action at this time.