37-Consider the following code:

var array1 = [1, 2, 3, 4, 5]

var array2 = array1

array2.append(6)

var len = array1.count

What’s the value of the len variable, and why?

Answer:The len variable is equal to 5, meaning that array1 has 5 elements, whereas array2 has 6 elements:

array1 = [1, 2, 3, 4, 5]

array2 = [1, 2, 3, 4, 5, 6]

When array1 is assigned to array2, a copy of array1 is actually created and assigned.

The reason is that swift arrays are value types (implemented as structs) and not reference types (i.e. classes). When a value type is assigned to a variable, passed as argument to a function or method, or otherwise moved around, a copy of it is actually created and assigned or passed. Note that swift dictionaries are also value types, implemented as structs.

Value types in swift are:

• structs (incl. arrays and dictionaries)

• enumerations

• basic data types (boolean, integer, float, etc.)

38- What is the difference between Continuous Integration, Continuous Delivery, and Continuous Deployment?

Continuous integration is the process of continuously checking-in the developer’s code into a version control system and triggering the build to check and identify bugs in the written code.

This is a very quick process and also gives them a chance to fix the bugs. Jenkins is one such continuous integration tool.

In software development, multiple developers work on different software modules. While performing integration testing all the modules are being integrated together. It is considered as the development practice to integrate the code into the source repository

Whenever the programmer/developer makes any change to the current code, then it automatically

gets integrated with the system running on the tester’s machine and makes the testing task easy and speedy for the system testers.

Continuous Integration comprises of:

  • Development and Compilation
  • Database Integration
  • Unit Testing
  • Production Deployment
  • Code Labeling
  • Functional Testing
  • Generating and Analysing Reports

The diagrammatic representation given below can elaborate on the differences between Continuous Integration, Continuous Delivery, and Continuous Deployment more precisely.

Continuous Integration:

(It involves keeping the latest copy of the source code at a commonly shared hub where all the developers can check to fetch out the latest change in order to avoid conflict.)

Continuous Delivery:

Why Jenkins is being called as a Continuous Delivery Tool:

  1. Developers work on their local environment for making changes in the source code and push it into the code repository.
  2. When a change is detected, Jenkins performs several tests and code standards to check whether the changes are good to deploy or not.
  3. Upon a successful build, it is being viewed by the developers.
  4. Then the change is deployed manually on a staging environment where the client can have a look at it.
  5. When all the changes get approved by the developers, testers, and clients, the final outcome is saved manually on the production server to be used by the end-users of the product.

In this way, Jenkins follows a Continuous Delivery approach and is called the Continuous Delivery Tool.

(Manual Deployment to Production. It does not involve every change to be deployed.)

Continuous Deployment:

(Automated Deployment to Production. Involves every change to be deployed automatically.)

39-iOS 15 All the new features

Apple in June 2021 introduced the latest version of its iOS operating system, iOS 15, which is set to be released in the fall. iOS 15 introduces new features for FaceTime calls, tools to reduce distractions, a new notifications experience, added privacy features, complete redesigns for Safari, Weather, and Maps, and more.

Notifications have been redesigned in iOS 15, adding contact photos for people and larger icons for apps. To reduce distraction, a notification summary collects notifications together for delivery at an appropriate time and arranges notifications by priority.

Focus is a new feature that can filter notifications and apps based on what a user wishes to focus on at a certain time. When a user’s Focus is blocking incoming notifications, their status will be displayed to others in Messages. iOS will suggest a Focus for different occasions, such as work hours or winding down for bed, using on-device intelligence, but users can also create a custom Focus. When a Focus is set on one Apple device, it automatically applies to other Apple devices.

Safari features a completely new design. Controls are now easier to reach with one hand and give more focus to a webpage’s content. There is a new, compact tab bar that floats at the bottom of the screen so users can easily swipe between tabs. Tab Groups allow users to save tabs and easily access them at any time across devices. There is also a customizable start page and web extensions for the first time.

The Maps app now offers a new 3D view in cities with significantly enhanced details, showing buildings, pedestrian crosswalks, bike lanes, and more. There is a new city-driving experience with added road details and improved Transit features, such as pinned favorite lines, notifications to disembark, and AR walking directions.

