Posts

Showing posts from June, 2019

undefined symbol sqlite3_column_table_name error in iOS swift

Solution: When your project does not added the sqlite framework then the above error will came.So try to add the framework in your project and compile it will works.

Git error no file found for particular path but the file had already exist

Solution: If you are the file within the folder and that foldername contains space then remove the space and commit it will works good.

activityIndicator in swift 5

Solution: The below code is used for activity indicator in swift 4              let  activityIndicator = UIActivityIndicatorView( activityIndicatorStyle: . white ) In swift 5 the below code is used. let  activityIndicator =  UIActivityIndicatorView (style: . white )

String functions in swift 5

Solution: In swift 4 the below code is used for capitalise the first letter. String(characters.prefix(1)). capitalized In swift 5 below code is used for capitalise the first letter. let  first =  String ( prefix ( 1 )). capitalized             

How to get string characters count in swift 5

Solution: In swift 4 we are using the below code to find the characters in a particular string charactrers.count In swift 5 we are using the below code string.count

UIEdgeInsetsInsetRect not working in swift 5

Solution:  The below code is used in swift 4.In swift 5 it shows as error. Swift 4: UIEdgeInsetsInsetRect( relativeFrame, self.touchAreaEdgeInsets) swift 5: relativeFrame. inset (by:  self . touchAreaEdgeInsets ) Relative frame is known as the frame that you want to set the edges.

How to see which version of Swift I'm using in Xcode?

Solution: Select your project -> Select the target ->select build Settings -> in search type "swift_version" then it will show your version you had used in your app.

Convert Int to String in Swift iOS

Solution: If you had an variable with datatypes like Int,Float,Double,Nsnumber or others then you can easily convert that into String using below method. String(describing:yourValue)

How to add a target to a button using selector iOS swift?

Solution:         Btn.addTarget( self , action: #selector (btnPressed), for: UIControlEvents.touchUpInside) btnpressed function implementation will be like below      func  btnPressed() { }

How to get a length of a string iOS swift?

Solution: The below functions are used for counting the number of characters in a particular string.     var yourString: String = "string count" If your string will be like above then Swift 4: yourString.count Swift 2: yourString. characters.count Swift 1: Count(yourString)