Skip to content

Instantly share code, notes, and snippets.

Taylor Franklin tfrank64

Block or report user

Report or block tfrank64

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
@tfrank64
tfrank64 / education.swift
Last active Aug 29, 2015
Example playground to show off the visualzations you can get with Swift playgrounds.
View education.swift
// Playground - noun: a place where people can play
import UIKit
import QuartzCore
var str = "Hello, playground"
var nums = [1, 3, 5, 7, 9, 11, 13]
var count = 1
@tfrank64
tfrank64 / AltitudeViewController.swift
Last active Jun 25, 2018
Retrieving data for relative altitude and air pressure with CMAltimeter
View AltitudeViewController.swift
//
// AltitudeViewController.swift
// Altitudes
//
// Created by Taylor Franklin on 10/22/14.
//
import UIKit
import CoreMotion
@tfrank64
tfrank64 / PixelViewController.swift
Last active May 11, 2016
UI experiment using CRPixellatedView and the basic layout of MGSpotyViewController
View PixelViewController.swift
//
// PixelViewController.swift
//
// Created by Taylor Franklin
//
import UIKit
class PixelViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
View Lighten_Color.swift
/// Method that returns a slightly lighter color than the one passed in
///
/// :param: color color is the color we want to make ligter
/// :returns: The lighter color
func lighterColorForColor(color: UIColor) -> UIColor {
var r:CGFloat = 0, g:CGFloat = 0, b:CGFloat = 0, a: CGFloat = 0
if color.getRed(&r, green: &g, blue: &b, alpha: &a) {
return UIColor(red: min(r + colorShadeDifference, 1.0), green: min(g + colorShadeDifference, 1.0), blue: min(b + colorShadeDifference, 1.0), alpha: a)
}
return color
@tfrank64
tfrank64 / swiftTwitter.swift
Created Jul 11, 2014
Swift API Requests with SLRequest
View swiftTwitter.swift
// The following two functions are based on: https://dev.twitter.com/docs/ios/making-api-requests-slrequest
func userHasAccessToTwitter() -> Bool {
return SLComposeViewController.isAvailableForServiceType(SLServiceTypeTwitter)
}
func fetchTimelineForUser(username: String) {
if userHasAccessToTwitter() {
var twitterAccountType: ACAccountType = self.accountStore.accountTypeWithAccountTypeIdentifier(ACAccountTypeIdentifierTwitter)
@tfrank64
tfrank64 / AppDelegate.swift
Created Jun 8, 2014
Swift UITabBar Programmatically
View AppDelegate.swift
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool {
// Override point for customization after application launch.
self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
var nav1 = UINavigationController()
var first = FirstViewController(nibName: nil, bundle: nil)
nav1.viewControllers = [first]
var second = SecondViewController(nibName: nil, bundle: nil)
var nav2 = UINavigationController()
@tfrank64
tfrank64 / sharing.m
Created Mar 7, 2014
Native iOS7 Sharing Dialogs
View sharing.m
// Not full implementation for UIActionSheet, check out my blog for more details: http://cleancrispcode.wordpress.com/
// shareTitles array created in viewDidLoad
NSArray *shareTitles = @[NSLocalizedString(@"Facebook", nil), NSLocalizedString(@"Twitter", nil)];
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
NSString *buttonTitle = [actionSheet buttonTitleAtIndex:buttonIndex];
if ([buttonTitle isEqualToString:shareTitles[0]])
You can’t perform that action at this time.