Posts

TableViewCell has "Class Cell has no initializers" error RXSwift

 Solution:      var   viewModel : My Model ? {          didSet  {              bindModel ()         }     } You must have to define the correct model in this.That's why the issue came.If model is wrong the above issue will shown...

Get the sender object from UITapGestureRecognizer

 Solution:                  let  tapGestureRecognizer =  UITapGestureRecognizer ( target : vc,  action :  #selector (vc. tapEventAction ( se nder :)))                 cell.i mg . addGestur eRecognizer ( tapGestureRecognizer)                 } When tap called       @objc   func   tapEventAction ( sender :  UITapGestureRecognizer ) {          let  btn = sender. view   as !  UIImageView }

{Error Domain=NSPOSIXErrorDomain Code=17 "File exists"}}]... iOS swift

 Problem: While i tried to copy one image from one path to another path.That time i faced the error like below. {Error Domain=NSPOSIXErrorDomain Code=17 "File exists"}}]... Solution: While copy the file you must have to append the filename in the pasted url path and paste it.Then only it will works good.Otherwise the above error will be occur.

SwipeCollectionViewCellDelegate not working iOS swift

 Problem: SwipeCollectionViewCellDelegate not working while using  swipecellkit. Solution: cell.delegate = self You must have the above line then only it will works

View not able to set constraints iOS swift

Image
Solution:  While setting constraints that not updated then must check the below condition.Layout must be infered not autoresizing.

KNContactsPicker remove empty phone numbers while picking contact swift

 Problem: I had used KNContactsPicker for adding contacts in my app.But it fetches empty phone numbers also .How to avoid fetching empty contacts swift? Solution: KNcontact picker had settings.You can also select multiple contacts.You can use the condition as below that  " !contact. phoneNumbers . isEmpty ".For fetching the contacts. Code: import  KNContactsPicker     var   settings  =  KNPickerSettings ()  settings . selectionMode  = . multiple settings . subtitleDisplayInfo  = . phoneNumber settings . conditionToDisplayCon tact  = { contact  in                  return  !contact. phoneNumbers . isEmpty             } let  controller =  KNContactsPicker ( delegate :  self ,  settings :  self . settings ) self . navigationController ?. pre sent (controller,  animated :  true ,  completion :  ...

iOS Coding standards || XCode coding standards

 Solution: iOS had some specific guidelines for coding. Variable declaration: Variable must start with small letters.If they had second important name then that name have capital letter.Like below var name:String!  // correct var Name:String!  // wrong var firstName:String! //correct  var Firstname:String! //Wrong Function Declaration:    func didChangesFontSize (fontSize: Float ) // correct     func  D idchangesfontsize (fontSize: Float ) // Wrong  Functions must start with small letter and follow to capital letters.