Mohtashim M has Published 35 Articles

How do you create a date object from a date in Swift xcode?

Mohtashim M

Mohtashim M

Updated on 30-Aug-2019 10:36:38

1K+ Views

Coming from Objective C- Background now we don’t need to use NSDate as Swift has defined its own struct type Date. Date bridges to the NSDate class. You can use these interchangeably in code that interacts with Objective-C APIs.To read more about Date you can check official apple docs https://developer.apple.com/documentation/foundation/dateIn ... Read More

Disable Orientation Change in iOS

Mohtashim M

Mohtashim M

Updated on 07-Aug-2019 14:13:36

873 Views

There are numerous application which either runs on Portrait mode or in Landscape mode.Restricting the application in one of the mode is important to achieve this.In this post we will see how to restrict the orientation or disable the orientation to one mode.If you want the application to be running ... Read More

How to get current date and time from internet in iOS?

Mohtashim M

Mohtashim M

Updated on 07-Aug-2019 14:11:06

372 Views

Working with date and time can be tricky, I’ve seen new programmers struggling with date and time. In almost all the application you will be required to get the date and multiple operations are dependent on it.Here we will be seeing how to get the current date and time in ... Read More

How to get the differences between two dates in iOS?

Mohtashim M

Mohtashim M

Updated on 07-Aug-2019 14:09:03

361 Views

Getting difference between two dates is easy. You should know how to play between the dates.We will be using DateFormatter class for formatting the dates.Instances of DateFormatter create string representations of  NSDate objects, and convert textual representations of dates and times into  NSDate objects.You can read more about it here https://developer.apple.com/documentation/foundation/dateformatterWe ... Read More

How to use both front and back cameras simultaneously in iOS?

Mohtashim M

Mohtashim M

Updated on 07-Aug-2019 14:06:56

193 Views

As of now, there’s no way you can access both front and back cameras simultaneously. As both cameras have different session, as soon as one will start other session will die.As per the apple developer forum answered by Apple support team −“Apps cannot capture from the front and back cameras ... Read More

How to check if an iOS program is in foreground or in background?

Mohtashim M

Mohtashim M

Updated on 07-Aug-2019 14:06:28

541 Views

Knowing when the application is in foreground or in background is important as being an iOS developer we need to handle multiple events such as background downloads, events if the app comes to foreground.Here we will see how to check if the application is in background or foreground.We will be ... Read More

How do I create a TableView with rounded corners in iOS?

Mohtashim M

Mohtashim M

Updated on 07-Aug-2019 14:05:02

1K+ Views

Table View is one of the most important and fundamental part of iOS application, Every iOS developer should be familiar with it.Almost every application you see in App store use table view.Table views on iOS display a single column of vertically scrolling content, divided into rows. Each row in the ... Read More

How to detect user pressing HOME key in iOS?

Mohtashim M

Mohtashim M

Updated on 07-Aug-2019 13:59:26

224 Views

It is very important to know when user is pressing home key as it puts the application to background, here we will be seeing how to identify or get a call when user presses home key.In you AppDelegate.swift, there are delegates methods.Open your AppDelegate.swift and in applicationWillResignActive(_ application: UIApplication) and ... Read More

How to control the width and height of the default Alert Dialog in iOS?

Mohtashim M

Mohtashim M

Updated on 07-Aug-2019 13:58:48

1K+ Views

There will be instance where you might get a requirement to control / manipulate width and height the Alert while developing iOS application. If you’re not familiar with the same, it can trouble you.Here we will be seeing how to control the width and height of default alert box, For ... Read More

How to play audio and video file in iOS?

Mohtashim M

Mohtashim M

Updated on 30-Jul-2019 22:30:26

812 Views

Understanding how to play audio and video in iOS is very important, as almost every application has audio and video these days. From your gaming application to social media to your music player and so on.In this post, we will be seeing how to play audio and video file using ... Read More

Advertisements