iOS 15 brings voice isolation and Spatial Audio to FaceTime calls so that voices sound as if they are coming from where the person is located on the screen. FaceTime also supports Portrait mode and offers a new grid view to see more faces at the same time. SharePlay is a new feature that allows users to share media together in sync during a FaceTime call. Users can also generate shareable links to a scheduled FaceTime call, which can also be opened on Android and Windows devices.

The Weather app has been redesigned in iOS 15, showing more graphical displays of weather data, full-screen maps, and dynamic layouts that change based on weather conditions. Totally new animated backgrounds can now more accurately reflect the sun’s position and current precipitation, and there are notifications to highlight when rain or snow starts and stops.

The Wallet app adds support for new key types in iOS 15, such as homes, offices, or hotel rooms. Later this year, customers in participating U.S. states will be able to add a driver’s license or state ID to the Wallet app.

The Photos app features a major update to Memories with a new design and an interactive interface. Memories now supports integration with Apple Music, using on-device intelligence to offer song suggestions for personalized Memories.

Live Text is a new feature that uses on-device intelligence to recognize text in a photo that users can search for, highlight, and copy. Spotlight can now search for photos by location, people, scenes, objects, and text. Spotlight also offers web image search and richer results for actors, musicians, TV shows, and movies. Enhanced results for contacts show recent conversations, shared photos, and location if it is shared through Find My.

iOS 15 also introduces new privacy measures, such as processing Siri requests directly on the iPhone, which has the added benefit of better responsiveness, Mail Privacy Protection to stop senders knowing if an email has been opened and detecting a recipient’s IP address, and an App Privacy Report view to show how often apps use the permissions they have been granted.

There are dozens of tweaks and changes for other apps, such as user-created tags, mentions, and an Activity view in the Notes app, Trends, Walking Steadiness, and a new sharing tab in the Health app, a systemwide Shared with You feature for highlighting content that has been shared in Messages conversations, and a new For All of You row in the TV app to recommend entertainment for the whole household.

iOS 15 is compatible with the iPhone 6s and later, which means it runs on all devices that are able to run iOS 14, and will be released this fall.

40-Traits and Size Classes in iOS?

Traits define the features of the environment an app is likely to encounter when running on an iOS device. Traits can be defined both by the hardware of the device and the way in which the iOS environment has been configured by the user. Examples of hardware based

traits include hardware features such as the range of colours supported by the device display (also referred to as the display gamut) and whether or not the device supports features such as 3D Touch. The traits of a device that are dictated by user configuration include the dynamic type size setting and whether the device is configured for left to right or right to left text direction.

Arguably the most powerful trait category, however, relates specifically to the size and orientation of the device screen. These trait values are referred to as size classes. Size classes categorise the various screen areas that an application user interface is likely to encounter during execution. Rather than represent specific screen dimensions and orientations, size classes represent width (w) and height (h) in terms of being compact © or regular (R).

Both the iPhone 7 and iPhone 7 Plus devices in portrait orientation, for example, are represented by the compact width and regular height size class (wC hR). When the iPhone 7 is rotated to landscape orientation the device is considered to be of compact height and compact width (wC hC). An iPhone 7 Plus in landscape orientation, on the other hand, is categorised as being of compact height and regular width (wR hC).

In terms of size class categorisation, the iPad family of devices (including the iPad Pro) is considered to be of regular height and regular width (wR hR) in both portrait and landscape orientation. A range of different size class settings are used when apps are displayed on the iPad.

Interface Builder in Xcode 8 allows different Auto Layout constraints to be configured for different size class settings within a single storyboard file. In other words, size classes allow a single user interface file to store multiple sets of layout data, with each data set targeting a particular size class. At runtime, the application will use the layout data set for the size class that matches the device and prevailing orientation on which it is executing, ensuring that the user interface appears correctly.

By default, any layout settings configured within the Interface Builder environment will apply to all size classes. Only when trait variations are specifically specified will the layout configuration settings differ between size classes.

