MainController
class MainController
MainController
control the operation in each viewController
-
MainViewController
Declaration
Swift
static var mainViewController: MainViewController?
-
HomeViewController
Declaration
Swift
static var homeViewController: HomeViewController?
-
NavViewController
Declaration
Swift
static var navViewController: NavViewController?
-
SearchResultsViewController
Declaration
Swift
static var searchResultsViewController: SearchResultsViewController?
-
FeaturedViewController
Declaration
Swift
static var featuredViewController: FeaturedViewController?
-
UserViewController
Declaration
Swift
static var userViewController: UserViewController?
-
User Placeholder
Declaration
Swift
static var user: User
-
Defalut user
Declaration
Swift
static var userDefaults: UserDefaults
-
Debug status
Declaration
Swift
static var DEBUG: Bool
-
Queue to process the operation of the App
See moreDeclaration
Swift
class Queue
-
Set top bar hide status
Usage Example:
MainController.setHideTopBar(true)
Declaration
Swift
static func setHideTopBar(hide: Bool)
-
Fetch default content for the
homeView
Usage Example:
MainController.setHideTopBar(true)
Declaration
Swift
static func fetchDefaultContents(cancellable: Bool) -> [Content]
-
Undocumented
Declaration
Swift
static func fetchFeaturedContents(cancellable: Bool) -> [Content]
-
Undocumented
Declaration
Swift
static func fetchContents(keyWord: String, contentType: String, cancellable: Bool) -> [Content]
-
Search on X5GON database for given
Keywords
andcontentType
Keyword
keyword to search- contentType: content Type
Usage Example:
MainController.search("science", "pdf")
Declaration
Swift
static func search(keyword: String, contentType: String, cancellable: Bool) -> [Content]
Return Value
list of Contents
-
Login using
username
andpasswords
Usage Example:
MainController.login(username,password,csrfToken)
Declaration
Swift
static func login(username: String, password: String) -> Bool
Parameters
username
Username type:
String
read from UITextFieldpassword
Passsword type
String
read from UITextFieldReturn Value
login status in Bool type
-
logout
Declaration
Swift
static func logout()
-
Declaration
Swift
static func addHistory(content: Content)
-
Undocumented
Declaration
Swift
static func getNotes(id: Int) -> String
-
Undocumented
Declaration
Swift
static func createNotes(id: Int, text: String)
-
Undocumented
Declaration
Swift
static func reportContent(id: Int, reason: String)
-
Undocumented
Declaration
Swift
static func saveUserData()
-
Undocumented
Declaration
Swift
static func loadUserData() -> User
-
Undocumented
Declaration
Swift
deinit