Skip to content

Instantly share code, notes, and snippets.

View tobitech's full-sized avatar
🌎
Changing the World

Tobi Omotayo tobitech

🌎
Changing the World
View GitHub Profile
import UIKit
import StreamingKit
private let singletonInstance = NineInchAudio()
class NineInchAudio {
class var manager: NineInchAudio {
return singletonInstance
}
@tobitech
tobitech / Xcode.txt
Created January 11, 2017 08:32 — forked from tangzhen/Xcode.txt
git ignore file for Xcode
#########################
# update 4 June 2014
# ignore Pods folder and Podfile.lock
#########################
Pods
Podfile.lock
#########################
# https://gist.github.com/foundry/4383910
@tobitech
tobitech / MultipartForm.h
Last active February 20, 2017 21:13
Multipart form for uploading data over HTTP
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
/**
* Represents a multi-part for uploading data over HTTP.
*/
@interface CFMultipartForm : NSObject
/**
* Add a simple form name-value pair
@tobitech
tobitech / textHeight.m
Created February 27, 2017 11:50 — forked from brennanMKE/textHeight.m
Text Height in Objective-C for NSString and NSAttributedString
- (CGFloat)heightForAttributedString:(NSAttributedString *)text maxWidth:(CGFloat)maxWidth {
if ([text isKindOfClass:[NSString class]] && !text.length) {
// no text means no height
return 0;
}
NSStringDrawingOptions options = NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading;
CGSize size = [text boundingRectWithSize:CGSizeMake(maxWidth, CGFLOAT_MAX) options:options context:nil].size;
@tobitech
tobitech / CFCustomeImageView.h
Last active May 19, 2017 15:12
This is a UIImageView Subclass that has caching support. Good for use in TableViews and CollectionViews cells
//
// CFCustomeImageView.h
//
// Created by Tobi Omotayo on 24/10/2016.
// Copyright © 2016 Tobi Omotayo. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface CFCustomeImageView : UIImageView {
@tobitech
tobitech / StickyHeadersCollectionViewFlowLayout.swift
Last active April 28, 2017 10:51
Custom collection view layout that makes headers stick
//
// CFStickyHeadersCollectionViewFlowLayout.swift
// Ceflix
//
// Created by Tobi Omotayo on 08/02/2017.
// Copyright © 2017 Tobi Omotayo. All rights reserved.
//
import UIKit
<html>
<head>
<title>API Example</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
var accessToken = "<your agent's client access token>";
var baseUrl = "https://api.api.ai/v1/";
@tobitech
tobitech / Constants.swift
Created January 9, 2018 11:05
A Sample Swift file for keeping your Projects Constants
import Foundation
import UIKit
struct Colors {
static let brightOrange = UIColor(red: 255.0/255.0, green: 69.0/255.0, blue: 0.0/255.0, alpha: 1.0)
static let red = UIColor(red: 255.0/255.0, green: 115.0/255.0, blue: 115.0/255.0, alpha: 1.0)
static let brandColor = UIColor(red: 255.0/255.0, green: 115.0/255.0, blue: 115.0/255.0, alpha: 1.0)
static let secondaryColor = UIColor(red: 255.0/255.0, green: 115.0/255.0, blue: 115.0/255.0, alpha: 1.0)
static let darkColor = UIColor(red: 255.0/255.0, green: 115.0/255.0, blue: 115.0/255.0, alpha: 1.0)
}
import UIKit
import XCTest
import MapKit
class ExampleTests: XCTestCase {
//declaring the ViewController under test as an implicitly unwrapped optional
var viewControllerUnderTest : ViewController!
override func setUp() {
@tobitech
tobitech / Camera.swift
Created July 24, 2018 10:16
A simple class abstracting display of photo, video selection or capture from user's device
//
// Camera.swift
// Tobi Omotayo
//
// Created by Oluwatobi Omotayo on 20/07/2018.
// Copyright © 2018 Oluwatobi Omotayo. All rights reserved.
//
import UIKit
import MobileCoreServices