Simple networking layer in Swift using Strategy design pattern Does the following code demonstrate proper use of Strategy design pattern for a simple networking layer in swift 3? 

Some code smells I'm unsure about:  


violates Single responsibiility principle. Each strategy class such as Find, has a method for a different type of implementation. This is because I could want to find an image, or a user, or a chatroom. which are stored at different nodes in Firebase. all these different find methods are clumped together in Find class. 
At the call sight of a request, if I need to make multiple async request, I nest the next request call inside the closure of the call back. Is this Ok?
The request object allows access to every type of insert, and find method. so in my signup VC I could i have the option to download a chatroom. Is even having access to that kind of implementation bad?


I have posted the code below, and left out all the actual implementation for brevity.  

Any tips or guidance is much appreciated! 

// USE CASE: Would go in viewDidLoad of ViewController
func testMyRequest () {

    let myRequest = Request(insert: Insert(), find: Find())

    myRequest.find?.user(with: "id", handler: { (user) in

        myRequest.find?.nearbyUsers(user: user, handler: { (users) in

            // update collectionView datasource
        })
    })
}

// Is this protocol necessary?
protocol RequestProtocol {
    // - Family of algorithms, related actions.
    var insert: Insert? { get set }
    var find: Find? { get set }
}


// ---------------------------

class Request: RequestProtocol {

    var insert: Insert?
    var find: Find?

    init(insert: Insert?, find: Find?) {
        self.insert = insert
        self.find = find
    }
}


// Use a singleton maybe for the classes below? Why wouldn't I?  

class Insert {

    init() { }

    func user(_ user: User) {
        // insert user to firebase implementation
    }

    func message(_ message: Message) -&gt; Void  {
        // insert message to firebase impelmentation
    }

    func image(data: Data, user: User)  {
        // insert image to firebase impelmentation
    }
}


class Find {

    init() { }

    func user(with id: String, handler: @escaping (_ user: User) -&gt; Void ) {
        // find user implementation
    }

    func allChatrooms(handler: @escaping ([Chatroom]) -&gt; Void) {
        // find all chatrooms implementation
    }

    func nearbyUsers(user: User, handler: @escaping ([User]) -&gt; Void ) {
        // find nearby Users relative to current User location implementation
    }

    // Private helper method
    private func findChatPartners (currentUser: User, chatrooms: [Chatroom] ) -&gt; Set&lt;String&gt; {
    }

}
What you have is not a Strategy pattern... The key features of the Strategy pattern is that once the Strategy object is inserted into the Context, it is not referenced from outside the Context. Your view controller is still rooting around inside the Context object for the strategy object.

The simplest way to solve this is to have the view controllers be the context. Then you would have a protocol:

protocol API {
    func insert(user: User)
    func insert(message: Message)
    func insert(imageData: Data, toUserID: String)
    func findUser(withID: String, completion: @escaping (User) -&gt; Void)
    // etc...
}


Then you would have a FirebaseAPI that would implement this protocol and a TestAPI that would implement it. The TestAPI would just return canned data so you can test all the possible permutations.