Skip to main content

Questions & Answers

1) - Name Of Four Important Data Type

  • NSString - Representing String
  • NSInteger -  Representing Integer
  • CGFloat -   Representing a floating point value
  • BOOL -      Representing Boolean value
2) - What are the UI Elements in ios?

      UI Elements are ios Button, textField, label, image or more
3)  reuseIdentifier in the UITableViewCell ?

     The reuseIdentifier tells UITableView which cells may be reused within the table, effectively        grouping together rows in a UITableView that differ only in content but have similar layouts. This improves scroll performance by alleviating the need to create new views while scrolling. Instead the cell is reused whenever dequeueReusableCellWithIdentifier: is called.

4) Execution States in iOS

      Not Running: The app is completely switched off, no code is being executed.
Inactive: The app is running in the foreground without receiving any events.
Active: The app is running in the foreground and receiving events.
Background: The app is executing code in the background.
Suspended: The app is in the background but is not executing any code

5) Difference between Stored Properties and Computed Properties

Stored Properties:- Stored Properties concept to store the instance of constants and variables. Store property define the "let" Keyword and Stored property of variable "var" Keyword defined

struct Number {
let price = 1000.8
var digits: Int
var n = Number(digits: 12345)
n.digits = 87

print("\(n.price )")
n.price = 8.7 //cannot assign to property: 'price ' is a 'let' constant (error)

Lazy Stored Property:- 

class Bacic{
   lazy var a = number()    // `var` declaration is required.
class number {
   var name = "Swift 4"
var firstsample = Bacic()


Instance Variables - Computed Properties :- Stored properties also have instance variables for back up purposes to store the values declared in stored property.

"Computed Properties provide a getter and an optional setter to retrieve and set other properties and values indirectly."

class sample {
   var x = 0.0, y = 0.0
   var leth = 100.0, brdth = 50.0

   var middle: (Double, Double) {
      get {
         return (leth / 2, brdth / 2)
         x = axis.0 - (leth / 2)
         y = axis.1 - (brdth / 2)

var result = sample()
result.middle = (0.0, 10.0)


6):- What is Difference Between Synchronous and Asynchronous Task ?

 Synchronous:- Wait until the task had completed A Synchronous

Asynchronous:- Complete a task in background and can notify you when completed an Asynchronous

7):- NSArray Object ?
There are three part of NSArray object
  1) A Domain
  2) an error code
  3) user info Directory

The domain is a string that identifies what categories of errors this error is coming from.

8):- What is the Enum
 Enum is a type Basically that contains a group of related values in the same umbrella and enables you to work with those values in a type-safe way within your code.

9):- What is @synthesize in Objective-C ? 

Synthesize generates getter and setter methods for your property or the Variable.

10):- how to use @dynamic in Objective-C ? 

We use dynamic for subclasses of NSManagedObject. @dynamic tells the compiler that getter and setters are implemented somewhere else.

11):- What is the difference strong, weaks, read only and copy ? 

Strong, weak, assign property attributes define how memory for that property will be managed.

Strong means that the reference count will be increased and the reference to it will be maintained through the life of the object

Weak, means that we are pointing to an object but not increasing its reference count.
It’s often used when creating a parent child relationship. The parent has a strong reference to the child but the child only has a weak reference to the parent.

Read only, we can set the property initially but then it can’t be changed.

Copy, means that we’re copying the value of the object when it’s created. Also prevents its value from changing.

11):- Difference Between Concurrency, Operation Queue, Grand Central Dispatch

Concurrency:- Doing multiple things at the same time, Running multiple program in parallel or Talking advantage of number of cores available multicore CPUs  Concurrency is dividing up the execution paths of your program so that they are possibly running at the same time. The common terminology: process, thread, multithreading, and others. Terminology.

Process:- An instance of an executing app
Thread:- Path of execution for code
Multithreading:- Multiple threads or multiple paths of execution running at the same time.
Concurrency:- Execute multiple tasks at the same time in a scalable manner.
Queues;- Queues are lightweight data structures that manage objects in the order of First-in, First-out (FIFO).
Synchronous vs Asynchronous tasks

Grand Central Dispatch (GCD) - GCD is a library that provides a low-level and object-based API to run tasks concurrently while managing threads behind the scenes. Terminology.

Dispatch Queues:- A dispatch queue is responsible for executing a task in the first-in, first-out order.
Serial Dispatch Queue :- A serial dispatch queue runs tasks one at a time.
Concurrent Dispatch Queue:- A concurrent dispatch queue runs as many tasks as it can without waiting for the started tasks to finish.
Main Dispatch Queue:- A globally available serial queue that executes tasks on the application’s main thread.

