
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 516 Articles for Swift

3K+ Views
This tutorial will discuss how to write swift program to convert double type variable to int. Swift support various datatypes and double and string are one of them. String is an ordered collection of characters. For example: “TutorialsPoint”, “Pinky”, etc. To create a string type variable, we use String keyword. Whereas Double is used to represent 64-bit floating point numbers. For example, 34.55656, 9.8283, etc. To create a double type variable, we use Double keyword. To convert double type variable into string we uses String() function. This function convert any data type into string. Syntax Following is the syntax − ... Read More

2K+ Views
This tutorial will discuss how to write swift program to create a class and object. Swift language is also an object oriented language. So it fully support class and objects. Class A class is a blueprint for the objects. To add the functionality to the class we can define properties and methods. Here, the constants and variables present inside the class are known as the class property whereas a function present inside a class is known as a method. Just like other programming language, Swift classes also support inheritance, type casting, deinitializers, reference, etc. Syntax Following is the syntax to ... Read More

2K+ Views
This tutorial will discuss how to write swift program to convert double type variable to int. Swift support various datatypes and double and integers are one of them. Double is used to represent 64-bit floating point numbers. For example, 34.55656, 9.8283, etc. To create a double type variable we use Double keyword. Whereas Integer represent numeric values like 2, 3, 45, 6, etc. And to create integer type variable we use Int keyword. To convert double type variable into int we uses Int() function. This function convert any data type into integer. Syntax Following is the syntax − Int(variableName) ... Read More

3K+ Views
This tutorial will discuss how to write swift program to convert int type variable to double. Swift support various datatypes and double and integers are one of them. Double is used to represent 64-bit floating point numbers. For example, 34.55656, 9.8283, etc. To create a double type variable we use Double keyword. Whereas Integer represent numeric values like 2, 3, 45, 6, etc. And to create integer type variable we use Int keyword. To convert int type variable into double we uses Double() function. This function convert any data type into double. Syntax Following is the syntax − Double(variableName) ... Read More

4K+ Views
This tutorial will discuss how to write swift program to convert int type variable to string. Swift support various datatypes and string and integers are one of them. String is an ordered collection of characters. For example: “TutorialsPoint”, “Pinky”, etc. To create a string-type variable we use String keyword. Whereas Integers represent numeric values like 2, 3, 45, 6, etc. And to create integer-type variables we use the Int keyword. To convert int type variable into string we uses String() function. This function convert any data type into string. Syntax Following is the syntax − String(variableName) Below is a ... Read More

685 Views
This tutorial will discuss how to write swift program to print hollow right triangle star pattern. Star pattern is a sequence of “*” which is used to develop different patterns or shapes like pyramid, rectangle, cross, etc. These star patterns are generally used to understand or practice the program flow controls, also they are good for logical thinking. To create a hollow right triangle star pattern we can use any of the following methods Using nested for loop Using stride Function Below is a demonstration of the same − Input Suppose our given input is − Num = ... Read More

663 Views
This tutorial will discuss how to write swift program to print X star pattern.Star pattern is a sequence of “*” which is used to develop different patterns or shapes like pyramid, rectangle, cross, etc. These star patterns are generally used to understand or practice the program flow controls, also they are good for logical thinking. To create a X star pattern we can use any of the following methods Using nested for loop Using stride Function Below is a demonstration of the same − Input Suppose our given input is − Num = 5 Output The desired ... Read More

447 Views
In this tutorial, you are going to learn what changes have been released in Swift 4. Every time, Apple releases major versions with lots of improvements and additions to APIs. The new features introduced in Swift 4.0 include improved key paths for key-value coding, encoding and decoding, multi-line string literals, Strings are collections, improved dictionary functionality, one-sided ranges, and many other code enhancements. Encoding & Decoding In Swift 4.0, Apple introduced the Codable protocol to make encoding and decoding easy for developers. You can implement serialization and deserialization in your code using this protocol. You can encode and decode your ... Read More

6K+ Views
Throughout this tutorial, you will learn about the higher-order functions available in Swift. You will find out what they are used for and how to use them. What are they? A higher-order function is a function that takes one or more functions as arguments or returns a function as its result. Below are the higher-order functions provided by the Swift language − forEach() map() compactMap() flatMap() filter() reduce() sort() sorted() All the higher-order functions are based on closure but don't worry you don't need to be a master of closure. They are easy to use and also reduce ... Read More

188 Views
In this tutorial, you will learn how to improve code readability in the Swift language. You can follow a variety of techniques when writing code. By following these methods, you will be able to write more understandable code for yourself and other developers. Use Comments This is the most important thing we should do. When writing code, we often write logic and calculations. When we start, we have everything in our minds, but after a month, it's definitely difficult to remember everything, especially in large applications. The code is usually commented on single lines. As a result, we are better ... Read More