Showing: 31 - 40 of 71 Articles

UITableViewCell does not set according to text/components after using UITableViewAutomaticDimension

To overcome this issue we have to set layout of the cell after inserting any values into cell. Refer below code: -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { CustomTableViewCell *cellCustom = (CustomTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cellCustom == nil) { cellCustom = [[CustomTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; } …

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() }  

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] …