Customising a user interface for different size classes goes beyond the ability to configure different Auto Layout constraints for different size classes. Size classes may also be used to designate which views in a layout are visible within each class, and also which version of a particular image is displayed to the user. A smaller image may be used when an app is running on an iPhone SE, for example, or extra buttons might be made to appear to take advantage of the larger iPad screen.

41-Who calls the main function of you app during the app launch cycle?

During app launching, the system creates a main thread for the app and calls the app’s main function on that main thread. The Xcode project’s default main function hands over control to the UIKit framework, which takes care of initialising the app before it is run.

iPhone applications by default have 3 things
1.main: entry point of application.

2.Appdelegate: perform basic application and functionality.

3.Window: provide uiinterface.

42-What is the use of controller object UIApplication?

Controller object UIApplication is used without subclassing to manage the application event loop.

It coordinates other high-level app behaviours.

It works along with the app delegate object which contains app-level logic.

The app delegate object is created by UIApplicationMain function at app launch time. The app delegate object’s main job is to handle state transitions within the app.

App delegate is declared as a subclass of UIResponder by Xcode project templates.

43-What is the difference between rebase and merge in Git?

In terms of the end result (which is what matters, usually), after merging the end result will look like the commits on both branches were made chronologically “together”, altering between the branches. After rebasing, the end result will look like the branches were ‘applied’ separately, first one entire branch and then the other.

The most important takeaway is that if branch (a) has a list of commits:

{a1, a2, a3, a4, a5} and branch (b) has a list of commits {b1, b2, b3, b4, b5}, then after merging them the result might be something like:

> a1, b1, a2, a3, b3, b4, b5, a5 (mixed together),

while after rebasing (b) over (a) the list will necessarily look like:

> a1, a2, a3, a4, a5, b1, b2, b3, b4, b5. (one branch after the other)

If (b) is your feature branch and (a) is your stable master, this is much preferable because logically you want all of (b)’s commits after (or in git-speak, ‘rebased on’) the commit’s on (a)’s.

Both Git merge and Git rebase are used to combine the work of two branches together. Only the techniques of combining is different.

Consider an example to understand the difference between these two techniques:

Let’s say that you have two branches in your Git repo viz. master and feature, where the feature branch is being used to develop something additional & master branch is your production quality code branch or main branch.

After you are done developing the feature branch, you want to combine it with the master branch.

If you Git merge it into master, it will combine the tasks of feature into master by creating a single new commit at the tip of master.

On the other hand, if you Git rebase it, it will place the entire commit history of the feature branch on the tip of master. It means that your entire feature branch will be reattached to the tip of master and it will look like a linear sequence of commits.

However, there is a little rule to remember:

Combining tasks from public branch into local branch — use git rebase

Combining tasks from local branch to public branch — use git merge

Both Merge and Rebase have their pros and cons. Merge keeps the history of the repository but can make it hard for someone to understand and follow what’s going on at a particular stage when there are multiple merges. Rebase on the other hand ‘rewrites’ history (read — creates new history) but makes the repo look cleaner and is much easier to look at.

What you want to use depends on your need. A lot of companies make merges mandatory when adding stuff to master branch because they want to see the history of all changes. And a few companies/Open source projects mandate rebasing as it keeps the flow simple and easy to follow. Use the one that suits your workflow.

44- Which app specific objects store the app’s content?

Data model objects are app specific objects and store app’s content. Apps can also use document objects to manage some or all of their data model objects.

Document objects are not required but are very useful in grouping data that belongs in a single file or file package.

45-Explain static and dynamic library/framework in iOS?

First, some general definitions (specific to iOS):

Static library — a unit of code linked at compile time, which does not change.

However, iOS static libraries are not allowed to contain images/assets (only code). You can get around this challenge by using a media bundle though.

Dynamic library — a unit of code and/or assets linked at runtime that may change.

However, only Apple is allowed to create dynamic libraries for iOS . You’re not allowed to create these, as this will get your app rejected.

Software Framework — a compiled set of code that accomplishes a task… hence, you can actually have a static framework or a dynamic framework, which are typically just the compiled versions of the above.

Hence on iOS, your only option is basically to use a static library or static framework (the main difference being that a static framework is distributed as a compiled .a file most often, whereas a static library may simply be included as a subproject — you can see all of the code — which is compiled first and its resulting .a file used as a dependency by the project).

