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
either: | |
1. in viewWillAppear: | |
[self.navigationController.view layoutSubviews]; | |
or | |
2. in viewDidLoad: | |
self.navigationController.navigationBar.translucent = 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
// | |
// NSURLSession+CancelTasks.h | |
// Networking | |
// | |
// Created by sudeep on 31/03/15. | |
// Copyright (c) 2015 Sudeep Jaiswal. All rights reserved. | |
// | |
@import Foundation; |
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
// reactive cocoa | |
http://www.raywenderlich.com/62699/reactivecocoa-tutorial-pt1 | |
// tutorials | |
http://chrisrisner.com/31-Days-of-iOS | |
// autolayout | |
http://angelovillegas.com/2014/01/31/ios-nslayoutconstraint |
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
[[UIApplication sharedApplication] sendAction:@selector(resignFirstResponder) to:nil from:nil forEvent:nil]; | |
[self.view endEditing:YES]; | |
[self.view.window endEditing:YES]; | |
// source: http://stackoverflow.com/questions/1823317/get-the-current-first-responder-without-using-a-private-api |
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
NSString *searchQuery = searchController.searchBar.text; | |
NSString *strippedString = [searchQuery stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; | |
NSExpression *lhs = [NSExpression expressionForKeyPath:@"name"]; | |
NSExpression *rhs = [NSExpression expressionForConstantValue:strippedString]; | |
NSPredicate *searchPredicate = [NSComparisonPredicate | |
predicateWithLeftExpression:lhs | |
rightExpression:rhs | |
modifier:NSDirectPredicateModifier | |
type:NSContainsPredicateOperatorType |
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
in build phases ---> compile sources: | |
- navigate to the file(s) you want to disable arc on | |
- add to their compiler flags; '-fno-objc-arc' |
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
1. sudo gem install cocoapods // install command line tool (do this just once) | |
2. pod setup // clones the pod repo locally (do this just once) | |
3. in a project folder, 'pod init' // creates a podfile | |
4. in the podfile, add pod names, eg: pod 'AFNetworking' | |
5. in the project folder on terminal, 'pod install' |
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
occurs due to compiler optimisation settings: | |
build settings ---> apple llvm 6.0 - code generation | |
or just search for "optimization" | |
the issue lies in "optimization level". testflight builds use the "release" configuration which uses a different level than our usual debug. | |
solutions: |
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
[self.view layoutIfNeeded]; // always call on self.view | |
_constraintObject.constant = 44; // change the constraint value | |
[UIView animateWithDuration:0.25 | |
animations:^{ | |
[self.view layoutIfNeeded]; // call again to update the layout | |
}]; | |
sources: | |
http://stackoverflow.com/questions/12622424/how-do-i-animate-constraint-changes | |
http://stackoverflow.com/questions/22086054/unable-to-make-outlet-connection-to-a-constraint-in-ib |