Posts

ShadowedView corner radius not working iOS swift

 Solution: MaterialComponents/ ShadowElevations to set corner radius in swift      func setCorner () {         self . cornerRadius = 10         self . layer . masksToBounds = true         self . clipsToBounds = false     } Then call the function as like below.          shadowView .setCornerSmall()

Print one scrollview without bottom view in swift

Problem: I want to print the content of scrollview. But  end of scroll view my print button is there.I want to print without that button.How to achieve that.  Solution: It's possible.You first hide the button after click print then generate the pdf.After generation of pdf show the button.It will works perfectly.      func   printContent () {                   let  printInfo =  UIPrintInfo ( dictionary :  nil )         printInfo. jobName  = scroll View . description         printInfo. outputType  = . general           self .scroll View.subviews.last.ishidden = true          let  path =  self . scroll View . exportAsPdfFromVi ews ()         self .scroll View.subviews.last.ishidden = false          let  printC...

Push Notification certificate to backend team iOS swift

 Solution: For push notification you have to give push notification certificate also private key to the backend team for pushing notifications to apns server using device token First you have to create push notification sandbox/production certificate in app store connect portal.Before you have to create you have to open keychain access in our mac And select keychain access-> request a certificate from certificate authority then use mail address and select save to disk.After generate certificate will be downloaded and saved to your keychain. Then use the certificate to create push certificate in portal. After that download the certificate and open it will be saved in keychain access. After that right click that certificate in keychain access export then select as p12 certificate then export. Goto the directory exported then run the below command. for the certificate that you had openssl   pkcs12 -nokeys -in /Users/mypath/ PushDevCertificates.p12 -passin pass:"Mypass" To...

iPhone Distribution Certificate is not trusted push notification issue keychain

Image
 Problem: I'm having problem that i downloaded the push notification certificate and added in keychain access. But certificate shows that my certificate is invalid.How to solve the issue? Solution: Download the below certificates from the below url https://www.apple.com/certificateauthority/ Then install it in your mac.Problem solved..

UITableview avoid top pulling

 Problem: I want to avoid the top pulling in UITableview but bottom to top scroll wants. Solution:    func   scrollViewDidScroll ( _   scrollView:   UIScrollView ) {               if   scrollView. contentOffset . y   < 0 {                   scrollView. contentOffset . y   = 0               }           }

IQKeyboard manager add done button for particular text field also add done button action for that iOS swift

 Problem: I'm using IQKeyboard manager for keyboard appearance and done button.I want to change the done button title as cancel for some textfields also some textfields i want to be as done. I want to add action for done button for particular textfield. Solution:      func textFieldDidBeginEditing ( _ textField: UITextField ) {         IQKeyboardManager . shared . toolbarDoneBarButtonItemText = "Cancel" // you can compare the textfield here and change the title as per your requirement     } for done button action add the below code          tf .keyboardToolbar. doneBarButton.setTarget( self , action:  #selector ( doneButtonClicked ))      @objc   func   doneButtonClicked () { tf. resignFirstResponder () }

TableView top one space came in swift iOS

 Problem: I don't had added headers in tableview. But in iOS 15 it came as one small space above the tableview.In previous versions of iOS no space came it works perfectly. Solution: Add the below code in viewdidload to solve the above problem.    if   #available (iOS 15.0, *){               self . tableView . sectionHe aderTopPadding   = 0.0           }