This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
public extension MBProgressHUD { | |
@objc func dimBackgroundView() { | |
backgroundView.style = .solidColor | |
backgroundView.color = UIColor(white: 0.0, alpha: 0.4) | |
bezelView.style = .solidColor | |
bezelView.backgroundColor = UIColor(white: 0.0, alpha: 0.9) | |
contentColor = .white | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
// MARK: - ODataErrorPayload | |
public struct ODataErrorPayload: Decodable { | |
private enum CodingKeys: String, CodingKey { | |
case error | |
} | |
public let error: ODataError | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import SAPFoundation | |
import Combine | |
public extension SAPURLSession { | |
enum SAPURLError: Error { | |
case requestFailed(URLError) | |
case redirection(HTTPURLResponse) | |
case client(response: HTTPURLResponse, payload: ODataErrorPayload?) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import SAPFiori | |
/// SAP Fiori loading indicator helper / utility methods | |
public protocol FUILoadingIndicatorProviding: class { | |
var loadingIndicator: FUILoadingIndicatorView? { get set } | |
} | |
public extension FUILoadingIndicatorProviding where Self: UIViewController { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
/// Alert controller helper / utility methods | |
public protocol FUIAlertControllerProviding: class { } | |
public extension FUIAlertControllerProviding where Self: UIViewController { | |
/// Show an alert controller with 1 button | |
/// | |
/// - Parameters: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SAPCommon | |
import SAPFiori | |
import SAPFioriFlows | |
import SAPFoundation | |
class OnboardingErrorHandler { | |
/// Onboarding error handling can be customized here | |
func handleOnboardingError(_ error: Error) { | |
switch error { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SAPCommon | |
import SAPFiori | |
import SAPFioriFlows | |
import SAPFoundation | |
class SnapshotViewController: UIViewController {} | |
class ApplicationUIManager { | |
/// Save ViewController while splash/onboarding screens are presented |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import SAPFioriFlows | |
class ApplicationOnboardingSession: OnboardingSession { | |
var odataController: OnlineODataController | |
required init(flow: OnboardingFlow) { | |
guard let step = flow.steps.first(where: { $0 is ODataOnboardingStep }) as? ODataOnboardingStep, let odataController = step.controller else { | |
fatalError("Reaching this point is a critical developer error. A successful run must contain an OData step which has a controller") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import SAPCommon | |
import SAPFioriFlows | |
import SAPFoundation | |
class ODataOnboardingStep: OnboardingStep { | |
var controller: OnlineODataController? | |
func onboard(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void) { | |
configureOData(using: context, completionHandler: completionHandler) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import SAPFoundation | |
import SAPFioriFlows | |
public extension SAPURLSession { | |
/// Unregisters all observers. | |
func unregisterAllObservers() { | |
observers.forEach( {unregister($0)} ) | |
} |
NewerOlder