Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
iOS Articles
Page 5 of 19
How to add line break for UILabel in iOS/iPhone?
Line break in a UILabel is used to change how the text appears on a label. Suppose a label has text more than two lines but by default the Line break in a UILabel is used to change how the text appears on a label. Suppose a label has text more than two lines but by default the label shows 1 line and wraps/ trims the text that’s more than the label size.This can be done in multiple ways. Three of them are mentioned below.On the storyboard add a label.Give top constraint, trailing and leading constraint.Method One − Editing with ...
Read MoreHow to determine device type (iPhone, iPod Touch) with Swift?
When working on iOS applications, we sometimes need to know the device on which application is installed, and provide custom features depending on the device in use. For example, we want to provide some features on iPhone X but not on iPhone 7. In this article we’ll learn how to find the iOS device being used, using an iOS Application.Let’s go through some terms that will be required for achieving the desired results, utsname − this is a structure located in Darwin module of iOSuname − uname is a function that takes utsname as an input and returns Int32 as ...
Read MoreHow to add Exception Breakpoint in Xcode?
Sometimes while writing an iOS application or any other application we need to test multiple cases and debug the application of any known and unknown bugs. There are certain places in the code where we want our app to stop so that we can know the values of certain variables at the point and fix that bug. Before we learn how to add a break point, first let’s seeWhat’s a break point?A break point is a place in our code where the app pauses on a certain event. A break point may be added manually in xcode or may be ...
Read MoreHow to store custom objects in NSUserDefaults?
In this article we’ll learn how to store custom objects in our application, but before you learn how to store custom object let’s see what are custom object?A custom object is any class or structure or any other data that is not a native data type like Int, Double, String etc. Storing data in NSUserDefaults is a three step process.Creating the custom ObjectWe’ll create a custom class Person that will have an age variable, and name variable.class Person: NSObject, NSCoding { var name: String var age: Int init(name: String, age: Int) { self.name = ...
Read MoreHow can I develop for iPhone using a Windows development machine?
Generally iOS applications can be developed on mac operating systems only, but recently with system development now applications for iOS can partially be developed on windows system too.To develop iOS or any other apps for apple platform, we need Xcode which is a native Apple software and can be installed on mac operating systems only. Also, a mac operating system is generally installed and supported on an Apple device.There are multiple work around for this like buying a normal laptop installing third party software to run mac OS on them and later installing Xcode, or buying/renting a cloud Mac. In ...
Read MoreHow to determine the current iPhone model information?
iOS Provides a UIDevice class which has all the information about your iPhone that does not violate any privacy laws Apple has.Using the UIDevice we can access information like −UIDevice.current.localizedModel − this returns the localized version of modelUIDevice.current.model − this returns model of current device, e.g. @"iPhone", @"iPod touch"UIDevice.current.name − this returns the current name of the device in use, e.g. "My iPhone"UIDevice.current.systemName − this returns the system name e.g. @"iOS"UIDevice.current.systemVersion − this returns the system version e.g. @"4.0"UIDevice.current.batteryLevel − this returns the battery level, if it is between 0 to 1, it will return the value otherwise if the ...
Read MoreHow to detect the screen size of iPhone 5?
Detecting screen size of an apple device is an easy and simple task. The UIKIT module of iOS SDK provides many functions and classes that deal with user interface, screen sizes and many other UI elements.One of them is UIScreen which deals with the device screen.UIScreen.main provides the current main screen of the device in use, which further has methods that return other features and properties of the current screen.To find if the current screen is an iPhone 5 or not, we’ll first have to find the current size of the screen and compare with a value. The height of ...
Read MoreSet up a simple delegate to communicate between two view controllers in iPhone
In this article, you learn about delegates and creating delegates. First of all, What’s a delegate?Delegate is a simple term that refers to communication between objects. It is a simple way of connecting objects and communication between them.How does delegate work?A delegate is created with help of protocol. A protocol is declared in class, inside which some event will happen, that should notify other classes. In protocol we write the declaration of function and it is defined inside the calling class.How to create a delegate?We’ll do this with help of an example project.Steps to perform −Create a class, name it ...
Read MoreHow to launch any arbitrary iPhone application from within another app?
iOS Allows us to open some applications with some links or other ways from our app, like dialing a number when clicked on it, or writing a mail with some static body or writing a SMS. But this is limited to some applications, not every app can be opened from within an application.Specifically it is limited to apps that have a registered URL Scheme. For example if you want to open a SMS from your app, it is possible using the registered URL Scheme.Some of the applications that can be opened with URL schemes and how to open them are ...
Read MoreWhat are all the custom URL schemes supported by the Facebook iPhone app?
A url Scheme is a way of iOS to open some third party applications from within a app. Some of the URL schemes that are supported by facebook to open different modules of facebook app from within some other app are mentioned below.1. To open facebook profile: fb://profile 2. To open request list: fb://requests 3. To open friends list : fb://friends 4. To open notes: fb://notes 5. To open the list of notifications : fb://notifications 6. To open albums: fb://albums 7. To open feeds/ home : fb://feed 8. To open events : fb://events 9. To open a page with id: ...
Read More