Skip to content

Instantly share code, notes, and snippets.


Nesterenko Dmitry chebur

  • Russia
View GitHub Profile
steipete / OSLogStream.swift
Last active Feb 6, 2022
Access streaming OSLogStore at runtime with SPI. (FB8519418)
View OSLogStream.swift
// OSLogStream.swift
// LoggingTest
// Created by Peter Steinberger on 24.08.20.
// Requires importing via bridging header
import Foundation
View iOS 13 Entitlements
//Sourced from
tclementdev /
Last active May 24, 2022
Making efficient use of the libdispatch (GCD)

libdispatch efficiency tips

The libdispatch is one of the most misused API due to the way it was presented to us when it was introduced and for many years after that, and due to the confusing documentation and API. This page is a compilation of important things to know if you're going to use this library. Many references are available at the end of this document pointing to comments from Apple's very own libdispatch maintainer (Pierre Habouzit).

My take-aways are:

  • You should create very few, long-lived, well-defined queues. These queues should be seen as execution contexts in your program (gui, background work, ...) that benefit from executing in parallel. An important thing to note is that if these queues are all active at once, you will get as many threads running. In most apps, you probably do not need to create more than 3 or 4 queues.

  • Go serial first, and as you find performance bottle necks, measure why, and if concurrency helps, apply with care, always validating under system pressure. Reuse

smileyborg / InteractiveTransitionCollectionViewDeselection.m
Last active Feb 6, 2022
Animate table & collection view deselection alongside interactive transition (for iOS 11 and later)
View InteractiveTransitionCollectionViewDeselection.m
// UICollectionView Objective-C example
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
NSIndexPath *selectedIndexPath = [[self.collectionView indexPathsForSelectedItems] firstObject];
if (selectedIndexPath != nil) {
id<UIViewControllerTransitionCoordinator> coordinator = self.transitionCoordinator;
if (coordinator != nil) {
[coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) {
steipete / UIView+PSPDFKitAdditions.h
Last active Jun 30, 2016
Simple solution that allows to block the parent layoutSubview-triggering, see In short, changing a frame of a subview outside of layoutSubviews will trigger the parent's layoutSubviews. Sometimes this is not what we want, especially when you consider performance. In my case ( this was…
View UIView+PSPDFKitAdditions.h
@interface UIView (PSPDFKitAdditions)
// Allows to change frame/bounds without triggering `layoutSubviews` on the parent.
// Not needed for changes that are performed within `layoutSubviews`.
- (void)pspdf_performWithoutTriggeringSetNeedsLayout:(dispatch_block_t)block;
#import "UIView+PSPDFKitAdditions.h"