#Users Resources
GET users/me
##Description Get my User object
func switchRootViewController(rootViewController: UIViewController, animated: Bool, completion: (() -> Void)?) { | |
if animated { | |
UIView.transitionWithView(window, duration: 0.5, options: .TransitionCrossDissolve, animations: { | |
let oldState: Bool = UIView.areAnimationsEnabled() | |
UIView.setAnimationsEnabled(false) | |
self.window!.rootViewController = rootViewController | |
UIView.setAnimationsEnabled(oldState) | |
}, completion: { (finished: Bool) -> () in | |
if completion { | |
completion!() |
private func addListBubbleCellsWithCount(count: Int) { | |
var contentOffset = self.tableView.contentOffset | |
UIView.setAnimationsEnabled(false) | |
var indexPaths = [NSIndexPath]() | |
var heightForNewRows: CGFloat = 0 | |
for var i = 0; i < count; i++ { | |
let indexPath = NSIndexPath(forRow: i, inSection: 0) |
if #available(iOS 8.0, *) { | |
let alertController = UIAlertController(title: "Terms & Conditions", message: kTermsAndConditions, preferredStyle: .Alert) | |
let OKAction = UIAlertAction(title: "OK", style: .Cancel) { (action) in | |
alertController.dismissViewControllerAnimated(true, completion: nil) | |
} | |
alertController.addAction(OKAction) | |
let paragraphStyle = NSMutableParagraphStyle() | |
paragraphStyle.alignment = NSTextAlignment.Left | |
func handleKeyboardWillShowNotification(notification: NSNotification) { | |
if self.inputContainerViewBottomLayoutGuideConstraint.constant == 0 { | |
keyboardWillChangeFrameWithNotification(notification, showKeyboard: true) | |
scrollBubbleTableViewToBottomAnimated(true) | |
} | |
} | |
func handleKeyboardWillHideNotification(notification: NSNotification) { | |
if self.inputContainerViewBottomLayoutGuideConstraint.constant > 0 { | |
keyboardWillChangeFrameWithNotification(notification, showKeyboard: false) |
class func countryNames() -> [String] { | |
struct Static { | |
static var instance: [String]? | |
} | |
if let names = Static.instance { | |
return names | |
} | |
var names = [String]() | |
for code in NSLocale.ISOCountryCodes() as [String] { |
+ (UIImagePickerController *)tp_getCameraPickeWithParentViewController:(id<UINavigationControllerDelegate, UIImagePickerControllerDelegate, TPOverlayCameraViewDelegate>)parentViewController {
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.modalPresentationStyle = UIModalPresentationCurrentContext;
imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePickerController.delegate = parentViewController;
imagePickerController.showsCameraControls = NO;
[UIView animateWithDuration:0.5 delay:0 usingSpringWithDamping:0.5 initialSpringVelocity:10.0 options:UIViewAnimationOptionCurveEaseIn animations:^{
self.view.superview.top -= FilterViewHeight;
} completion:^(BOOL finished) {
self.isShown = YES;
if ([self.delegate respondsToSelector:@selector(filterViewControllerDidShow:)]) {
[self.delegate filterViewControllerDidShow:self];
}
}];
- (void)createPDFfromUIView:(UIView*)aView saveToDocumentsWithFileName:(NSString*)aFilename | |
{ | |
// Creates a mutable data object for updating with binary data, like a byte array | |
NSMutableData *pdfData = [NSMutableData data]; | |
// Points the pdf converter to the mutable data object and to the UIView to be converted | |
UIGraphicsBeginPDFContextToData(pdfData, aView.bounds, nil); | |
UIGraphicsBeginPDFPage(); | |
CGContextRef pdfContext = UIGraphicsGetCurrentContext(); | |