Skip to content

Instantly share code, notes, and snippets.

View mingsai's full-sized avatar
🎯
Focusing

Tommie N. Carter, Jr. mingsai

🎯
Focusing
View GitHub Profile
// Taken from the commercial iOS PDF framework http://pspdfkit.com.
// Copyright (c) 2013 Peter Steinberger. All rights reserved.
// Licensed under MIT (http://opensource.org/licenses/MIT)
//
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it.
#import <objc/runtime.h>
#import <objc/message.h>
// Compile-time selector checks.
//
// PSPDFThreadSafeMutableDictionary.m
//
// Copyright (c) 2013 Peter Steinberger, PSPDFKit GmbH. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@mingsai
mingsai / MNGImageExtensions-2.swift
Last active February 12, 2016 18:06
A swift extension to create an image from a font with a particular size, and many other image functions.
//
// MNGImageExtensions-2.swift
//
//
// Created by Tommie Carter on 7/2/15.
// Copyright © 2015 MING Technology. All rights reserved.
//
import UIKit
import AVFoundation
@mingsai
mingsai / MNGLayerExtensions.swift
Last active August 29, 2015 14:24
A swift extension that allows one to use gradient colors on all UIControls and UIViews and subviews (e.g. UIButton, etc. pretty much anything on screen)
//
// MNGLayerExtensions.swift
//
//
// Created by Tommie N. Carter, Jr., MBA on 6/21/15.
// Copyright © 2015 MING Technology. All rights reserved.
//
// Sample usage: self.view.layer.configureGradientBackground(UIColor.purpleColor().CGColor, UIColor.blueColor().CGColor, UIColor.whiteColor().CGColor)
// Nota Bene: Function can be applied to any UIControl that also has a view.layer property. Resolves the issue of gradient not covering full area on rotation by resizing the layer to a square
@mingsai
mingsai / DataStore-762015.swift
Last active February 12, 2016 18:18
A data store class to manage extended data operations within a separate controller. Notifications pass relevant messages to observers.
//
// DataStore.swift
//
//
// Created by Tommie N. Carter, Jr., MBA on 6/18/15.
// Copyright (c) 2015 MING Technology. All rights reserved.
// Updated 7/6/2015
// Swift 2.0 compatible
import Foundation
@mingsai
mingsai / MNGTextViewHandler.swift
Created July 2, 2015 23:53
A textview delegate to catch and throw messages as needed by textview events
//
// MNGTextViewHandler.swift
//
//
// Created by Tommie N. Carter, Jr., MBA on 6/18/15.
// Copyright © 2015 MING Technology. All rights reserved.
//
import UIKit
@mingsai
mingsai / MNGTextFieldHandler.swift
Created July 2, 2015 23:54
A textfield delegate used to catch and throw messages related to textfield events
//
// MNGTextFieldHandler.swift
//
//
// Created by Tommie N. Carter, Jr., MBA on 6/18/15.
// Copyright © 2015 MING Technology. All rights reserved.
//
import UIKit
@mingsai
mingsai / MNGCollectionViewHandler.swift
Created July 2, 2015 23:55
A delegate class to handle UICollectionView events
//
// MNGCollectionViewHandler.swift
//
//
// Created by Tommie N. Carter, Jr., MBA on 6/21/15.
// Copyright © 2015 MING Technology. All rights reserved.
//
import UIKit
@mingsai
mingsai / MNGApplicatioNExtensions.swift
Created July 2, 2015 23:57
Extensions to the UIApplication along with a convenient place to store global constants when needed
//
// MNGApplicationExtensions.swift
//
//
// Created by Tommie N. Carter, Jr., MBA on 6/22/15.
// Copyright © 2015 MING Technology. All rights reserved.
//
import UIKit
@mingsai
mingsai / MNGAVAudioSessionExtensions.swift
Created July 2, 2015 23:59
An AVAudioSession delegate to manage audio session events and an extension to the AVAudioSession to manage convenient setup for various audio profiles
//
// MNGAVAudioSessionExtensions.swift
//
//
// Created by Tommie Carter on 6/30/15.
// Copyright © 2015 MING Technology. All rights reserved.
//
import AVFoundation