Skip to content

Instantly share code, notes, and snippets.

View Coder-ACJHP's full-sized avatar
🐞
Creating buggy programs

Onur Işık Coder-ACJHP

🐞
Creating buggy programs
View GitHub Profile
import Foundation
import Foundation
import AVFoundation
class AudioSplitter {
var filePrepend: String = "file://"
var fileSeparator: Character = "."
var fileSplitAppend: String = "-split-"
@atereshkov
atereshkov / swift-5-resumable-timer.swift
Created August 19, 2019 14:39
Swift 5 Resumable Timer
class ResumableTimer: NSObject {
private var timer: Timer? = Timer()
private var callback: () -> Void
private var startTime: TimeInterval?
private var elapsedTime: TimeInterval?
// MARK: Init
//
// TYAudioVideoManager.swift
// Yash Thaker
//
// Created by Yash Thaker on 05/12/18.
// Copyright © 2018 Yash Thaker. All rights reserved.
//
/*
1) mergeVideos(videoUrls: [URL], exportUrl: URL, preset: String? = nil, progress: @escaping Progress, completion: @escaping Completion)
@Tulakshana
Tulakshana / MovieTransitionsVC.swift
Last active January 12, 2023 08:25 — forked from SheffieldKevin/movietransitions.swift
Make a movie with transitions with AVFoundation and swift. Add an UIActivityIndicatorView and an UIButton and connect appropriately. You will also need to attach few videos to the project.
//
// MovieTransitionsVC.swift
// VideoAnimations
//
// Created by Tula on 2018-06-14.
// Copyright © 2018 Tula. All rights reserved.
//
import UIKit
import AVFoundation
@fousa
fousa / FairPlayer.swift
Last active June 1, 2023 12:28
Integrate HLS with FairPlay.
class FairPlayer: AVPlayer {
private let queue = DispatchQueue(label: "com.icapps.fairplay.queue")
func play(asset: AVURLAsset) {
// Set the resource loader delegate to this class. The `resourceLoader`'s delegate will be
// triggered when FairPlay handling is required.
asset.resourceLoader.setDelegate(self, queue: queue)
// Load the asset in the player.
@powhu
powhu / GIF2MP4.swift
Last active December 28, 2023 22:41
Swift 5.0 GIF to MP4
//
// GIF2MP4.swift
//
// Created by PowHu Yang on 2020/4/24.
// Copyright © 2020 PowHu Yang. All rights reserved.
//
/* How to use
let data = try! Data(contentsOf: Bundle.main.url(forResource: "gif", withExtension: "gif")!)
let tempUrl = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent("temp.mp4")
@cemolcay
cemolcay / ArcTextLayer.swift
Created January 22, 2017 22:03
Draws a curved string on a CALayer with angle, radius and text that you give.
import UIKit
// swift port of stackoverflow answer
// http://stackoverflow.com/a/31301238/2048130
extension CGFloat {
/** Degrees to Radian **/
var degrees: CGFloat {
return self * (180.0 / .pi)
}
@tadija
tadija / FontNames-iOS-17.4.swift
Last active April 30, 2024 00:30
iOS - All Font Names
/*
*** Academy Engraved LET ***
AcademyEngravedLetPlain
---------------------
*** Al Nile ***
AlNile
AlNile-Bold
---------------------
*** American Typewriter ***
AmericanTypewriter
@akesson
akesson / iOSUIImageArray2Video.swift
Last active August 31, 2022 12:45
[iOS] UIImage array 2 Video
//http://stackoverflow.com/questions/3741323/how-do-i-export-uiimage-array-as-a-movie/3742212#3742212
import AVFoundation
import UIKit
import Photos
struct RenderSettings {
var width: CGFloat = 1334
var height: CGFloat = 750
@mmorris
mmorris / wwdc_2012_urls.txt
Created July 7, 2016 13:41
WWDC 2012 HD video URL list
https://developer.apple.com/devcenter/download.action?path=/videos/wwdc_2012__hd/session_307__building_great_newsstand_apps.mov
https://developer.apple.com/devcenter/download.action?path=/videos/wwdc_2012__hd/session_311__building_and_distributing_custom_b2b_apps_for_ios.mov
https://developer.apple.com/devcenter/download.action?path=/videos/wwdc_2012__hd/session_304__events_and_reminders_in_event_kit.mov
https://developer.apple.com/devcenter/download.action?path=/videos/wwdc_2012__hd/session_300__getting_around_using_map_kit.mov
https://developer.apple.com/devcenter/download.action?path=/videos/wwdc_2012__hd/session_306__integrating_with_facebook_twitter_and_sina_weibo.mov
https://developer.apple.com/devcenter/download.action?path=/videos/wwdc_2012__hd/session_301__introducing_passbook_part_1.mov
https://developer.apple.com/devcenter/download.action?path=/videos/wwdc_2012__hd/session_309__introducing_passbook_part_2.mov
https://developer.apple.com/devcenter/download.action?path=/videos/wwdc_2012__hd/session_3