Skip to content

Instantly share code, notes, and snippets.

View TheCoordinator's full-sized avatar
📱

Peyman Khanjan TheCoordinator

📱
View GitHub Profile
@keremk
keremk / Date.playground
Created June 24, 2014 06:56
Swift Date Helpers
// Playground - noun: a place where people can play
import UIKit
var str = "Hello, playground"
enum TimeIntervalUnit {
case Seconds, Minutes, Hours, Days, Months, Years
func dateComponents(interval: Int) -> NSDateComponents {
@lattner
lattner / TaskConcurrencyManifesto.md
Last active July 21, 2024 05:08
Swift Concurrency Manifesto
@ksm
ksm / DEPENDENCIES.md
Last active February 14, 2019 17:49
A sample DEPENDENCIES.md file

Use this file to track all dependencies required by this project.

Added via Carthage

Alamofire

  • Added because of its MultipartFormData implementation
  • License: MIT

Added via Drag & Drop

@eneko
eneko / dealloc-breakpoint.md
Last active January 3, 2024 02:24
Xcode UIViewController dealloc breakpoint

Xcode deinit breakpoint for UIViewController

This breakpoint provides an easy way to track view controller deinitialization (deallocation) in UIKit-based applications. This can help finding memory leaks caused by retain cycles preventing view controllers from being deinitialized when dismissed or popped.

From Cédric Luthi's tweet in 2017:

Useful Xcode breakpoint. When you dismiss a controller and you don’t hear the pop sound (or see the log), you probably have a retain cycle.

@vzsg
vzsg / 1_UIViewController+TraitCollectionChangePublisher.swift
Created July 4, 2020 01:03
An experiment in method swizzling and Combine to expose traitCollectionDidChange as a Publisher
import Combine
import ObjectiveC
import UIKit
typealias TraitCollectionChange = (UITraitCollection, previous: UITraitCollection?)
private typealias TraitChangeSubject = PassthroughSubject<TraitCollectionChange, Never>
private var traitSubjectKey = "_voodoo_trait_subject"
private var swizzlingPerformed = false