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 <UIKit/UIKit.h> | |
#import <XCTest/XCTest.h> | |
#import "StaticTables.h" | |
@interface StaticTablesDataSourceTests : XCTestCase | |
@end | |
@implementation StaticTablesDataSourceTests |
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
#pragma mark - View life cycle | |
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
[_collectionView registerClass:[JSMRefreshViewCell class] forSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:@"SearchViewRefresh"]; | |
} | |
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout referenceSizeForFooterInSection:(NSInteger)section { | |
// If we have more results to fetch |
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
// Get the view's actual pixel width | |
CGFloat pixelWidth = self.collectionView.frame.size.width * UIScreen.mainScreen.scale; | |
// Maximum cells per row | |
CGFloat maxCells = ( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ) ? 10.0 : 5.0; | |
// Determine a cell width | |
CGFloat cellWidth = 0.0; | |
CGFloat cellSpacing = 2.0; | |
for( CGFloat i = cellSpacing; i <= 4; i++ ) { |
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
#pragma mark - Action sheet delegate | |
- (void)willPresentActionSheet:(UIActionSheet *)actionSheet { | |
for( UIView *subview in actionSheet.subviews ) { | |
if( [subview isKindOfClass:[UIButton class]] ) { | |
UIButton *button = (UIButton *)subview; | |
[button setTitleColor:[UIColor mainTintColor] forState:UIControlStateNormal]; | |
[button setTitleColor:[UIColor mainTintColor] forState:UIControlStateHighlighted]; | |
[button setTitleColor:[UIColor mainTintColor] forState:UIControlStateSelected]; | |
} |
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
#pragma mark - Rearrange the subviews | |
- (void)setFrame:(CGRect)frame { | |
[super setFrame:frame]; | |
[self arrangeSubviews]; | |
} | |
- (void)arrangeSubviews { | |
// Cover image frame |
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
#!/bin/sh | |
# We need an install path | |
if [ $# != 1 ]; then | |
echo "Usage: wordpress.sh <install-path>" | |
exit 1 | |
fi | |
# Fix the path if it's relative | |
given_path=$1 |
NewerOlder