Skip to content

Instantly share code, notes, and snippets.

View mspvirajpatel's full-sized avatar
🏠
Working from home

Virajkumar Patel mspvirajpatel

🏠
Working from home
View GitHub Profile
@jakebromberg
jakebromberg / AVAssetTrim.swift
Last active August 16, 2024 15:41 — forked from acj/TrimVideo.swift
Trim video using AVFoundation in Swift
import AVFoundation
import Foundation
extension FileManager {
func removeFileIfNecessary(at url: URL) throws {
guard fileExists(atPath: url.path) else {
return
}
do {
@mspvirajpatel
mspvirajpatel / UIFont+SFUIDisplay.swift
Created August 2, 2017 10:43
Font Extension For Swift
import Foundation
import UIKit
struct SFUIDisplayFontType : OptionSetType
{
let rawValue: Int
init(rawValue: Int) { self.rawValue = rawValue }
static internal let None = SFUIDisplayFontType(rawValue: 0)
static internal let Bold = SFUIDisplayFontType(rawValue: 1)
@mspvirajpatel
mspvirajpatel / BaseButton.swift
Created July 20, 2017 06:46
This is List of Base Button Type. If want to add new type just define in this and Handle that type in BaseButton Class.
//
// BaseButton.swift
// ViewControllerDemo
//
import UIKit
import Font_Awesome_Swift
/**
This is List of Base Button Type. If want to add new type just define in this and Handle that type in BaseButton Class.
@Limon-O-O
Limon-O-O / TransitionCompositionBuilder.swift
Last active August 13, 2024 13:47
Merging videos with cross-fade effect using AVFoundation
//
// TransitionComposition.swift
// MED
//
// Created by Limon on 7/26/16.
// Copyright © 2016 MED. All rights reserved.
//
import AVFoundation
@hotpaw2
hotpaw2 / RecordAudio.swift
Last active October 21, 2024 23:22
Swift Audio Recording class. Reads buffers of input samples from the microphone using the iOS RemoteIO Audio Unit API
//
// RecordAudio.swift
//
// This is a Swift class (updated for Swift 5)
// that uses the iOS RemoteIO Audio Unit
// to record audio input samples,
// (should be instantiated as a singleton object.)
//
// Created by Ronald Nicholson on 10/21/16.
// Copyright © 2017,2019 HotPaw Productions. All rights reserved.
//
// SimpleScrollingStack.swift
// A super-simple demo of a scrolling UIStackView in iOS 9
//
// Created by Paul Hudson on 10/06/2015.
// Learn Swift at www.hackingwithswift.com
// @twostraws
//
import UIKit
@SheffieldKevin
SheffieldKevin / compareimages.swift
Last active February 26, 2023 18:33
A couple of swift functions for comparing two CGImage using CIImage in OS X
/**
@brief Returns true if images have same meta. Width, Height, bit depth.
@discussion Assumes images are non null.
*/
func doImagesHaveSameMeta(#image1:CGImage, #image2:CGImage) -> Bool {
if CGImageGetWidth(image1) != CGImageGetWidth(image2) {
return false
}
if CGImageGetHeight(image1) != CGImageGetHeight(image2) {