Now that we’re clear(er) on these terms, setting up a static library and supporting media bundle for iOS isn’t too difficult, and there are many tutorials on how to do such. I personally would recommend this one:

https://github.com/jverkoey/iOS-Framework

This is a pretty straight-forward guide and doesn’t have the disadvantage of dealing with “fake static libraries”… check it out for more info…

Once you’ve created your static library, it’s as easy as including it as a submodule within Git for use across different projects.

As of iOS 8, Apple now permits developers to create dynamic frameworks! (Note: your app must have a minimum target of iOS 8 to include a dynamic framework… back porting isn’t allowed.)

This has been added as a new project template. In Xcode 6.1, this can be found at:

New Project -> iOS -> Framework & Library -> Cocoa Touch Framework

46- Common reasons for app rejection from App store review process?

  • Broken Links:

There are a couple of needed links as a part of the App Store application method. For example, your app must have a link to your privacy policy. You’ve additionally ought to have a link to app support in order that users will contact you. If these links don’t go anyplace, your app is rejected. Make sure these pages square measure in operating order before submission.

  • Bugs throughout the review method

Obviously, you wouldn’t need an automobile you were pondering shopping for to interrupt down on the check drive. That’s an excellent thanks to making sure that the automobile isn’t going get oversubscribed. By that very same token, a bug that rears its ugly head throughout the review method can place your app on the main road to rejection. Each app goes to possess some problems once it’s initial free, however, try and catch as several as available throughput testing to avoid rejections and delays.

  • Crashes throughout the review method

Moment dismissal anticipates your application on the off chance that it crashes all through the review technique. Obviously, the App Store is trying to find apps that truly work. If they don’t, they’re obtaining thrown the “no” pile.

  • Long loading times

Your app has precisely fifteen seconds to load, or Apple goes to reject it. you’ll reduce your app load time by ensuring any pictures used square measure the adequate measure and prioritising any bugs that reason the application to crash after loading. For a lot of insight in decreasing load times, examine this text on important. measure and prioritising any bugs that reason the application to crash after loading.

  • Poor interface

Apps on the app store should supply worth and value to finish users. Apple is explicit regarding the top quality of its applications. Look to satisfy the high-level style demand of Apple, just as content size, content configuration, differentiate, arrangement, goals, mutilation, hit controls, association, and so forth. Cohesive user expertise is essential to obtain through the App Store.

  • Apps that square measure demos or in beta

Demos aren’t happy with the Apple App Store. Words like “demo,” “test” and “beta” square measure reaching to get flagged for rejection as a result of the App Store needs final versions of apps. This is often simply inevitable and best observe anyway. You don’t wish users are downloading associate imperfect version of your app.

  • Mistreatment non-public API

Apple is that the sole guy on the block which will use a private API. ALL Apple apps have to be compelled to use a public API so as to create it through the approval method. The rationale is that Apple needs to make sure that public arthropod genus square measure in use is to shield user knowledge from being abused.

  • Inappropriate ad identifiers

Ads square measure a part of the method of building a lot of apps, however, if you utilise IDFA (the iOS advertising identifier) on something that isn’t an advertisement, then you’re reaching to get rejected right away.

  • Unrelated keywords

Keywords square measure; however, users notice your app. However, mistreatment keywords that square measure incorrect or square measure unrelated to the particular mobile application square measure cause for fast rejection from Apple. It’s not legal to use proprietary words, or titles that square measure deceptive. Apps got to gift themselves honestly so as to create it through the app store approval method.

  • Inappropriate content

Gambling and creative activity don’t seem to be allowed within the App Store.

  • Combination content

Content in mobile apps is supposed to be distinctive. Apps that square measure merely aggregates of content which will be found elsewhere square measure the net goes to induce kicked out by Apple. What goes informed any Apple application should be content that’s usable and original for finish users. Plagiarism and aggregation can get your app showed within the blink of a watch.

  • Offensive language

Apple is supposed to be a secure area for folks of all non-secular faiths, ages, orientations, etc. It’s ought to all be clean and on top of the board. Something that’s meant to arouse anger or to elicit a violent reaction can get thrown out right away.

  • No privacy policy

