Uploaded by gabi gabi

IOS

advertisement
I. Swift.
A. Types.
- Casting (upcasting and downcasting)
B. Reference types.
- ARC (memory management is done by ARC)
C. Class
- Operator overlaoding
- Constructors
D. Protocols.
E. Struct
- Inout.
II. Networking.
A. JSON
- Json format.
- Json decoding and encoding.
B. Http request. Architecture.
- Api router
C. Async await.
- Parallel async executions. Async let
III. Other
- self vs Self
IV. Delegates. Delegate, in ios Swift, is a design pattern that allows data or communication to be passed
across structs or classes. Delegate allows one object to deliver a message to another when a certain
event occurs, and it is used to handle table and collection view events. Delegates have a one on one
interaction and communicate with one another.
// Defining a custom delegate known as SeeActionDelegate
protocol SeeActionDelegate {
// Defining the required delegate variables
var state: GetState { get }
var userIdentity: String? { get set }
// Defining the required delegate blocks
var errorHandler: ((Error) -> Void)? { get set }
// Defining the required delegate functions
func handle(action: GetAction)
}
The enums used in the above delegate are:
enum GetState {
case `default`
case loading
}
enum GetAction {
case saved
case canceled
}
V. Generics
VI. What are good practices regarding nil values.
VII. Reference cycles (can lead to deadlock?)
VIII. Grand central dispatch.
IX. Let vs var. Notice in the following example that we can change the properties of a class declared with
let because is a reference type and what we cannot modify is the memory address. However, in the case
of the struct declared with let, we cannot modify neither the entire struct nor the properties of the
struct.
public class TemperatureClass {
private(set) var temp: Double = 50.0
public func changeTemperature(_ temp: Double) {
self.temp = temp
}
}
let temperatureClass = TemperatureClass()
temperatureClass.changeTemperature(72.3)
public struct TemperatureStruct {
private(set) var temp: Double = 50.0
public mutating func changeTemperature(_ temp: Double) {
self.temp = temp
}
}
let temperatureStruct = TemperatureStruct ()
temperatureStruct.changeTemperature(72.3)
X. Closures. Notice that in the below example, the output will be "He wanted to eat apples" because
when we define a closure the capture list generates a duplicate of the item. This means that even if you
modify the value of an object, the captured value remains the same.
var item = "apples"
let closure = { [item] in
print("He wanted to eat \(item)")
}
item = "oranges"
closure()
ON THE OTHER HAND, the following code prints "He wanted to eat oranges". If you do not include a
capture list in the closure, the compiler will use a reference rather than a copy. As a result, any change
to the variable is reflected when the closure is invoked.
var item = "apples"
let closure = {
print("He wanted to eat \(item)")
}
item = "oranges"
closure()
XI.
Codewithchris for concurrency and mapkit:
https://learn.codewithchris.com/courses/swiftconcurrency?_ga=2.206669587.1445958766.169487487764251561.1694874877&_gl=1*1sba49o*_ga*NjQyNTE1NjEuMTY5NDg3NDg3Nw..*_ga_7VH3HR7H41*
MTY5NDg3NDg3Ni4xLjEuMTY5NDg3NDkxMi4yNC4wLjA.
SOLID principles:
https://www.marcosantadev.com/solid-principles-applied-swift/?source=post_page-----ade30374593d-------------------------------
Crash ios in firestore
Crash ios 16.6 sa ma uit pe ele la jerry
Wallet ios de creat branch nou si decomentat coudl de wallet
Sapt asta:
1.RMSM 1894 - Crash app in reports pe RML SO2
2. JSP - 575 puncte loialitate
3. Screenshot
4. Sa nu se poata modifica adresa
DUpa: smith
La screenshot feedback: multipart/form-data
I. Creational.
A. Factory method. Create different types of objects that belong to the same category. In other words,
this pattern applies when we can construct different types of objects that belong to the same category
(eg construct different types of cars)
B. Builder. Creates a type of object differently. In other words, this pattern applies when we can
construct the same object in multiple ways. (eg constructor a type of car differently eg a blue ford with
manual transmision, 150hp or a red ford with automatic transmision and 125 hp).
C. Singleton.Lets you ensure that a class has only one instance, while providing a global access point to
this instance.
D. Prototype.
II.Behavioral.
A. State. Dynamic class behavior. Allows an object to change its behavior when its internal state
changes. Imagine that we have a Document class. A document can be in one of three states: Draft,
Moderation and Published. The publish method of the document works a little bit differently in each
state:in Draft, it moves the document to moderation. In Moderation, it makes the document public but
only if the current use is an administrator. In Published it doesn't do anything at all.
B. Strategy. Flexible algorithm selection. The Strategy Pattern is a behavioral design pattern that defines
a family of interchangeable algorithms or strategies, encapsulates each one of them, and makes them
interchangeable. This pattern allows a client to choose a specific algorithm from a family of algorithms
at runtime. Use it when:
-
Searching a concept:
- summary of each chapter
tell me how to extract with machine learning the essence of a concept like object oriented
programming. I was thinking at taking lots of books that talk about object oriented programming
tell me how to extract the essence of a text with machine learning? For example, suppose i have a 50
page long text that talks about
Download