Posts

Showing posts from October, 2022

While using event identifier after save the event the identifier changes in calender type exchange

 Solution: You can try that after save wait for 2 seconds and then get the event identifier it will works.but its not a good solution. You don't have to save the eventidentifier in your reference.Instead of you can fetch the event with start date,End date and title using predicate.

PublishSubject cell issue RXswift

 Problem: class  myC ell :  UITableViewCell  {      @IBOutlet   weak   var   NameFld : TextField!      var   disposeBag  =  DisposeBag ()           override   func   awakeFromNib () {          super . awakeFromNib ()          // Initialization code     }      override   func  setSelected(_ selected:  Bool , animated:  Bool ) {          super . setSelected (selected,  animated : animated)          // Configure the view for the selected state     } } The above is my code It produces error that if i tried for reuse that cell all values collapsed Solution:      override   func   prepareForReuse () {          disposeBag  =  DisposeBag () ...

create dropdown using materialdesign in swift iOS

 Solution: You can achieve the dropdown as like below. 1.First you have to create an imageview with dropdown arrow 2.Then after create textfield using material design pattern 3.Set the imageview as trailing view to the textfield then set the trailing view mode as always 4.Below code we can set the dropdown as well as field required symbol as placeholder also image tint color.Finally we can set the height of textfield and placeholder color          let dropdownImage = UIImageView()         dropdownImage.image = UIImage(named: "arrow_down_black_24pt" )             dropdownImage.frame = CGRect(x: 0 , y: 0 , width: 30 , height: 30 )               let tf = MDCOutlinedTextField()              tf.frame = CGRect(x: 10, y: 10, width: 200, height: 50)              tf.label.text = required == 1 ? placeHolder...

Create textField and textView with required asterisk symbol using materialdesign iOS swift

 Solution: You cannot be able to set asterisk symbol in the textfield.instead of you can append in end of the placeholder text to achieve that.              field.label.text = placeholder.appending( "*" )

RXSwift history

 Solution: In 2012 microsoft had launched rx for their .Net framework for dynamic prototype for open source. After that it has derived with rxJS, rxSwift,rx.Net,rxJava had derived for MVVM framework 

TextView implementation using material design iOS swift || MDCOutlinedTextArea implementation

   Solution: Import the below libraries in your class import  MaterialComponents.MaterialTextControls_FilledTextAreas import  MaterialComponents.MaterialTextControls_OutlinedTextAreas import  MaterialComponents.MaterialTextControls_OutlinedTextAreasTheming Inside the class you can create the textView as like below         let  textViewCustom =    MDCOutlinedTextArea() You can set the placeholder as like below textViewCustom.label.text =  "placeholder" You can set the outline border color as like below   textViewCustom.setOutlineColor(UIColor.red, for: .normal) You can set the placeholder color as like below   textViewCustom .setNormalLabel(.lightGray, for: .normal) You can minimise the height of the field using below option          textViewCustom .verticalDensity =  40          textViewCustom.maximumNumberOfVisibleRows = 2 You can increase the height value n...

How to update expired build to available build without archive in iOS swift

 Solution: Goto XCode menu options window -> organiser -> archives Select the file you want to upload to the app store right click on the build then select show package contents It will show you all the ipa files with info.plist file open the plist then change the build version after that goto organiser and upload that build to the app store and enjoy the app...

TextField implementation using material design iOS swift || MDCOutlinedTextField implementation

 Solution: Import the below libraries in your class import MaterialComponents.MaterialTextControls_FilledTextAreas import MaterialComponents.MaterialTextControls_FilledTextFields import MaterialComponents.MaterialTextControls_OutlinedTextFieldsTheming Inside the class you can create the textfield as like below         let  textField =   MDCOutlinedTextField() You can set the placeholder as like below textField.label.text =  "placeholder" You can set the outline border color as like below   textField.setOutlineColor(UIColor.red, for: .normal) You can set the placeholder color as like below   textField.setNormalLabelColor(.lightGray, for: .normal) You can minimise the height of the field using below option          textField.verticalDensity = 40 You can increase the height value not the fontsize and other as using below          textField.preferredContainerHeight = 100

Selection style for particular sections in a tableView wants to be none in swift

 Problem: I had a tableview with few sections.I want some sections to be selectable and some rows wants to be non selectable with no gray option. Solution:             cell. selec tionStyle  = . none You have to add the above to the particular cell.It will works good.Happy coding..

Get the last row in a section iOS swift

 Solution: How to get the last row in one section.You can change only the last index except other indexes in the table.              let  lastRowIndex = tableView. numberOfRows ( inSecti on : indexPath. section ) - 1

Invalid conversion from throwing function of type '(AFDownloadResponse)

 Problem: I had the error as like below Invalid conversion from throwing function of type '(AFDownloadResponse<URL?>) throws -> Void' (aka '(DownloadResponse<Optional< URL>, AFError>) throws -> ()') to non-throwing function type '(AFDownloadResponse<URL?>) -> Void' (aka '(DownloadResponse<Optional< URL>, AFError>) -> ()')  I had added the line below after that error came                          let  fileURLs =  try   FileManager . default . contentsOfDirectory(at:  URL ( string : path)!, includingPropertiesForKeys:  nil ) Firebase download after that added the above line then error came Solution: The error came because of you don't handled the try block.After added with do and catch block error was removed.Happy coding                      do  {           ...