Split a comma separated string into swift array
If you have got a string which is separated using any delimiter like ‘,’ or space or ‘|’ or any other fixed delimiter, you can easily split it in swift by using the following function
If you have got a string which is separated using any delimiter like ‘,’ or space or ‘|’ or any other fixed delimiter, you can easily split it in swift by using the following function
We can easily sort a swift array using two provided function array.sort array.sorted We will see both array.sort() and array.sorted() in action and will understand how they differ from each other in a subtle way, while sorting a swift array in place and returning a sorted copy of the swift array. Example code for the … Read more
Defer statement in swift is executed just before the control exits the scope in which defer is defined. Swift’s official document states
In real life, we are used to degrees and in programming, we deal mostly with radians. If you are dealing with drawing specifically arc and circles you will come across situations where you have to toggle between degrees and radians and at other times between radians to degrees. Relationship between Degrees and Radian The above … Read more
While trying to set a custom rootViewController in swift with a UIWindow, in the traditional way results in a black screen. The reason is now we need to use UIWindowScene to create a UIWindow instance.
It is a very tough job to delete 9gag comments from a very active thread as your comment will be hidden somewhere amongst thousands of comments. But I will share with you an easy way to do it. Using this method you will be able to go to your comments directly one by one and delete them no need to search for needles in a haystack.
Easy examples to basic swift timer functionality like passing user info, creating repeating swift timers invalidating swift timers and more
. In SwiftUI we can create views in a loop using ForEach. ForEach is a view structure i.e you can use it directly in the body. Example code is given below
So you have added a new file to .gitignore or you have just added a new .gitignore file to your existing repo. The problem is same you don’t want git to rack one or many files. This can be archived in simple 3 step process. Assuming that you have already added or updated .gitignore file … Read more
Git branch can be deleted easily using following commands Most of the time remote name is origin. For deleting git branch locally you can use following command If you are working in a large team and you don’t want to keep deleted branch locally you can prune your repo by using following command Hope this … Read more