- (UIBezierPath *)pathForView:(UIView *)button withVertices:(CGFloat)vertices initialPointAngle:(CGFloat)initialAngle cornerRadius:(CGFloat)pCornerRadius lineWidth:(CGFloat)lineWidth{
CGFloat angle = 2*M_PI/vertices;
CGPoint buttonCenter = CGPointMake(button.frame.size.width/2, button.frame.size.height/2);
CGFloat totalRadius = button.frame.size.width/2;
CGFloat innerRadius = totalRadius - pCornerRadius -lineWidth;
This file contains 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
- (UITableViewCell *)cellContainingView:(UIView *)view { | |
return (!view || [view isKindOfClass:[UITableViewCell class]]) ? (UITableViewCell *)view : [self cellContainingView:view.superview]; | |
} |
This file contains 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
- (UIBezierPath *)pathForView:(UIView *)button withVertices:(CGFloat)vertices initialPointAngle:(CGFloat)initialAngle cornerRadius:(CGFloat)pCornerRadius lineWidth:(CGFloat)lineWidth{ | |
CGFloat angle = 2*M_PI/vertices; | |
CGPoint buttonCenter = CGPointMake(button.frame.size.width/2, button.frame.size.height/2); | |
CGFloat totalRadius = button.frame.size.width/2; | |
CGFloat innerRadius = totalRadius - pCornerRadius -lineWidth; | |
UIBezierPath* bezierPath = UIBezierPath.bezierPath; |
This file contains 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
// | |
// main.m | |
// ColorListFromPList | |
// | |
// Created by Christopher Private on 7/12/15. | |
// Copyright (c) 2015 Flouu. All rights reserved. | |
// | |
@import AppKit; |
This file contains 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
// | |
// main.m | |
// CreatePListFromColorLists | |
// | |
// Created by Christopher Private on 7/13/15. | |
// Copyright (c) 2015 Flouu. All rights reserved. | |
// | |
@import AppKit; | |
const NSString *hexStringForColor(NSColor *color); |
This file contains 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
- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset { | |
targetContentOffset->x = [self targetOffsetX:targetContentOffset->x inCollectionView:(UICollectionView *)scrollView velocity:velocity]; | |
} | |
- (CGFloat)targetOffsetX:(CGFloat)offsetX inCollectionView:(UICollectionView *)collectionView velocity:(CGPoint)velocity { | |
if (![collectionView isKindOfClass:[UICollectionView class]]) { | |
return offsetX; | |
} | |
NSInteger index = [self indexForScrollView:collectionView targetOffsetX:offsetX velocity:velocity]; | |
UICollectionViewCell *cell = [collectionView cellForItemAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0]]; |
This file contains 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
//Instead of: | |
func printAllKeys() { | |
var current: LLNode! = head | |
print("------------------") | |
while (current != nil) { | |
print("link item is: \(current.key)") | |
current = current.next | |
} | |
} | |
This file contains 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
#!/usr/bin/swift | |
// Swift 3.0 | |
// | |
// main.swift | |
// CSVToTables | |
// | |
// Created by Christopher Brandow on 7/12/16. | |
// Copyright © 2016 flouu. All rights reserved. | |
// |
This file contains 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 | |
var array = [Int]() | |
for i in 1 ..< 10000000 { | |
array.append(i) | |
} | |
//let numberList = array | |
extension Array where Element: Comparable { |
OlderNewer