When you add data dynamically in table, You have to “refresh” table after data append otherwise it does not display data in table. Simple you need to write following line in your java-script file. $(“#your_table_id”).table(“refresh”);
Reusable cell issue.
override func prepareForReuse() { super.prepareForReuse() btnAccept.hidden = true }//This method is also helpful when you get multiple redundant images.
Clear Cache Memory
override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated.. removeCacheMemmory() } func removeCacheMemmory(){ SDWebImageManager.sharedManager().imageCache.clearMemory() SDWebImageManager.sharedManager().imageCache.clearDisk() SDImageCache.sharedImageCache().cleanDisk() SDImageCache.sharedImageCache().clearMemory() NSURLCache.sharedURLCache().removeAllCachedResponses() }
Facebook Background Post Sharing
Step 1 : Create project on facebook developer page and get facebook app id Step 2 : Insert following gradle file and sync your project compile ‘com.facebook.android:facebook-android-sdk:4.5.0’ Step 3 : Put your facebook app id in string resources as given below <string name=”facebook_app_id”>1763757463948957</string> Step 4 …
3D Touch
– (void)viewDidLoad { [self registerForPreviewingWithDelegate:self sourceView:MyView]; } #pragma mark UIViewControllerPreviewingDelegate – (UIViewController*)previewingContext:(id<UIViewControllerPreviewing>)previewingContext viewControllerForLocation:(CGPoint)location { UIView *ViewTouch = previewingContext.sourceView; UIViewController *ViewNew = [self.storyboard instantiateViewControllerWithIdentifier:@”demo1″]; return ViewNew; } – (void)previewingContext:(id<UIViewControllerPreviewing>)previewingContext commitViewController:(UIViewController *)viewControllerToCommit { [self.navigationController pushViewController:viewControllerToCommit animated:YES]; }
Touch ID Authenticate
LAContext *context = [[LAContext alloc] init]; NSError *error = nil; if ([context canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&error]) { [context evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics localizedReason:@”Login with Touch ID” reply:^(BOOL success, NSError *error) { if (error) { UIAlertView *Alert = [[UIAlertView alloc] initWithTitle:@”Login” message:@”Login Fail” delegate:self cancelButtonTitle:@”Close” otherButtonTitles:nil, nil]; [Alert show]; } if …
SetBadge on UITabBarController
Make Extension of UITabBarController extension UITabBarController { func setBadges(badgeValues: [Int]) { for view in self.tabBar.subviews { if view is CustomTabBadge { view.removeFromSuperview() } } for index in 0…badgeValues.count-1 { if badgeValues[index] …
Integrate Redis cache mechanism to make website performance faster
If there is API which needs to call again and again. To call API many times will make the website performance very slow. We can use Redis cache mechanism to make website performance faster. Why Redis? It’s a “NoSQL” key-value data store. More precisely, it …
Getting error while adding APNS certificate to Firebase
To overcome this issue while creating an app on Firebase select proper bundle identifier, if you are using com.inheritx.pushnotification for creating apple push notification certificate than writing com.inheritx.pushnotification while configuring an application on Firebase bundle identifier.
UILable Extension for Dynamic Lable font
extension UILabel { func fitFontForSize(var minFontSize : CGFloat = 15.0, var maxFontSize : CGFloat = 300.0, accuracy : CGFloat = 1.0) { assert(maxFontSize > minFontSize) layoutIfNeeded() // Can be removed at your own discretion let constrainedSize = bounds.size while maxFontSize – minFontSize > accuracy { …