Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions PasscodeLock/PasscodeLockViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,16 @@ open class PasscodeLockViewController: UIViewController, PasscodeLockTypeDelegat
touchIDButton?.isHidden = !passcodeLock.isTouchIDAllowed
}

// MARK: - Orientations

open override var shouldAutorotate: Bool {
return self.passcodeConfiguration.shouldAutorotate
}

open override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return self.passcodeConfiguration.supportedInterfaceOrientations
}

// MARK: - Events

fileprivate func setupEvents() {
Expand Down
21 changes: 21 additions & 0 deletions PasscodeLock/Protocols/PasscodeLockConfigurationType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,25 @@ public protocol PasscodeLockConfigurationType {
var shouldRequestTouchIDImmediately: Bool {get}
var touchIdReason: String? {get set}
var maximumInccorectPasscodeAttempts: Int {get}
var supportedInterfaceOrientations: UIInterfaceOrientationMask {get}
var shouldAutorotate: Bool {get}
}

// set configuration optionals
extension PasscodeLockConfigurationType {
var passcodeLength: Int {
return 4
}

var maximumInccorectPasscodeAttempts: Int {
return -1
}

var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return .portrait
}

var shouldAutorotate: Bool {
return false
}
}
Loading