how to Stop UIWebView from “bouncing” vertically?
for (id subview in webView.subviews)
if ([[subview class] isSubclassOfClass: [UIScrollView class]])
((UIScrollView *)subview).bounces = NO;

❣ Chile in a Photography ❣
RMH

No title available
sheepfilms

roma★
No title available
occasionally subtle
Keni
𓃗

Andulka
h
Mike Driver
PUT YOUR BEARD IN MY MOUTH

No title available
macklin celebrini has autism
One Nice Bug Per Day
Claire Keane
"I'm Dorothy Gale from Kansas"
Game of Thrones Daily

tannertan36

seen from Romania

seen from Venezuela

seen from Maldives

seen from China

seen from United States

seen from Sweden
seen from Ecuador
seen from Indonesia
seen from United States
seen from Ukraine

seen from Malaysia

seen from Russia
seen from Mexico
seen from Bulgaria

seen from Argentina

seen from Türkiye
seen from United States
seen from Colombia
seen from United Kingdom
seen from United States
@i-omar-blog
how to Stop UIWebView from “bouncing” vertically?
for (id subview in webView.subviews)
if ([[subview class] isSubclassOfClass: [UIScrollView class]])
((UIScrollView *)subview).bounces = NO;
How to add UITapGestureRecognizer in UIScrollView subview
- (void)loadView {
[super loadView];
UIImage *myImage = [UIImage imageNamed:@"img1.jpg"];
imageView = [[UIImageView alloc] initWithImage:myImage];
[myImage release];
// add gesture recognizers to the image view
UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTap:)];
[imageView addGestureRecognizer:singleTap];
[singleTap release];
[imageScrollView setContentSize:CGSizeMake(imageView.frame.size.width, imageView.frame.size.height)];
[imageScrollView setCanCancelContentTouches:YES];
[imageView setUserInteractionEnabled:YES];
[imageScrollView addSubview:imageView];
}
- (void)handleSingleTap:(UIGestureRecognizer *)gestureRecognizer {
NSLog(@"sinlgeTap called");
}
Groundhog Day
Groundhog Day
كيف تتعامل مع موظف متأخر في تسليم المشروع
هناك اكثر من طريقه ممكن ان تتعامل من خلالها مع موظف متأخر في تسليم المشروع
ولكن عندما تكون الحالة مثالية حيث ترى موظف متأخر يحاول انهاء العمل لا تأتي اليه و تقول لا يمكنك انهاء المشروع و تقوم بتوبيخه و تظن نفسك انك تشجعه، لن يتشجع الموظف بل سيقوم بإغلاق جهازه و الذهاب للبيت او مكان لكتابة مقاله ، مثل هذا
الحل في ظني ومن تجاربي مع شركات كان العمل فيها مرهق و طويل ان تقول له بالتوفيق و تشجعه و تقول له هل تريد ان نقدم طعام العشاء على حساب شركة و في نهاية المشروع تقوم بتنويه انه تأخر المشروع ولكن تقول ان الشباب قامو بالواجب الذي عليهم و زيادة هذا سيؤدي لكسب عقل وقلب الموظف الذي تريد ان تحصل عليه ان كنت تريد ذلك
How to Delete All Objects in CoreData
- (void) deleteAllObjects: (NSString *) entityDescription {
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:entityDescription inManagedObjectContext:self.managedObjectContext];
[fetchRequest setEntity:entity];
NSError *error;
NSArray *items = [self.managedObjectContext executeFetchRequest:fetchRequest error:&error];
[fetchRequest release];
for (NSManagedObject *managedObject in items) {
[self.managedObjectContext deleteObject:managedObject];
NSLog(@"%@ object deleted",entityDescription);
}
if (![self.managedObjectContext save:&error]) {
NSLog(@"Error deleting %@ - error:%@",entityDescription,error);
}
}
how to add corner Radius to UIView like UITextView or UIImageView
#import <QuartzCore/QuartzCore.h>
self.textView.clipsToBounds = YES;
self.textView.layer.cornerRadius = 10.0f;
how to set set Background Image for UITabBar
-(void)setbgImage{
UIImage *bgimage =[UIImage imageNamed:@"tab.png"];
if([self respondsToSelector:@selector( setBackgroundImage:)])
[self setBackgroundImage:bgimage];
else{
CGRect frame = CGRectMake(0.0, 0, self.bounds.size.width, 48);
UIImageView *imageView = [[UIImageView alloc]initWithImage:bgimage];
imageView.frame= frame;
[self insertSubview:imageView atIndex:0];
[imageView release];
}
How to create a UITableViewCell with a transparent background
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
cell.backgroundColor=[UIColor clearColor];
cell.backgroundView.backgroundColor =[UIColor clearColor];
}
How to know if the current Device is iPad
[[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad
How to get keyboard Animation Duration
- (NSTimeInterval)keyboardAnimationDurationForNotification:(NSNotification*)notification
{
NSDictionary* info = [notification userInfo];
NSValue* value = [info objectForKey:UIKeyboardAnimationDurationUserInfoKey];
NSTimeInterval duration = 0;
[value getValue:&duration];
return duration;
}
http://stackoverflow.com/questions/1419221/what-is-the-iphones-default-keyboard-animation-rate
animateWithDuration
- (IBAction)onTap:(id)sender {
BOOL isHidden =self.nextprevView.hidden ;
if (self.nextprevView.hidden) {
self.nextprevView.alpha=0.0f;
}
[UIView animateWithDuration:0.5 animations:^{
if (isHidden)
self.nextprevView.hidden = NO;
if (self.nextprevView.alpha == 0.0f)
self.nextprevView.alpha=1.0f;
else
self.nextprevView.alpha=0.0f;
} completion:^(BOOL completed){
if (!isHidden)
self.nextprevView.hidden = YES;
}];
}
How to save in coredata with out duplication
+ (Photo *)photoWithFlickrData:(NSDictionary *)flickrData inManagedObjectContext:(NSManagedObjectContext *)context
{
Photo *photo = nil;
NSFetchRequest *request = [[NSFetchRequest alloc] init];
request.entity = [NSEntityDescription entityForName:@"Photo" inManagedObjectContext:context];
request.predicate = [NSPredicate predicateWithFormat:@"uniqueId = %@", [flickrData objectForKey:@"id"]];
NSError *error = nil;
photo = [[context executeFetchRequest:request error:&error] lastObject];
[request release];
if (!error && !photo) {
photo = [NSEntityDescription insertNewObjectForEntityForName:@"Photo" inManagedObjectContext:context];
photo.uniqueId = [flickrData objectForKey:@"id"];
photo.title = [flickrData objectForKey:@"title"];
photo.imageURL = [FlickrFetcher urlStringForPhotoWithFlickrInfo:flickrData format:FlickrFetcherPhotoFormatLarge];
photo.whoTook = [Photographer photographerWithFlickrData:flickrData inManagedObjectContext:context];
}
return photo;
}
----------------------------
+ (Photographer *)photographerWithFlickrData:(NSDictionary *)flickrData inManagedObjectContext:(NSManagedObjectContext *)context
{
Photographer *photographer = nil;
NSFetchRequest *request = [[NSFetchRequest alloc] init];
request.entity = [NSEntityDescription entityForName:@"Photographer" inManagedObjectContext:context];
request.predicate = [NSPredicate predicateWithFormat:@"name = %@", [flickrData objectForKey:@"ownername"]];
NSError *error = nil;
photographer = [[context executeFetchRequest:request error:&error] lastObject];
[request release];
if (!error && !photographer) {
photographer = [NSEntityDescription insertNewObjectForEntityForName:@"Photographer" inManagedObjectContext:context];
photographer.name = [flickrData objectForKey:@"ownername"];
}
return photographer;
}
How to custom UITableView drawing
http://cocoawithlove.com/2009/04/easy-custom-uitableview-drawing.html
How to Custom UIKit Controls
https://github.com/boctor/idev-recipes
CustomBackButton
CustomSegmentedControls
CustomTabBar
CustomTabBarNotification
RaisedCenterTabBar
SideSwipeTableView
StretchableImages
TabBarAnimation
TransparentUIWebViews
VerticalSwipeArticles
WoodUINavigation
WordPressReimagined
How can I disable the UITableView selection highlighting?
cell.selectionStyle = UITableViewCellSelectionStyleNone;
How to know when UITableView did scroll to bottom
http://stackoverflow.com/questions/5137943/how-to-know-when-uitableview-did-scroll-to-bottom
- (void)scrollViewDidScroll:(UIScrollView *)aScrollView {
CGPoint offset = aScrollView.contentOffset;
CGRect bounds = aScrollView.bounds;
CGSize size = aScrollView.contentSize;
UIEdgeInsets inset = aScrollView.contentInset;
float y = offset.y + bounds.size.height - inset.bottom;
float h = size.height;
// NSLog(@"offset: %f", offset.y);
// NSLog(@"content.height: %f", size.height);
// NSLog(@"bounds.height: %f", bounds.size.height);
// NSLog(@"inset.top: %f", inset.top);
// NSLog(@"inset.bottom: %f", inset.bottom);
// NSLog(@"pos: %f of %f", y, h);
float reload_distance = 10;
if(y > h + reload_distance) {
NSLog(@"load more rows");
}
}