Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@voxels
voxels / VideoConverter.swift
Last active February 22, 2024 10:58
Video Converter to Spatial
//
// VideoConverter.swift
// SpatialVideoConverter
//
// Created by Michael A Edgcumbe on 2/21/24.
//
import Foundation
import AVFoundation
import VideoToolbox
@voxels
voxels / PlaceSearchSession
Created March 19, 2023 15:35
CloudKit fetching of API Keys
//
// PlacesSearchSession.swift
// No Maps
//
// Created by Michael A Edgcumbe on 3/19/23.
//
import Foundation
import CloudKit
@voxels
voxels / priceless_lost_and_found.md
Last active July 12, 2019 23:43
Priceless Lost and Found
@voxels
voxels / LaunchController.swift
Created August 14, 2018 17:11
LaunchController
//
// LaunchController.swift
// ToyPhotoGallery
//
// Created by Voxels on 7/2/18.
// Copyright © 2018 Michael Edgcumbe. All rights reserved.
//
import UIKit
@voxels
voxels / scrollViewDidScroll.swift
Last active August 2, 2018 20:09
Transforming a UICollectionViewCell during scrollViewDidScroll with a CGAffineTransform
func scrollViewDidScroll(_ scrollView: UIScrollView) {
if scrollDirection == .horizontal {
calculateTransforms(with:scrollView.contentOffset)
}
}
func calculateTransforms(with offset:CGPoint) {
guard let collectionView = collectionView else {
return
}
@voxels
voxels / GalleryViewController_excerpt.swift
Last active August 2, 2018 17:59
An example of animateCollectionViews, a method to swap out two collection views located in the same container
// MARK: - Animation
extension GalleryViewController {
func animateCollectionViews(preview:Bool, with indexPath:IndexPath?) {
guard let oldCollectionView = collectionView, let collectionViewModel = oldCollectionView.model else {
return
}
let angle = CGFloat(Measurement(value: 90, unit: UnitAngle.degrees)
.converted(to: .radians).value)
45  861.0  ToyPhotoGallery (2769) :0
44  361.0  Main Thread  0x14aa88 :0
43 libdyld.dylib 303.0  start
42 ToyPhotoGallery 303.0  main /Users/voxels/Documents/ToyPhotoGallery/src/ToyPhotoGallery/ToyPhotoGallery/View/Gallery/GalleryCollectionViewImageCell.swift:14
41 UIKit 303.0  UIApplicationMain
40 GraphicsServices 298.0  GSEventRunModal
39 CoreFoundation 298.0  CFRunLoopRunSpecific
38 CoreFoundation 298.0  __CFRunLoopRun
37 CoreFoundation 89.0  __CFRunLoopDoBlocks
123.00 ms   16.7% 0 s    _dispatch_worker_thread3  0x11b020
123.00 ms   16.7% 0 s     _pthread_wqthread
118.00 ms   16.0% 0 s      _dispatch_worker_thread3
118.00 ms   16.0% 0 s       _dispatch_root_queue_drain
115.00 ms   15.6% 0 s        _dispatch_queue_override_invoke$VARIANT$mp
115.00 ms   15.6% 0 s         _dispatch_client_callout
115.00 ms   15.6% 0 s          _dispatch_call_block_and_release
115.00 ms   15.6% 0 s           __55-[BFTask continueWithExecutor:block:cancellationToken:]_block_invoke
113.00 ms   15.3% 0 s            __28-[PFAsyncTaskQueue enqueue:]_block_invoke_2
34  1424.0  ToyPhotoGallery (2497) :0
33  813.0  Main Thread  0x11afef :0
32 libdyld.dylib 764.0  start
31 ToyPhotoGallery 764.0  main /Users/voxels/Documents/ToyPhotoGallery/src/ToyPhotoGallery/ToyPhotoGallery/View/Gallery/GalleryCollectionViewImageCell.swift:14
30 UIKit 763.0  UIApplicationMain
29 GraphicsServices 759.0  GSEventRunModal
28 CoreFoundation 759.0  CFRunLoopRunSpecific
27 CoreFoundation 759.0  __CFRunLoopRun
26 CoreFoundation 110.0  __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
28  1424.0  ToyPhotoGallery (2497) :0
27  813.0  Main Thread  0x11afef :0
26 libdyld.dylib 764.0  start
25 ToyPhotoGallery 764.0  main /Users/voxels/Documents/ToyPhotoGallery/src/ToyPhotoGallery/ToyPhotoGallery/View/Gallery/GalleryCollectionViewImageCell.swift:14
24 UIKit 763.0  UIApplicationMain
23 GraphicsServices 759.0  GSEventRunModal
22 CoreFoundation 759.0  CFRunLoopRunSpecific
21 CoreFoundation 759.0  __CFRunLoopRun
20 CoreFoundation 432.0  __CFRunLoopDoObservers