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
| let errorDescription = NSLocalizedString("The request failed", comment: "") | |
| let errorFailureReason = NSLocalizedString("The response returned a \(statusCode).", comment: "") | |
| // Assembly `userInfo` | |
| let userInfo = [ | |
| NSLocalizedDescriptionKey: errorDescription, | |
| NSLocalizedFailureReasonErrorKey: errorFailureReason, | |
| "CostomKey1": "Some custom value", | |
| "CostomKey2": "Some custom value" | |
| ] | |
| // Make 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 Cocoa | |
| import QRCodeCore | |
| final class PreferencesController: NSWindowController { | |
| private lazy var preferences = QRCodePreferences.shared | |
| @IBOutlet var messageTextField: NSTextField! | |
| override func windowDidLoad() { |
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 QRCodeCore | |
| import ScreenSaver | |
| final class QRCodeScreensaver: ScreenSaverView { | |
| fileprivate lazy var codeView = QRCodeView(frame: .zero) | |
| fileprivate lazy var preferences = PreferencesController( | |
| windowNibName: QRCodePreferences.preferencesIdentifier | |
| ) | |
| override init?(frame: NSRect, isPreview: Bool) { |
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 Cocoa | |
| import QuartzCore | |
| open class QRCodeView: NSView { | |
| public var preferences: QRCodePreferences? { | |
| didSet { | |
| guard let preferences = self.preferences else { | |
| return | |
| } | |
| let message = preferences.message.data( |
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 | |
| public protocol QRCodePreferences { | |
| var message: String { get } | |
| } |
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
| default_platform(:ios) | |
| platform :ios do | |
| def install_pods | |
| cocoapods( | |
| clean: true, | |
| podfile: "Podfile", | |
| try_repo_update_on_error: true | |
| ) | |
| end |
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
| stages: | |
| - lint | |
| - test | |
| - develop | |
| variables: | |
| LANG: "en_US.UTF-8" | |
| LC_ALL: "en_US.UTF-8" | |
| before_script: |