Posts

Remove trailing zero's from Double swift iOS

Solution: If you had an output that contains 0.1 it will return 0.1.If it was 1.0 it will return 1.If it was 1.1 it return 1.1 func forTrailingZero(temp: Double) -> String {     var roundDouble = String(format: "%g", temp)     return roundDouble } Function Call: Var doub = 3.0 forTrailingZero(doub)   //3

Vertically align text to top iOS UILabel

Solution: You cannot be able to align the label vertically.At the same time you can be able to set the number of line in UILabel.If you set that number of lines only if you want constantly particular number of lines. For example if you want that label will display only 2 lines then set the number of lines to 2. Otherwise you have to set that number of lines equal to 0 and call sizetofit. myLabel.numberOfLines = 0 myLabel.sizeToFit()

Xcode 11 creating project don't had storyboard and also swift file had different

Solution: In xcode 11 it had two different options available for app creation. 1.swiftUI framework 2.Storyboard framework By default swiftUI is selected.If you want storyboard based you must have to select that on the time of project creation.

Xcode 11 simulator hangs when type in textField inside app

Solution: Yes this issue is happening in xcode 11.If it occurs you must have to quit the simulator and run it again will be solved.Don't wait for recoverance. It's an xcode bug not your app issue.

Change the image background Color to white

Solution: If you don't know the photoshop then don't worry.Follow the below steps to change the backgroud color to white to your image. 1. First open the site link below https://www.imgonline.com.ua/eng/replace-white-background-with-transparent.php In that site scroll down and find that choose file option. Click on that it will get your file from your computer. Click the ok button below to convert your uploaded image background color to white. Finally click the download to download your converted image..Enjoyyyy...

iOS swipe down to close for popupview || iOS latest feature

Solution: In iOS 13 there is a huge option that will popover one view to another and swipe down the view to close. We can see how to achieve that. Code:              let  anotherView =  self . storyboard ?. instantiateVi ewController (withIdentifier:  " anotherView " )              if   #available ( iOS   13.0 , *) {                 anotherView?. isModalInPresent ation  =  false             }  else  {                  // Fallback on earlier versions             }              self . present (anotherView!, animated:  true , completion:  nil ) The above code is for present the view and swipe down we can close that.

Change background color of an image in MAC

Solution: 1. Open the image using preview in MAC. 2.In top of the menu select preview -> Preference -> General 3.Option shown as window background -> select on that color pallete. 4. Change the colors whatever you want and save.