Posts

Image
Armstrong Number in Swift Programming Language Example to check whether an integer (entered by the user) is an Armstrong number or not using while loop and if…else statement. A positive integer is called an Armstrong number of order n if abcd = a pow n + b pow n + c pow n .....so on to n pow n In case of an Armstrong number of 3 digits, the sum of cubes of each digits is equal to the number itself. For example: 153 = 1 * 1 * 1 + 5 * 5 * 5 + 3 * 3 * 3 ../// 153 is Armstrong number Example #1: Check Armstrong Number of three digits func checkAmstrongNumber(num: Int ) -> String {     var sum = 0     var tempNum = num     var reminder = 0     while tempNum != 0   {         reminder = tempNum % 10         sum = sum + reminder * reminder * reminder         tempNum /= 10         if sum > num { break } ...
Image
Swift in iOS:  Data Types In any programming language we use  data types  to store and manipulate the data in  variables  based on the type of data like integers, strings, characters, bool, etc. Whenever we create a variable in Swift programming language, automatically the required space is reserved in memory for that variable and the space allocation in memory is varied based on the type of variable like integer or float or double, etc. Data Type       Description e.g Int Int  or  UInt  stand for Integer and used for numbers like 1, 2, 3, 4, 5. We can use Int32, Int64 to define 32 or 64-bit signed integer, whereas UInt32 or UInt64 to define 32 or 64-bit unsigned integer variables.  10 Float Float  stand for floating value and it is used to represent numbers with fraction value like 245.344 and etc. It is used to hold the numbers with larger or smaller decimal points like 3.14, and -455.3344. 3.1...
Image
Swift in iOS: Getting Started The Basics  :  Swift is programming language for iOS, macOS, watchOS, and tvOS app development and many parts of its,  familiar from  developing in C and Objective-C. Get the Tools To develop iOS apps using the latest technologies described in these lessons, you need a Mac computer running the latest version of Xcode. Xcode includes all the features you need to design, develop, and debug an app. To download the latest version of Xcode 1. Open the App Store app on your Mac (by default it’s in the Dock). 2. In the search field in the top-right corner, type  Xcode  and press the Return key. 3. The Xcode app shows up as the first search result. 4. Click Get and then click Install App. 5. Enter your Apple ID and password when prompted. 6. Xcode is downloaded into your  /Applications  directory. NOTE:  Swift code can run in  a playground. There you can learn Swift Programming...
Image
Using Xcode Configuration (.xcconfig) to Manage Different Build Settings Complete Tutorial To Organise iOS Xcode Project Staging, Development, and Release States With .xcconfig Files Or Automatic Building without API Urls Changes. App Constant for Api Key with Automatic Build Once app development started , always have two or three development mode like(Development, Staging and Release). In Development Mode  :- if App has backend server , app server has definitely development api mode in which we develop app features , more reliable and bug free app or remove all crashes from app code. Here we can test app many times to improve app overall performance. In Staging Mode  :- After Development mode , we again re-test for confirmation or need to change few things that not available on development mode like real time testing etc. In  Release Mode  :- app is on App Store and app has release api mode. All your api  URLs...
Image
Downloading files in background with URLSessionDownloadTask #Swift #Xcode #Download Progress ## iOS ## This snippet demonstrates how to use URLSessionDownloadTask to download files in background so that they can completed even if the app is terminated. It also shows how to implement progress monitoring for multiple tasks running in parallel Starting downloads To start a download that can be completed in background, even if the app is terminated, create a  URLSessionConfiguration  for background processing. The  identifier  will identify the URLSession: if the process is terminated and later restarted, you can get the “same” URLSession f.e. to ask about the progress of downloads in progress: // Create downloadsSession here, to set self as delegate lazy var downloadsSession: URLSession = { // let configuration = URLSessionConfiguration.default let configuration = URLSessionConfiguration.background(withIdentifier: “bgSessionConfigu...