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
For Xcode 6 & 7 : | |
--------------- | |
If you are trying to develop a particular complex animation, use this trick to turn on “Slow Motion Mode” in the simulator. | |
It’ll be much easier to see what’s going on. | |
1. Start the simulator as normal. | |
2. Next, make sure you enable “Connect Hardware Keyboard” in the simulator’s hardware menu. | |
3. Press your Mac’s Command key (⌘) + T in succession to toggle it on/off. You’ll see in the debugger that slow motion mode has been activated. |
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
# To add iPhone 4s device with iOS 8.3 SDK | |
MacBook-Pro:~ dhirenshah$ xcrun simctl create "iPhone 4s" com.apple.CoreSimulator.SimDeviceType.iPhone-4s com.apple.CoreSimulator.SimRuntime.iOS-8-3 | |
#output: C787348F-9A0F-40F5-9766-F0C76CE12616 | |
# To add iPad Air device with iOS 8.3 SDK | |
MacBook-Pro:~ dhirenshah$ xcrun simctl create "iPad Air" com.apple.CoreSimulator.SimDeviceType.iPad-Air com.apple.CoreSimulator.SimRuntime.iOS-8-3 | |
#output: 664212E9-9596-40E3-A130-28F52C2DD30B |
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
// Create UIView category called UIView+printSubviews.h | |
#import <Foundation/Foundation.h> | |
@interface UIView (PrintSubviews) | |
- (void)printSubviewsWithIndentation:(int)indentation; | |
@end | |
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
By default, iOS will lock the screen and disable the touch sensor if there are no touch events for a specified period of time. Depending on your application, there may be times that you need to keep the screen from locking. For example, if your application is primarily accelerometer driven (such as a game), there may be minimal touch events to keep the screen from reseting its internal timer. | |
You can disable the idle timer through the idleTimerDisabled property of the shared UIApplication object: | |
// Disable the idle timer | |
[[UIApplication sharedApplication] setIdleTimerDisabled: YES]; | |
// Or for those who prefer dot syntax: | |
[UIApplication sharedApplication].idleTimerDisabled = YES; |
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
NSMutableDictionary *rootObj = [NSMutableDictionary dictionaryWithCapacity:1]; | |
NSString *stringFormat = @"My String stored in plist"; // Here any object can be pass NSNumber, NSArray, NSString, BOOL, NSDictionary. | |
[rootObj setObject:stringFormat forKey:@"commsEncodingFormat"]; | |
NSString *error = nil; | |
id plist = [NSPropertyListSerialization dataFromPropertyList:(id)rootObj format:NSPropertyListXMLFormat_v1_0 errorDescription:&error]; | |
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
#################### ZIP Cross Platform ###################### | |
#Link : http://www.coolestguyplanettech.com/how-to-compress-and-uncompress-files-and-folders-in-os-x-lion-10-7-using-terminal/ | |
#First up is ZIP one of the most commonly used compression techniques used across all platforms | |
#To compress | |
zip -r archive_name.zip <folder_to_compress> | |
#To extract | |
unzip archive_name.zip |
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 Terminal Pass this command | |
#FOR ALL FILES : | |
#------------- | |
defaults write com.apple.finder AppleShowAllFiles TRUE | |
killall Finder | |
#FOR PARTICULAR FILE : | |
#--------------------- |
NewerOlder