For example, you want to set 40% alpha transparence to #000000
(black color), you need to add 66
like this #66000000
.
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
public abstract class EndlessRecyclerViewScrollListener extends RecyclerView.OnScrollListener { | |
// The minimum amount of items to have below your current scroll position | |
// before loading more. | |
private int visibleThreshold = 5; | |
// The current offset index of data you have loaded | |
private int currentPage = 0; | |
// The total number of items in the dataset after the last load | |
private int previousTotalItemCount = 0; |
Generate the list yourself:
$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS*.sdk/System/Library/Frameworks/UIKit.framework/Headers
$ grep -H UI_APPEARANCE_SELECTOR ./* | sed 's/ __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_5_0) UI_APPEARANCE_SELECTOR;//'
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
@private | |
NSManagedObjectContext *managedObjectContext_; | |
NSManagedObjectModel *managedObjectModel_; | |
NSPersistentStoreCoordinator *persistentStoreCoordinator_; | |
@property (nonatomic, retain, readonly) NSManagedObjectContext *managedObjectContext; | |
@property (nonatomic, retain, readonly) NSManagedObjectModel *managedObjectModel; | |
@property (nonatomic, retain, readonly) NSPersistentStoreCoordinator *persistentStoreCoordinator; |
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
- (BOOL) tabBarController:(UITabBarController *)tabBarController | |
shouldSelectViewController:(UIViewController *)viewController { | |
// http://stackoverflow.com/questions/5161730/iphone-how-to-switch-tabs-with-an-animation | |
NSUInteger controllerIndex = [self.viewControllers indexOfObject:viewController]; | |
if (controllerIndex == tabBarController.selectedIndex) { | |
return NO; | |
} |
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
NSMutableArray *animations = [NSMutableArray array]; | |
// Step 1 | |
{ | |
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.scale"]; | |
animation.toValue = @(1.3); | |
animation.duration = 0.3; | |
animation.fillMode = kCAFillModeForwards; | |
[animations addObject:animation]; | |
} | |
{ |
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
// Swift 2.2 syntax / API | |
import UIKit | |
extension UIBezierPath { | |
class func arrow(from start: CGPoint, to end: CGPoint, tailWidth: CGFloat, headWidth: CGFloat, headLength: CGFloat) -> Self { | |
let length = hypot(end.x - start.x, end.y - start.y) | |
let tailLength = length - headLength |