Posts

Seperate phone number with country code iOS swift || Get only the phone number from iOS swift || How to remove country code while Pick Phone Number from contacts

 Solution:      The below function will return the phone number if you given with country code and + symbol.Its a default method in iOS. If you had the phone number with different countries with country code and other formate just pass it as string to the below function and get the original phone number.You don't need any pod files to get that.It's a default method in iOS.  Before you start the function must import the  PhoneNumberKit module to your project. Code: import  PhoneNumberKit func phoneNumberParse(phoneNo:String) -> String { var phNo:String: "" let  phoneNumberKit =  PhoneNumberKit ()        do  {            let  phoneNumber =  try  phoneNumberKit. parse (phoneNo)         phNo  = String(describing:phoneNumber. nationalNumber )       }        catch  { } return phNo }

Mac unable to install the package of the software downloaded from chrome

Image
 Solution: 1.First open the package it shows unable to install. 2.Open system preference app in your mac or goto apple logo in top of the menu and select preference -> open security and privacy 3. 4. select click the lock to make changes. 5.Enter password to unlock 6.In allow apps downloaded from that show your software name and says open it anyway..click on that and install. .

How to log an cgaffaintransform in objective C

 Solution: You cannot directly log the cgaffaintransform for that you can convert the CGAffaintransform into strin and log into that.      NSLog ( @"state = %@" , NSStringFromCGAffineTransf orm ( Object . tr ansform ));  

How to get the label value from contacts using phone number || cnlabel get string swift || CNContact get the name label and name

 Solution:    Below you can find the label and name from the phone number.        for  cont  in  place. phoneNumbers         {            let  replaced = cont. value . stringValue . replaci ngOccurrences (of:  "[^0-9+]" , with:  "" , options:  NSString . CompareOptions . regula rExpression , range: nil )            if  replaced  ==  my phoneNumber                     {                        let  localizedLabel =  CNLabeledValue < NSString >. local izedString (forLabel: cont. label !)                        let  PhoneLabel  = localizedLabel                        ...

CollectionView SwipecollectionCell after edit collectionView not resigned

 Solution: Before you have to call the below method don't reload the cell.  func   hideSwipeCollectionViewCells () {        print ( CollView . indexP athsForSelectedItems )          for  cell  in   workSpaceCollView . visibleCells  {              if   let  cell = cell  as ?  SwipeCollectionViewCell  {                 cell. hideSwipe (animated:  false )             }         }     }

Common tableView cell for more rows display crash while using different cell iOS swift

 Solution: If you are using different cells for a particular section then must return every section with cell.Because if you are using two section with one common cell and another two sections with another cell then declare it in every section with cell and return it.Don't use in common cell for few cells.Because iOS not allow you to reuse more cells in particular section.Only one cell to be returned for every section.

Cannot add something to an array swift

 Problem: I want add some values to an array iOS swift.Not able to add in that. Solution: It's not possible to add values in an array.You can assign values to an array is possible. In NSMutableArray only you can add values in that dynamically. var value:NSArray! value.addObject(some value).    ////not possible var value:NSMutableArray! value.addObject(some value).    ////possible