- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Nitin Aggarwal has Published 156 Articles
Nitin Aggarwal
2K+ Views
In Swift, you can use the Equatable protocol to compare enums with associated values. In this article, we will see how we can compare them using the Equatable protocol with an example. Enumeration with Associated Values In Swift, you can provide a value along with an enum case. This makes ... Read More
Nitin Aggarwal
5K+ Views
In Swift, you can use the built-in Data type and its method base64EncodedString() to encode a string to Base64. In the iOS applications, you might need to encode a string to base64 mostly in networking requests and responses. Mostly, you will need to encode a string to base64 and vice ... Read More
Nitin Aggarwal
946 Views
In Swift, you can use the Codable protocol to make an enum decodable as well. In Swift, the Codable protocol is a very powerful concept to provide flexibility to decode and encode any type of value. Also, you can make an enum decodable as well. You have to just define ... Read More
Nitin Aggarwal
5K+ Views
Swift provides a class called JSONSerialization to convert a JSON string to dictionary format. For example, you are receiving a JSON string from the database, in order to use it in the application, you might need to convert it into a real object type. In this article, you will see ... Read More
Nitin Aggarwal
2K+ Views
To convert a number to its absolute value in Swift, you can use the abs(_:) function. In this article, you will see multiple examples of how to use the abs() function in the Swift language. Example 1 In this example, you will convert a simple negative number to an absolute ... Read More
Nitin Aggarwal
7K+ Views
Swift provides a class called JSONSerialization to convert a dictionary to a JSON string. We will use the two steps to convert a dictionary to a JSON string in the Swift language. Here are the steps − Convert a dictionary into JSON data format using JSONSerialization.data() method which takes ... Read More
Nitin Aggarwal
511 Views
To remove an object by value from an array in Swift, you can create an extension to the Array type. You can then call the function that takes the value to eliminate as a parameter. In this article, we will use the filter function to remove an object passing by ... Read More
Nitin Aggarwal
1K+ Views
In Swift, you can convert a float to an Int by using the Int() constructor. This will round the float value toward zero and return an integer value. Remember that, this constructor returns an optional value, so you have to use an optional binding approach to wrap the value safely. ... Read More
Nitin Aggarwal
2K+ Views
In Swift, there is a dedicated class called UIPasteboard that allows you to copy text to the pasteboard. The same class allows you to paste the text. A UIPasteboard class is part of the UIKit framework that provides a general processor for copying and pasting information in iOS applications. In ... Read More
Nitin Aggarwal
3K+ Views
In Swift, there are different approaches to iterating a for loop in reverse order. In this article, you will see some methods like reverse, ranges, stride(from:to:by:), forEach(), etc. Each method can be used in different use cases. Also, you should know that each method has its own performance. Using the ... Read More
To Continue Learning Please Login
Login with Google