Function: Load contentApps from your contentDock account

The contentApps are only loaded from your contentDock user account. A basic distinction is made between private and public contentApps. You configure this in the settings of the respective contentApp in the contentDock Management System.

Example to load public / private contentApps
import UIKit
import CDockFramework
class VCCustomProjectsList: UIViewController {

    enum ListType {
        case publicProjects
        case privateProjects
    }

    // Your individual function
    // ...

    private func refresh() {
        switch self.listType {
        case .privateProjects:
            /* 
            Parameters "from" and "to": 
            Number of private projects to be loaded from your contentDock account. 
            If you want to display 10 projects per list page, then: 
            For the first page: from: 0, to: 10
            For the second page: from: 11, to: 20
            ...
            */
            CDockSDK.getPrivateProjects(from: 0, to: 100) { [weak self] arr in
                // As result you get an array with ProjectModel objects
                if let arrProjects = arr as? [ProjectModel] {
                    // Your individual function
                    // ...
                }
            }
            break
        case .publicProjects:
            /* 
            Parameters "from" and "to": 
            Number of public projects to be loaded from your contentDock account. 
            If you want to display 10 projects per list page, then: 
            For the first page: from: 0, to: 10
            For the second page: from: 11, to: 20
            ...
            */
            CDockSDK.getPublicProjects(from: 0, to: 100) { [weak self] arr in
                // As result you get an array with ProjectModel objects
                if let arrProjects = arr as? [ProjectModel] {
                    // Your individual function
                    // ...
                }
            }
            break
       }
    }

}

More information


Feedback or Questions

We are always happy to help you with questions about the code or other questions.

Was this page helpful? Yes No

Topics on this page