I hereby claim:
- I am gspiers on github.
- I am gspiers (https://keybase.io/gspiers) on keybase.
- I have a public key whose fingerprint is 6BAB DBDF E67D 3449 FD78 2184 7F33 A838 EE52 6CA4
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
//: Playground - noun: a place where people can play
class MyError: Error {}
protocol P {
func throwingFunc() throws -> Int
func nonThrowingFunc() -> Int
}
// Stringly typed 💩 | |
// This throws an Obj-C exception and crashes if you get the name wrong. It would be better if it returned an optional. | |
let bootstrapRootStoryboard = UIStoryboard(name: "BootstrapRoot", bundle: Bundle.main) | |
guard let appKilledViewController = bootstrapRootStoryboard.instantiateViewController(withIdentifier: "appKilledViewController") as? AppKilledViewController else { | |
fatalError("Unexpected viewcontroller for identifier 'appKilledViewController'") | |
} | |
// Strongly typed using SwiftGen 😀 | |
let appKilledViewController = StoryboardScene.BootstrapRoot.instantiateAppKilledViewController() |
// 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) { |
// The trick is to link the DeviceSupport folder from the beta to the stable version. | |
// sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :) | |
// Support iOS 14 devices (Xcode 12.0) with Xcode 11.5: | |
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/14.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport | |
// Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions |