Classes

The following classes are available globally.

  • Undocumented

    See more

    Declaration

    Swift

    @UIApplicationMain
    public final class AppDelegate : UIResponder, UIApplicationDelegate
  • Linked List. A linked list is a linear collection of data elements where each element points to the next. A linked list has several theoretical advantages over contiguous storage options such as the Swift Array:

  • Constant time insertion and removal from the front of the list.
  • Reliable performance characteristics.

  • Note

    Use a linked list over a Swift array if you need to store a large amount of data and you need to perform insertions and removals from any position in the sequence.

    Do not use a linked list if you need indexing, sorting, random access to the data or sequence traversal from the back of the sequence to the front.

    Warning

    Due to the fact that each node has a reference to the next node, the memory footprint of a linked list can have a negative impact on the device if the list becomes extremely large.
    See more

    Declaration

    Swift

    open class LinkedList<T>
  • Stack. A stack is a collection of elements following a First-In-Last-Out (FILO) order.

    Note

    Use a Stack if you need a sequence ordered as FILO.
    See more

    Declaration

    Swift

    open class Stack<T>
  • Decodes data from a network response.

    Subspec: Utility/HTTPClient

    Alamofire.request(request.endpoint).responseJSON { (response) in
        completion(self.decoder.decodeData(response.data))
    }
    

    The data decoder can be used with network requests that return a Data object. The DataDecoder uses the APIErrorType to identify the network errors. If the object can not be deserialized the decoder will print out which coding key failed the the deserialization. Integration with the killswitch is also available if the api error received matched the unique killswitch or force update identifier.

    See more

    Declaration

    Swift

    open class DataDecoder
  • Mock http client handles mocks JSON requests.

    Subspec: Utility/HTTPClient

    mockHTTPClient.perform(jsonFileName: "Events") { (resposnse: Result<[Event]>) in
        // Handle response.
    }
    

    The MockHTTPClient can load and decode the contents of a JSON file into a swift network model. The JSON file needs to be within the project directory.

    See more

    Declaration

    Swift

    open class MockHTTPClient
  • The haptic generator.

    See more

    Declaration

    Swift

    @objcMembers
    public class HapticGenerator : NSObject
  • The BaseKillSwitchView used to be subclassed to add functionality to the UIView.

    Subspec: Utility/KillSwitchProvider

    final class KillSwitchView: BaseKillSwitchView {
    
        private let descriptionLabel = UILabel()
    
        override func setUserMessage(_ message: String) {
            descriptionLabel.setText(message, using: theme.textStyleTheme.bodyNormal.withAlignment(.center))
        }
    
    }
    

    The BaseKillSwitchView is a simple class that combines a view with the setUserMessage functionality. The setUserMessage class should be overrided in the subclass.

    See more

    Declaration

    Swift

    open class BaseKillSwitchView : UIView
  • Session manager used to manage a user’s login status.

    Subspec: Utility/SessionManager

    let sessionManager = SessionManager<User>()
    

    Given a Codable user object, the SessionManager will store the authentication token in the secure keychain and will store the user object into the user defaults for fast sign-in when the app is relaunched.

    See more

    Declaration

    Swift

    open class SessionManager<T> where T : Decodable, T : Encodable
  • Validates the permissions for the app to access the calendar.

    Subspec: Utility/CalendarPermissionsValidator

    private lazy var calendarPermissionsValidator: CalendarPermissionsValidator = {
        let validator = CalendarPermissionsValidator()
        validator.delegate = self
        return validator
    }()
    
    calendarPermissionsValidator.addEventToCalendar(eventInfo: eventCalendarInfo)
    

    The CalendarPermissionsValidator uses the default EKEventStore to add an event to a user’s calendar if the necessary permissions are given.

    See more

    Declaration

    Swift

    open class CalendarPermissionsValidator
  • 
    The FormValidator allows to evaluate sign up forms easily. Simply provide email, password and the type of validation you
    want to specify for the given password.
    FormValidator is only mean't to be used for Sign up forms.
    
    See more

    Declaration

    Swift

    public class FormValidator
  • A infinite page control that shrinks/expands its dots.

    Subspec: Views/InfinityPageControl

    private lazy var pageControl = InfinityPageControl(activeDotImage: #imageLiteral(resourceName: "active-dot"),
                                                       inactiveDotImage: #imageLiteral(resourceName: "inactive-dot"))
    
    pageControl.numberOfPages = dataSources.count
    pageControl.currentPage = currentPage
    

    The InfinityPageControl allows a infinitely scrollable page control view similar to the instagram style of page control. When initializing the active and inactive images can be set. The number of pages and the current page can be updated post init and will resize upon setting it. When constrainting the page control you can set the height of the view, however please do not set the width of the view since this might cause constraint issues.

    See more

    Declaration

    Swift

    open class InfinityPageControl : UIControl
  • A dot in the page control

    See more

    Declaration

    Swift

    final class PagingDot : UIView
  • Displays and hides a loading indicator in the center of the view.

    Subspec: View/LoadingIndicator

    private lazy var loadingIndicator = LoadingIndicator(activityIndicatorViewStyle: .gray,
                                                         indicatorColor: theme.colorTheme.emphasisPrimary)
    
    loadingIndicator.isLoading(loading: loading)
    

    Simply adds a UIActivityIndicatorView to the center of LoadingIndicator view and allows to change the loading status.

    See more

    Declaration

    Swift

    open class LoadingIndicator : UIView