Hi friends, in this blog we will discuss about how multiple projects are handled in iOS.
Earlier to Xcode 11/iOS 13, when you create a new project, some default files like AppDelegate.swift, ViewController.swift and a Main.storyboard and few other files were created but from Xcode 11 you might have noticed that along with the default files like above, a new file SceneDelegate.swift
is also created.
If you’re still confused about what is app life cycle and AppDelegate. Please read my blog application life cycle in iOS.
I hope by now you’re aware of AppDelegate, how app delegate interact to user event and app life cycle. …
SpringBoard is the standard application that manages the iPhone’s home screen. Other tasks include starting WindowServer, launching and bootstrapping applications and setting some of the device’s settings on startup
It is used to restrict parts of your app’s source code. This essentially helps for prohibiting other modules, frameworks, classes and code from using your code.
Advantages:
open
and public
— anyone can access, within the module, and in code that imports the moduleinternal
— anyone can access, but only within the module (default)fileprivate
— anyone can access, but only within the current Swift fileprivate
— only the enclosing
declaration can access, such as a class or struct.The default access level in…
To make your app beautiful in any screen and orientation is a challenging task. Autolayout make it easy to support different screen sizes in your apps. First will try to understand the autolayout fundamental before learning programatic layouts. Click here to know about autolayout fundamental.
There are two ways you can write autolayout in code.
In this blog, I’l try to cover most of the things about Anchors and how to debug the layout error.
addSubview
so that view is in the hierarchy.translatesAutoresizingMaskIntoConstraints = false
This content guide provides a layout area which can be used to place text and related content. Area width generally be constrained to a size that is easy for the user to read.
Consider an example of label with leading and trailing space of 16points. Top space with 50points. The label has the number of lines set to zero (unlimited) and is using the body dynamic text style. Your label constraint look like this
Every view in view hierarchy need to have size(width and height) and position(x and y).
You have 3 option to set size and position for view in iOS.
Frame of a view is a rectangular with position x-y coordinates and size with width and height. It can be set by CGRect(x: CGFloat, y: CGFloat, width: CGFloat, height: CGFloat)
e.g: view.frame = CGRect(x: 10, y: 10, width: 50, height: 10)
Pros:-
Using Visual Format Language, with a single line of code, you can specify multiple constraints in either the horizontal or vertical direction.
|
superview-
standard spacing (usually 8 points; value can be changed if it is the spacing to the edge of a superview)==
equal widths-10-
non standard spacing (10 points)<=
less than or equal to>=
greater than or equal to@250
priority of the constraint, can have any value between 0 and 1000.You can create custom view using one of the way mentioned in below.
click here, to know detailed explanation with example to create custom views.
what are advantages of Storyboards?
what are disadvantages of Storyboards?
This is a question I have personally asked multiple times during my iOS development career. Today In this blog will go through some detail about frame and bounds
Frame = a view’s location and size using the parent view’s coordinate system. It is represented as (x: CGFloat, y: CGFloat, width: CGFloat, height: CGFloat).
x and y coordinate are represented with respect to parent view.
Bounds = a view’s location and size using it’s own coordinate system. It is represented as (x: CGFloat, y: CGFloat, width: CGFloat, height: CGFloat).
bounds x and y coordinate is always 0
(zero). …
iOS Developer in walmart