Skip to content

Instantly share code, notes, and snippets.

View xandrucea's full-sized avatar

Alex Cio xandrucea

View GitHub Profile
Create ActionSheet for iOS 7 and iOS 8
--------------------------------------
// if( [[UIDevice currentDevice] systemVersion].doubleValue < 8.0 ){
UIActionSheet *actionSheet = [UIActionSheet new];
[actionSheet setTitle:prodAdFree.localizedTitle];
[actionSheet setDelegate:self];
[actionSheet setCancelButtonIndex:2];
[actionSheet addButtonWithTitle:NSLocalizedString(@"Produkt kaufen", @"")];
[actionSheet addButtonWithTitle:NSLocalizedString(@"Produkt wiederherstellen", @"")];
[actionSheet addButtonWithTitle:NSLocalizedString(@"Abbrechen", @"")];
/*
* System Versioning Preprocessor Macros
*/
#define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
#define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)
format UIDatePicker if labels background white
----------------------------------------------
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss zzzzz"];
NSString *stringyDate = @"2014-06-02 10:10:00 +0000";
NSDate *helperDate = [dateFormatter dateFromString:stringyDate];
datePickerDueDate.date = helperDate;
don't resize screen on TabBarController/TableView....
-----------------------------------------------------
if( [self respondsToSelector:@selector(edgesForExtendedLayout)] ) {
self.edgesForExtendedLayout = UIRectEdgeNone;
}
turn off header
---------------
1. General --> Deployment Info --> Status Bar Style, select "Hide during application launch"
2. Info --> View controller-based status bar appearance --> NO
Can't find references -L /../../../
-----------------------------------
Build Settings --> search for 'search'
check:
- Framework Search Paths
- Header Search Paths
- Library Search Paths
ich bin *jahre alt
condition
---------
* == {{placeholder}}
--> Oha, {{placeholer}} jahre ?!
{% if has("jahre") %}
Du bist get("jahre")
{% else %}
!!!!!!
On every user input the methods "textViewDidChange", "resizeTextViewHeight" and "textView:shouldChangeTextInRange" will be called
!!!!!!
hide keyboard when pressing return button
-----------------------------------------
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text {
if([text isEqualToString:@"\n"]) {
Send email
----------
- (IBAction)btFeedback:(id)sender {
if ([MFMailComposeViewController canSendMail]) {
NSString *infoString =
[NSString stringWithFormat:@"\n\nUserid: %@ \nUsername: %@ \nIsPush enabled: %@",
_userId,
change filenames inside all subdirs
-----------------------------------
$ for i in * ; do echo $i; mv $i/Localizable.strings $i/RatingLoc.strings; done
for file in *; do mv $file "es_3_$file.dat"; done
convert sound (audio) files from .wav to .mp3
---------------------------------------------
find ./ -name "*.wav" -execdir lame -V 3 -q 0 {} \;
updating pod to new tag
-----------------------
git status
git tag -n
git pull
git pull origin development
git tag -n
git tag [newNumber] -am "comment"
git tag -n
git push