WWDC 2006 2007 2008 2009 2010 2011 2012 2013 2014
| target 'MyTarget' do | |
| use_frameworks! | |
| # Post installation script that enables the Swift 4.2 compiler's | |
| # legacy 4.1 mode for 4.2-incompatible pods | |
| post_install do |installer| | |
| incompatiblePods = ['PodA', 'PodB'] | |
| installer.pods_project.targets.each do |target| | |
| if incompatiblePods.include? target.name |
| { | |
| "People" : [ | |
| "😀", | |
| "😃", | |
| "😄", | |
| "😁", | |
| "😆", | |
| "😅", | |
| "😂", | |
| "🤣", |
| // 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) { |
| // | |
| // Created by はるふ on 2017/12/11. | |
| // Copyright © 2017年 ha1f. All rights reserved. | |
| // | |
| import Foundation | |
| import CoreImage | |
| import AVFoundation | |
| extension CIFilter { |
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.
| import Foundation | |
| import AVFoundation | |
| import CoreMedia | |
| class Converter { | |
| static func configureSampleBuffer(pcmBuffer: AVAudioPCMBuffer) -> CMSampleBuffer? { | |
| let audioBufferList = pcmBuffer.mutableAudioBufferList | |
| let asbd = pcmBuffer.format.streamDescription | |
| var sampleBuffer: CMSampleBuffer? = nil |
Q: I want my text color to switch to black or white, depending on the background color the user chooses. Just where is that flip point?
Calculate the luminance (Y) of the given color, and flip the text either black or white based on a pre-determined middle contrast figure. For a typical sRGB display, flip to white when Y < 0.36 (i.e. 36%)
First I want to acknowledge the massive amount of misinformation on the internet on this particular subject. The fact this field is still a subject of active research and unsettled science adds to the fun. I came to this conclusion as the result of the last few years of research into a new contrast prediction method for readability.
The field of visual perception is dense and abstract, as well as developing, so it is common for misunderstandings to exist. For instance, HSV and HSL are not even close to perceptually accurate. For that you need a perceptually uniform model such as CIELAB or CIELUV or CIECAM02 etc