I hereby claim:
- I am PadraigK on github.
- I am padraig (https://keybase.io/padraig) on keybase.
- I have a public key whose fingerprint is CF1A 2C80 34ED 2A2A 8BD9 BD70 85D7 D932 29A7 0242
To claim this, I am signing this object:
- (void)tableView:(UITableView *)tableView didUnhighlightRowAtIndexPath:(NSIndexPath *)indexPath | |
{ | |
// Fix double cell border after highlight | |
if (indexPath.row == self.fetchedResultsController.fetchedObjects.count-1) { | |
UITableViewCell * cell = [self.tableView cellForRowAtIndexPath:indexPath]; | |
UIView *tableScrollView = [[cell subviews] lastObject]; | |
UIView *separator = [[tableScrollView subviews] lastObject]; | |
[separator setBackgroundColor:[UIColor clearColor]]; | |
// Example: | |
// | |
// Widont makes the last space non-breaking | |
// so you don't end up with one word on its | |
// own. | |
// | |
// Widont makes the last space non-breaking | |
// so you don't end up with one word on | |
// its own. | |
// |
CGColorSpaceRef cs = CGColorSpaceCreateDeviceRGB(); | |
CGContextRef bmContext = CGBitmapContextCreate(NULL, width, height, 8, 4 * width, cs, (CGBitmapInfo) kCGImageAlphaNoneSkipLast); | |
CGContextDrawImage(bmContext, (CGRect){.origin.x = 0.0f, .origin.y = 0.0f, .size.width = width, .size.height = height}, imageRep); | |
CGColorSpaceRelease(cs); | |
RGBAPixel *pixels = (RGBAPixel*)CGBitmapContextGetData(bmContext); | |
// Outputting the first 10 pixels on different hardware (iPad Air, iPhone 5, Simulator) gives slightly differing pixel values. | |
// I am confuse. |
func rangeOfPixelsForRow(row: Int) -> Range<Int> | |
{ | |
return row * imageSize.width..(row+1)*imageSize.width | |
} | |
func rangeOfPixelsForColumn(column: Int) -> StridedRangeGenerator<Int> | |
{ | |
return (column..imageSize.height*imageSize.width).by(imageSize.width) | |
} |
I hereby claim:
To claim this, I am signing this object:
Please go to | |
https://itunesconnect.apple.com/WebObjects/iTunesConnect.woa/ra/apps/[APP_ID]/promocodes/versions | |
(with [APP_ID] set properly) | |
and email us the JSON ([email protected]) |
/* | |
Instead of this... | |
CGFloat minConstant = -60.0f; | |
CGFloat maxConstant = self.actionViewDefaultBottomConstraintConstant; | |
CGFloat stuckConstant = maxConstant - distanceToBottom; | |
// :chefpoop: | |
actionViewBottomContraintConstant = fminf(maxConstant, fmaxf(minConstant, stuckConstant)); | |
*/ |
func makeOrReuse<T : IdentifierCellView>(_ cellType: T.Type, tableView: NSTableView) -> T | |
func makeOrReuse<T : IdentifierCellView>(tableView: NSTableView) -> T | |
// IMHO: The first signature is vastly superior even though the first argument is unncessary. | |
// Think about the call sites | |
let cell = makeOrReuse(ImageExportOptionCells.Toggle.self, tableView: tableView) |
// 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, |