WWDC 2006 2007 2008 2009 2010 2011 2012 2013 2014
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Example of wrapping `UIApplication.keyboardDidShowNotification` payload | |
| struct KeyboardDidShowPayload { | |
| let keyboardFrameBegin: CGRect? | |
| let keyboardFrameEnd: CGRect? | |
| } | |
| extension NotificationWrapper where Payload == KeyboardDidShowPayload { | |
| @MainActor static let keyboardDidShow: Self = .init( | |
| name: UIApplication.keyboardDidShowNotification, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| /// KillRing with macOS text text system semantics. | |
| /// | |
| /// Use when implementing `yank:` and `yankAndSelect:` actions. | |
| /// | |
| /// Learn more at http://hogbaysoftware.com/posts/mac-text-editing-mark-kill-yank/ | |
| public class KillRing { | |
| public static let shared = KillRing() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int[][] result; | |
| float t, c; | |
| float ease(float p) { | |
| return 3*p*p - 2*p*p*p; | |
| } | |
| float ease(float p, float g) { | |
| if (p < 0.5) | |
| return 0.5 * pow(2*p, g); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // UIView+Tooltips.h | |
| // Crossword | |
| // | |
| // Created by Steven Troughton-Smith on 13/09/2019. | |
| // Copyright © 2019 Steven Troughton-Smith. All rights reserved. | |
| // | |
| #import <UIKit/UIKit.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // Circles of dots. | |
| // Created using Processing 3.5.3. | |
| // | |
| // Code by @marcedwards from @bjango. | |
| // | |
| // A GIF of this code can be seen here: | |
| // https://twitter.com/marcedwards/status/1144236924095234053 | |
| // |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| TARGET="$( cd "$(dirname "$1")" ; pwd -P )/$1" | |
| SYSROOT="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk" | |
| TARGET_ARCH=x86_64 | |
| export IPHONEOS_DEPLOYMENT_TARGET=12.2 | |
| rm -r /tmp/bitcode2intel | |
| mkdir -p /tmp/bitcode2intel | |
| pushd /tmp/bitcode2intel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const Masto = require('mastodon'); | |
| const fs = require('fs') | |
| const M = new Masto({ | |
| access_token: 'ACCESS_TOKEN', | |
| api_url: 'https://YOUR-INSTANCE.TLD/api/v1/' | |
| }); | |
| function getNextPage(req) { | |
| return (req.headers && req.headers.link && req.headers.link.includes('rel="next"')) ? req.headers.link.split(/<([^>]+)>/)[1] : null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Advanced Animations with UIKit | |
| video: https://devstreaming-cdn.apple.com/videos/wwdc/2017/230lc4n1loob9/230/230_hd_advanced_animations_with_uikit.mp4?dl=1 | |
| pdf: https://devstreaming-cdn.apple.com/videos/wwdc/2017/230lc4n1loob9/230/230_advanced_animations_with_uikit.pdf | |
| Advanced Touch Bar | |
| video: https://devstreaming-cdn.apple.com/videos/wwdc/2017/222ijxk2akkrebmr/222/222_hd_advanced_touch_bar.mp4?dl=1 | |
| pdf: https://devstreaming-cdn.apple.com/videos/wwdc/2017/222ijxk2akkrebmr/222/222_advanced_touch_bar.pdf | |
| Advances in TVMLKit | |
| video: https://devstreaming-cdn.apple.com/videos/wwdc/2017/202ximbb9e2dq222/202/202_hd_advances_in_tvmlkit.mp4?dl=1 |
NewerOlder