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
extension UICollectionView { | |
func indexPath(for supplementaryView: UICollectionReusableView?, ofKind kind: String = UICollectionView.elementKindSectionHeader) -> IndexPath? { | |
let elements = visibleSupplementaryViews(ofKind: kind) | |
let indexPaths = indexPathsForVisibleSupplementaryElements(ofKind: kind) | |
for (element, indexPath) in zip(elements, indexPaths) { | |
if element === supplementaryView { | |
return indexPath | |
} | |
} |
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
// | |
// TAMHidingBarsViewController.h | |
// | |
// Created by Vladislav Kartashov on 13/07/15. | |
// Copyright (c) 2015 Vladislav Kartashov. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> | |
@interface TAMHidingBarsViewController : UIViewController <UINavigationControllerDelegate> |
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
import CoreData | |
class CoreDataStack { | |
static let instance = CoreDataStack(storeName: "STORE_NAME") | |
public let privateContext: NSManagedObjectContext | |
public let mainContext: NSManagedObjectContext | |
let objectModel: NSManagedObjectModel | |
let storeCoordinator: NSPersistentStoreCoordinator |
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
VERSIONNUM=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${PROJECT_DIR}/${INFOPLIST_FILE}") | |
NEWSUBVERSION=`echo $VERSIONNUM | awk -F "." '{print $3}'` | |
NEWSUBVERSION=$(($NEWSUBVERSION + 1)) | |
NEWVERSIONSTRING=`echo $VERSIONNUM | awk -F "." '{print $1 "." $2 ".'$NEWSUBVERSION'" }'` | |
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $NEWVERSIONSTRING" "${PROJECT_DIR}/${INFOPLIST_FILE}" |
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
BUILD_NUM=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${PROJECT_DIR}/${INFOPLIST_FILE}") | |
VERSION_NUM=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${PROJECT_DIR}/${INFOPLIST_FILE}") | |
BUILD_NUM=$(($BUILD_NUM + 1)) | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $BUILD_NUM" "${PROJECT_DIR}/${INFOPLIST_FILE}" | |
cd "${SRCROOT}";/usr/bin/git add "${PROJECT_DIR}/${INFOPLIST_FILE}" | |
cd "${SRCROOT}";/usr/bin/git commit -m "Bump build number to ${BUILD_NUM}" | |
cd "${SRCROOT}";/usr/bin/git tag -f -a "v${VERSION_NUM}b${BUILD_NUM}" -m "Version ${VERSION_NUM}, Build ${BUILD_NUM}" |
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
// | |
// AddressBookViewController.h | |
// | |
// Created by Vladislav Kartashov on 28/03/15. | |
// Copyright (c) 2015 Vladislav Kartashov. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> | |
#import "APAddressBook.h" | |
// call reloadContacts in subclass |