12):- NSOperation  Vs NSOperationQueue Vs NSBlockOperation

NSOperation :- NSOperation adds a little extra overhead compared to GCD, but we can add dependency among various operations and re-use, cancel or suspend them.

NSOperationQueue:- It allows a pool of threads to be created and used to execute NSOperations in parallel. Operation queues aren’t part of GCD.

NSBlockOperation :- NSBlockOperation allows you to create an NSOperation from one or more closures. NSBlockOperations can have multiple blocks, that run concurrently.

Part 2 - Top 50 iOS Interview Questions and Answers Swift and Objective C

Top 50 Mostly Put Up  iOS Interview Questions and Answers

1 - introduction your self, Name, Qualifications what,done, where, experience strong week, family like etc.
2 - Basic Knowlage basic knowledge OOPS C, java, Databade

   Overriding versus Overloading
   Types versus Instances
   Access Control

3. How to call the function in objective c
    ans - [className methodName]
     if a same class then [self methods]

4. Explain dot(.) notation
    ans - dot(.) notation shortcut for calling getters and setters properties

5.  Difference between the atomic and Nonatomic 

   Atomic is the default behavior will ensure the present process is completed by the CPU, before           another process accesses the variable is not fast, as it ensures the process is completed entirely
   Non-Atomic is NOT the default behavior faster (for synthesized code, that is, for variables                   created  using @property and @synthesize) not thread-safe may result in unexpected behavior,           when two different process access the same variable at the same time.

6. What is the KVC and KVO.
     KVC (Key Value Coding ) means accessing a property or value using a string.
     id someValue  = [myObject valueForKeyPath: @"nnnn"];
    KVO (Key Value Observer ) allows you to observe change to a property or value.




Popular posts from this blog

How Create Animated Circle Progress Bar iOS 11 Swift 4

Animated Circle Progress Bar iOS 11 Swift 4

With MBCircularProgressBar -

A circular, animatable & highly customizable progress bar from the Interface Builder Swift, Using pod fite MBCircularProgressBar Installation Cocoapods terminal.

pod "MBCircularProgressBar"

That - A Simple Steps to installed pod file -        Open terminal       Command on terminal go to project folder Cd path       set your project path on terminal.       command : pod init       open pod file - open -e podfile       added in pod file with in : pod "MBCircularProgressBar"       Command : Pod install       Close project of Xcode       open your Project from terminals       Command : open PodDemos.xcworkspace After opern StoryBoard and Now drag a UIView over the viewController in storyboard

Or set UIView Constraint width, height or verticle or horzentail space and set a class MBCircularProgressBarView in StoryBoard. Open Atribute inspector and cu…

Facebook Login - Facebook Authentication and Cocoapods

Create a new application facebook login and authentication a facebook user using their iOS SDK with Cocoapods. Below are the steps in which we'll be following: First Getting Started guide from Facebook's iOS SDK Documentation Create a new iOS project Swift

Open facebook Developer Account and create new App after go to setting and click basic -> add platform ios Then add Bundle id your ios project like com.xxxx, Configuring Facebook with Bundle ID Then go ahead Download facebook sdk for ios other wise install pod file your project.
Go ahead to open terminal and go ahead your project folder.

Got create podfile -> pod init
Open podfile -> open podfile Paste ->  pod 'FBSDKCoreKit' 
               pod 'FBSDKShareKit' 
               pod 'FBSDKLoginKit' podfile and save

Then go to terminal or install podfiles -> pod Install

Enabling Facebook's Authentication Mech…

Core Data With Swift 4.0 Tutorial

Core Data - Core Data is a framework that you use to manage the data model layer objects or instance Context in your application. It provides generalized and automated data stores solutions to common tasks associated with object life cycle and object graph management, including persistence.
Completely Tutorial for Swift 4 and iOS 11. Gating Start Goto Xcode and create New iOS Project on single view. Project Name CoreDataSwift or Checked Use Core Data

On click Main.Storyboard in Interface builder click on project navigation Editor - Embed In - Navigation controller.

Then After click on Navigation ViewController and next Drag TableView in to ViewController.

Make TableView viewcontroller Outlet Delegate, DataSource and import CoreData

import UIKit import CoreData
class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate { overridefunc viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } overridefunc didReceiveMem…