Skip to content

Instantly share code, notes, and snippets.

@voxels
voxels / CacheHandler.swift
Last active Jan 6, 2020
A URLCache handler for overriding the default shared cache settings
View CacheHandler.swift
//
// CacheHandler.swift
// ToyPhotoGallery
//
// Created by Michael Edgcumbe on 7/14/18.
// Copyright © 2018 Michael Edgcumbe. All rights reserved.
//
import Foundation
@voxels
voxels / priceless_lost_and_found.md
Last active Jul 12, 2019
Priceless Lost and Found
View priceless_lost_and_found.md
View LaunchController.swift
//
// 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 Aug 2, 2018
Transforming a UICollectionViewCell during scrollViewDidScroll with a CGAffineTransform
View scrollViewDidScroll.swift
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 Aug 2, 2018
An example of animateCollectionViews, a method to swap out two collection views located in the same container
View GalleryViewController_excerpt.swift
// 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)
View toyphotogallery_stacktrace_3.md
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
View toyphotogallery_stacktrace_2.md
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
View toyphotogallery_stacktrace_1.md
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__
View toyphotogallery_stacktrace_0.md
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
View AWSBucketHandler.swift
//
// BucketHandlerDelegate.swift
// ToyPhotoGallery
//
// Created by Voxels on 7/2/18.
// Copyright © 2018 Michael Edgcumbe. All rights reserved.
//
import Foundation
import AWSCore
You can’t perform that action at this time.