Class Page

With the Page Class you can directly access all pages within your contentApp and open them with it. The page class could be used, for example, for the following use cases.

  1. development of own menu elements
  2. development of a breadcrump navigation
  3. development of special navigation buttons
  4. development of special navigation lists
  5. ...

Class Page Properties

The following properties are available in the Page Class:

pageName

Get the page name. Returns the name (as string) of the page that you have set in the contentDock Management System for the respective contentApp.

Example for get the page name
let page = CDockSDK.rootObj()
print(page?.pageName)

pageId

Get the page id. Returns the ID (as integer) of a page.

Example for get the page id
let page = CDockSDK.rootObj()
print(page?.pageId)

isActive

Gets if the page is active. Returns (as Boolean) whether the page is active.

Example is Page active
let page = CDockSDK.rootObj()
print(page?.isActive)

Class Page Functions

The following functions are available in the Page Class. Please note that all Swipe pages can be configured individually in the contentDock Management System. By default, the Swipe pages are generated automatically, depending on the page tree in the contentDock Management System.

childrenPages

Returns all subpages (as an array) of a page object (Page Class).

Example for for get all child pages
if let arrChildPages = page?.childrenPages, arrChildren.count > 0 {
    var childPages = "--> Child Pages:\n"
    for pageObj in arrChildPages {
        childPages = childPages + self.pageString(page: pageObj, isShowSwipes: true)
    }
    s = s + childPages + "\n\n"
}

pageSwipeUp

Returns the Page object (Page Class) called at swipe up.

Example for get Page object for swipe up
let page = CDockSDK.rootObj()
print(page?.pageSwipeUp)

pageSwipeDown

Returns the page object (Page Class) that is called at swipe down.

Example for get Page object for swipe down
let page = CDockSDK.rootObj()
print(page?.pageSwipeDown)

pageSwipeLeft

Returns the page object (Page Class) that is called at swipe left.

Example for get Page object for swipe left
let page = CDockSDK.rootObj()
print(page?.pageSwipeLeft)

pageSwipeRight

Returns the page object (Page Class) that is called at swipe right.

Example for get Page object for swipe right
let page = CDockSDK.rootObj()
print(page?.pageSwipeRight)

showMe

Shows the page to the page object (Page Class) in the App.

Example for show a page
@objc class func onMyButtonTapped() {
    if let page = CDockSDK.pageObject(forId: "1234") {
        page.showMe()
    }
}

Functions return the page class

rootObj

Returns the root page object (Page Class) of your contentApp.

Example for get the root page
let page = CDockSDK.rootObj()

curPageObj

Returns the current page object (Page Class) of your contentApp.

Example for get the current page
let page = CDockSDK.curPageObj()

pageObject

Returns the page object (Page Class) for a special ID of your contentApp.

Example for get a page by id
@objc class func onMyButtonTapped() {
    if let page = CDockSDK.pageObject(forId: "1234") {
        page.showMe()
    }
}

Parameter forId: Set here the ID of the required page.


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