Skip to content

Instantly share code, notes, and snippets.

View xandrucea's full-sized avatar

Alex Cio xandrucea

View GitHub Profile
@xandrucea
xandrucea / Alert View Snippet
Created July 15, 2013 12:51
Alertview with Activity inidicator
UIActivityIndicatorView *activityView;
UIAlertView *waitAlertView;
// delegate method of alert view
- (void)willPresentAlertView:(UIAlertView *) currAlertView {
if ( waitAlertView == currAlertView) {
activityView.center = CGPointMake( waitAlertView.bounds.size.width / 2, waitAlertView.bounds.size.height / 2 );
}
}
Check tap on UIWebView
----------------------
1. add UIGestureRecognizer to declaration (h.file)
2. create TapGestureRecognizer and add to webview
UITapGestureRecognizer *webViewTapped = [[UITapGestureRecognizer alloc] initWithTarget:self
action:@selector(showIntersticial)];
webViewTapped.numberOfTapsRequired = 1;
webViewTapped.delegate = self;
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
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 {} \;
Send email
----------
- (IBAction)btFeedback:(id)sender {
if ([MFMailComposeViewController canSendMail]) {
NSString *infoString =
[NSString stringWithFormat:@"\n\nUserid: %@ \nUsername: %@ \nIsPush enabled: %@",
_userId,
!!!!!!
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"]) {
ich bin *jahre alt
condition
---------
* == {{placeholder}}
--> Oha, {{placeholer}} jahre ?!
{% if has("jahre") %}
Du bist get("jahre")
{% else %}
Can't find references -L /../../../
-----------------------------------
Build Settings --> search for 'search'
check:
- Framework Search Paths
- Header Search Paths
- Library Search Paths
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
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;