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)scrollViewDidScroll:(UIScrollView *)scrollView | |
{ | |
CGFloat scrollOffset = scrollView.contentOffset.y; | |
// Shift dismiss button up on scroll when user is at the top of the scrollview | |
if (scrollOffset < -[self tableViewOffsetTop]) { | |
self.dismissButton.transform = CGAffineTransformMakeTranslation(0, scrollOffset + [self tableViewOffsetTop]); | |
} | |
// Dismiss after user scrolls down far enough |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
[ | |
{ | |
"postID": 10001, | |
"username": "eddiekaiger", | |
"content": "omg I love Swift and this is some really long tweet that should go over one line" | |
}, | |
{ | |
"postID": 10002, | |
"username": "ucdcsclub", | |
"content": "omg I love Swift" |
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
// | |
// TypeComparable | |
// | |
// Created by Eddie Kaiger on 10/3/16. | |
// Copyright (c) 2016 Eddie Kaiger. All rights reserved. | |
// | |
import Foundation | |
/** |
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
// Found on: http://hints.macworld.com/article.php?story=2008051406323031 | |
// File: | |
// click.m | |
// | |
// Compile with: | |
// gcc -o click click.m -framework ApplicationServices -framework Foundation | |
// | |
// Usage: | |
// ./click -x pixels -y pixels |
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 | |
import UIKit | |
class AutoSizingCollectionViewCell: UICollectionViewCell { | |
override func preferredLayoutAttributesFitting(_ layoutAttributes: UICollectionViewLayoutAttributes) -> UICollectionViewLayoutAttributes { | |
layoutIfNeeded() | |
layoutAttributes.bounds.size.height = systemLayoutSizeFitting(UIView.layoutFittingCompressedSize).height | |
return layoutAttributes | |
} | |
} |