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
self.tabBar.selectedImageTintColor = UIColor.colorWithHexString(Constants.mainTabBarSelectionColor) |
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
// | |
// UIScrollView+PullToRefresh.h | |
// Created by Ben Kreeger (@kreeger), 2013/01/23. | |
// | |
#import <UIKit/UIKit.h> | |
/** Adds pull to refresh for a UIScrollView (or a UITableView). Abstracts away differences in frameworks between iOS 6 | |
* and iOS 5 (in the case of the latter, `ODRefreshControl` is used. | |
*/ |
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
func scrollViewDidScroll(scrollView: UIScrollView) { | |
let actualPosition = scrollView.contentOffset.y | |
let contentHeight = scrollView.contentSize.height - tableView.frame.size.height | |
if actualPosition >= contentHeight { | |
tableView.reloadData() | |
} | |
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
let newCenterViewController = storyboard?.instantiateViewControllerWithIdentifier("CenterViewController") as UIViewController | |
let newLeftViewController = storyboard?.instantiateViewControllerWithIdentifier("LeftViewController") as UIViewController | |
let newRightViewController = storyboard?.instantiateViewControllerWithIdentifier("RightViewController") as UIViewController | |
centerViewController = newCenterViewController | |
leftDrawerViewController = newLeftViewController | |
rightDrawerViewController = newRightViewController | |
openDrawerGestureModeMask = MMOpenDrawerGestureMode.BezelPanningCenterView // Just from border | |
closeDrawerGestureModeMask = MMCloseDrawerGestureMode.All |
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/bash | |
# | |
# Script to run tests and see a beautiful output using xcpretty. | |
# | |
# Validations | |
if ! which xcpretty >/dev/null; then | |
echo "Please install xcpretty to run this script." | |
exit 1 | |
fi |
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> | |
@interface UISearchBar (UISearchBar_EnableEmptySearch) | |
- (void)enableEmptySearch; | |
@end |
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
extension NSUserDefaults { | |
func clearAll() { | |
let dictionary = self.dictionaryRepresentation() | |
for (item, value) in dictionary { | |
let key = item as String | |
removeObjectForKey(key) | |
} |
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
if MFMailComposeViewController.canSendMail() { | |
let subject = NSLocalizedString("MoreEmailSubject", comment: "") | |
// It send the email async and notify its mailComposeDelegate with updates. | |
// In the case of no internet connection on send, it will say that the status is sended and | |
// will be sended automatically when the device get internet connection again. | |
var mailComposeViewController = MFMailComposeViewController() | |
mailComposeViewController.setToRecipients([GlobalConstants.CEBrokerData.Support.email]) | |
mailComposeViewController.setSubject(subject) | |
mailComposeViewController.mailComposeDelegate = self |
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
class SelectableCell: UITableViewCell { | |
override func awakeFromNib() { | |
super.awakeFromNib() | |
if let myconstraints = constraints() as? [NSLayoutConstraint] { | |
for cellConstraint: NSLayoutConstraint in myconstraints { | |
removeConstraint(cellConstraint) | |
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 android.content.ComponentName; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.pm.PackageManager; | |
import android.content.pm.ResolveInfo; | |
import java.util.List; | |
/** | |
* Created by danielgomez22 on 3/14/15. |