Skip to content

Instantly share code, notes, and snippets.

@frankrausch
frankrausch / gist:572a3368c50b77be854265a8c91a77b2
Created May 13, 2020 21:26
Convert UIKeyCommand from deprecated init syntax to iOS 13 SDK syntax
# Regex:
UIKeyCommand\(input: (.+)\, modifierFlags: (.+), action: #selector\((.+)\), discoverabilityTitle: (.+)\),
# Replace:
UIKeyCommand(title: $4,
image: nil,
action: #selector($3),
input: $1,
modifierFlags: $2,
propertyList: nil,

Hello,

I attended WWDC this year, and overall it was a fantastic experience. I would, however, like to give some feedback on one particular aspect of the conference.

Before I begin, I understand that it would be easy to brush off my feedback as coming from just some grumpy English guy, but I genuinely believe this is important feedback. Please do read until the end.

I would like to ask that the cheering, whooping, clapping and hollering by conference staff is toned down.

I'm a person that would describe myself as "slightly introverted". I cannot begin to describe how deeply uncomfortable it was to walk into the registration room on Sunday to multiple employees cheering and clapping at me, trying to give me high fives. I understand the want to make people excited, but this needs to have its limits. During the conference, I got cheered and high-fived pretty much the entire week for things like:

As of iOS 11/macOS High Sierra, and only including ones in Foundation and CoreFoundation
Strings:
_NSCFString - a CFStringRef or CFMutableStringRef. This is the most common type of string object currently.
- May have 8 bit (ASCII) or 16 bit (UTF-16) backing store
_NSCFConstantString - a compile time constant CFStringRef, like you'd get with @"foo"
- May also be generated by dynamic string creation if matches a string in a pre-baked table of common strings called the StringROM
NSBigMutableString - an NSString backed by a CFStorage (https://github.com/opensource-apple/CF/blob/master/CFStorage.h) for faster handling of very large strings
NSCheapMutableString - a very limited NSMutableString that allows for zero-copy initialization. Used in NSFileManager for temporarily wrapping stack buffers.
@jamesreggio
jamesreggio / SFSafariViewController-radars.md
Last active August 17, 2018 05:32
Summary of bugs in SFSafariViewController affecting adoption within the Twitter iOS client

In the process of evaluating the suitability of SFSafariViewController (SFSVC) for use within the Twitter iOS client, I encountered a number of bugs with differing severities, all of which I filed as Radars in Apple's bug reporting tool. Here is my attempt to holistically document their impact on our ability to adopt SFSafariViewController as a replacement for our existing WebViews.

Highest Severity

The fundamental blocker is Radar

@gonzalolarralde
gonzalolarralde / tvos_prohibited.md
Last active December 24, 2019 16:19
Classes and Methods prohibited to tvOS
$ grep -lR "__TVOS_PROHIBITED" . | while read L; do echo "## $L"; echo "\`\`\`obj-c"; grep "__TVOS_PROHIBITED" "$L"; echo "\`\`\`"; echo; done

./AVFoundation.framework/AVAudioSession.h

AVAudioSessionPortOverrideSpeaker __TVOS_PROHIBITED = 'spkr'

AVAudioSessionCategoryOptionAllowBluetooth	__TVOS_PROHIBITED		= 0x4,
AVAudioSessionCategoryOptionDefaultToSpeaker __TVOS_PROHIBITED		= 0x8,
@BashedCrab
BashedCrab / JumpyOctopus.py
Created February 12, 2014 03:25
JumpyOctopus
from scene import *
from PIL import Image
import sound
import random
GAME_READY = 0
GAME_PLAY = 1
GAME_DYING = 2
GAME_DEAD = 3
NSString *NSStringFromCATransform3D(CATransform3D t) {
return [NSString stringWithFormat:@"CATransform3D {\n%lf %lf %lf %lf\n%lf %lf %lf %lf\n%lf %lf %lf %lf\n%lf %lf %lf %lf\n}", t.m11, t.m12, t.m13, t.m14, t.m21, t.m22, t.m23, t.m24, t.m31, t.m32, t.m33, t.m34, t.m41, t.m42, t.m43, t.m44];
}
@n-b
n-b / orderedset-kvo-test.m
Created November 22, 2012 15:20
NSOrderedSet KVO Collection Operators tests
//
// clang orderedset-kvo-test.m -framework Foundation && ./a.out
//
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
#import <objc/message.h>
int main ()
{