Skip to content

Instantly share code, notes, and snippets.

@ryanpato
ryanpato / XCUIElement+Wait.swift
Last active May 24, 2024 07:57
XCUIElement+Wait
//
// XCUIElement+Wait.swift
//
// Created by Ryan Paterson on 12/12/2020.
//
import XCTest
extension XCUIElement {
/// The period of time in seconds to wait explicitly for expectations.
@HarshilShah
HarshilShah / FetchResult.swift
Created July 15, 2020 13:32
A wrapper around PHFetchResult that conforms to various Swift sequence protocols
import Photos
final class FetchResult<Object: AnyObject> {
let phFetchResult: PHFetchResult<Object>
init(_ phFetchResult: PHFetchResult<Object>) {
self.phFetchResult = phFetchResult
}
}
@javiersuazo
javiersuazo / merge.m
Created March 9, 2017 01:40
Merge videos on ios with audio and right orientation.
#import "MKOVideoMerge.h"
#import <AVFoundation/AVFoundation.h>
@implementation MKOVideoMerge
+ (void)mergeVideoFiles:(NSArray *)fileURLs
completion:(void(^)(NSURL *mergedVideoFile, NSError *error))completion {
NSLog(@"Start merging video files ...");
@miguellara
miguellara / UIViewAnimationCurve-to-UIViewAnimationOptions.swift
Created November 20, 2015 22:55
UIViewAnimationCurve to UIViewAnimationOptions
import UIKit
func viewAnimationOptionForCurve(curve: UIViewAnimationCurve) -> UIViewAnimationOptions {
switch (curve) {
case .EaseInOut:
return UIViewAnimationOptions.CurveEaseInOut
case .EaseIn:
return UIViewAnimationOptions.CurveEaseIn
case .EaseOut:
return UIViewAnimationOptions.CurveEaseOut