Skip to content
View daniyalyousuf07's full-sized avatar
🎯
Focusing
🎯
Focusing

Block or report daniyalyousuf07

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse

Pinned Loading

  1. A demo of Open-Closed principle. A demo of Open-Closed principle.
    1
    import Foundation
    2
    
                  
    3
    
                  
    4
    protocol CakePaymentDelegate {
    5
        func payForCake(amount: Double)
  2. Facade Pattern Facade Pattern
    1
    import Foundation
    2
    
                  
    3
    ///Facade Class that hides implementation and provide interface to control implementation of all dependencies
    4
    /*
    5
     The facade pattern (also spelled façade) is a software-design pattern commonly used in object-oriented programming. Analogous to a facade in architecture, a facade is an object that serves as a front-facing interface masking more complex underlying or structural code. A facade can:
  3. Factory design pattern Factory design pattern
    1
    import Foundation
    2
    
                  
    3
    ///In class-based programming, the factory method pattern is a creational pattern that uses factory methods to deal with the problem of creating objects without having to specify the exact class of the object that will be created. This is done by creating objects by calling a factory method—either specified in an interface and implemented by child classes, or implemented in a base class and optionally overridden by derived classes—rather than by calling a constructor.
    4
    ///
    5
    
                  
  4. A demo of Dependency Inversion Princ... A demo of Dependency Inversion Principle (DIP) & Example of network mocking
    1
    import Foundation
    2
    
                  
    3
    protocol APIHandlerProtocol {
    4
        func fetchData(url: URL,
    5
                         completion: @escaping(Result<Data,
  5. This class shows the working of a se... This class shows the working of a serial and a concurrent queue with synchronous and asynchronous tasks submitted.
    1
    import Foundation
    2
    
                  
    3
    
                  
    4
    ///////Points to Remember
    5
    //1 - serial - only 1 thread