It’s a tough and quick demand that each Apple app has a privacy policy in situ so as to induce approval.

  • Sharing personal user knowledge

Any app that shares personal user knowledge, from names to photos to contact info, are rejected. Privacy could be a massive deal to Apple, and they’ve created a large quantity of trust with users so as to spice up their whole and create the foremost out of their client loyalty. Incursive privacy is simply not allowed.

  • mistreatment Apple Pay while not the privacy policy

Another privacy policy issue is mistreatment Apple Pay while not the privacy policy for it. That features any of the weather of stigmatisation or the interface generally.

  • Missing information

A major demand for apps within the Apple Store is that they need information. Meaning as well as screenshots, descriptions, etc. If the information isn’t there, then the app goes to induce rejected.

47- Which is the super class of all view controller objects?

UIViewController class. The functionality for loading views, presenting them, rotating them in response to device rotations, and several other standard system behaviours are provided by UIViewController class. NSobject is the base class for all the classes and default constructor syntax is — (id) init.

View controller objects takes care of the presentation of app’s content on the screen. A view controller is used to manage a single view along with the collection of subviews. It makes its views visible by installing them in the app’s window.

We use the super keyword to call the parent class initialiser after setting the child class stored property.

48-What is the purpose of UIWindow and View object?

The presentation of one or more views on a screen is coordinated by UIWindow object.

To change the content of your app, you use a view controller to change the views displayed in the corresponding window. Remember, window itself is never replaced.

The presentation of one or more views on a screen is coordinated by UIWindow object.

To change the content of your app, you use a view controller to change the views displayed in the corresponding window. Remember, window itself is never replaced.

Views along with controls are used to provide visual representation of the app content. View is an object that draws content in a designated rectangular area and it responds to events within that area.

49-How to call Objective-C code from Swift.

Follow the following steps:

Step 1: Add Objective-C Implementation — .m: First of all, add a .m file to the class and then name it CustomObject.m.

Step 2: Add Bridging Header: At the time of adding your .m file, you receive a prompt with three options of YES, NO and cancel. You need to select YES

Step 3: Add Objective-C Header — .h: After that Add one more .h file and name it CustomObject.h.

Step 4: Build your Objective-C Class

In CustomObject.h

#import <Foundation/Foundation.h>

@interface CustomObject : NSObject

@property (strong, nonatomic) id someProperty;

- (void) someMethod;

@end

In CustomObject.m

#import “CustomObject.h”

@implementation CustomObject

- (void) someMethod {

NSLog(@”SomeMethod Ran”);

}

@end

Step 5: The next step is to add Class to Bridging-Header

In YourProject-Bridging-Header.h

#import “CustomObject.h”

Step 6: At last, use your Object

In SomeSwiftFile.swift:

var instanceOfCustomObject: CustomObject = CustomObject()

instanceOfCustomObject.someProperty = “Hello World”

println(instanceOfCustomObject.someProperty)

instanceOfCustomObject.someMethod()

In the bridging header, there is no need to import explicitly.

50-Apart from incorporating views and controls, what else an app can incorporate?

Apart from incorporating views and controls, an app can also incorporate Core Animation layers into its view and control hierarchies.Layer objects are data objects which represent visual content. Layer objects are used by views to render their content. Custom layer objects can also be added to the interface to implement complex animations and other types of sophisticated visual effects.

51-Difference between Unlocking and jailbroking in iPhone Explain its?

It lets you do everything from customising the look of your iPhone to installing third-party applications(such as titles that are not authorised and available in the App Store) and customised ringtones on it. Depending on how far you’re willing to go, you can do even more than that: Jailbreaking even lets you to unlock your phone so you can use it with a carrier other than the one from which you purchased it.Once you do it, you’re on your own. You may have voided your warranty, so you can’t rely on AT&T, Verizon, or Apple to fix any problems you encounter. All of the applications that jailbreak your phone are unauthorised and could damage or completely disable your iPhone. Your slick smartphone could end up as nothing more than a very expensive paperweight.

--

--

Sandeep Reddy Challa

I have around 14 years of experience in iOS development and lead/senior developer