Skip to content

Commit b1dbf00

Browse files
committed
Release Authenticator 2.0.3
2 parents bfb7c12 + e02b3ff commit b1dbf00

File tree

79 files changed

+498
-424
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+498
-424
lines changed

.swiftlint.yml

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,54 @@ excluded:
44
- Carthage
55
- fastlane
66
opt_in_rules:
7+
- array_init
78
- attributes
89
- closure_end_indentation
910
- closure_spacing
1011
- conditional_returns_on_newline
12+
- contains_over_first_not_nil
13+
- discouraged_object_literal
14+
- discouraged_optional_boolean
1115
- empty_count
16+
- empty_string
17+
- explicit_enum_raw_value
1218
- explicit_init
19+
- extension_access_modifier
20+
- fatal_error_message
1321
- file_header
1422
- first_where
1523
- force_unwrapping
16-
- missing_docs
17-
- nimble_operator
18-
- number_separator
24+
- implicit_return
25+
- implicitly_unwrapped_optional
26+
- joined_default_parameter
27+
- let_var_whitespace
28+
- literal_expression_end_indentation
29+
- lower_acl_than_parent
1930
- operator_usage_whitespace
2031
- overridden_super_call
32+
- override_in_extension
33+
- pattern_matching_keywords
34+
- private_action
2135
- private_outlet
2236
- prohibited_super_call
2337
- redundant_nil_coalescing
38+
- single_test_class
39+
- sorted_first_last
2440
- switch_case_on_newline
25-
- vertical_whitespace
41+
- untyped_error_in_catch
42+
- vertical_parameter_alignment_on_call
43+
- yoda_condition
2644
disabled_rules:
45+
- identifier_name
2746
- line_length
2847
- todo
2948

3049
cyclomatic_complexity:
3150
warning: 15
3251

52+
function_body_length:
53+
warning: 50
54+
3355
trailing_comma:
3456
mandatory_comma: true
3557

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ language: objective-c
55
xcode_workspace: Authenticator.xcworkspace
66
xcode_scheme: Authenticator
77

8-
osx_image: xcode9
8+
osx_image: xcode9.3
99

1010
env:
1111
- RUNTIME="iOS 9.0" DEVICE="iPhone 4s"

Authenticator.xcodeproj/project.pbxproj

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -571,20 +571,21 @@
571571
CLASSPREFIX = OTP;
572572
LastSwiftMigration = 0700;
573573
LastSwiftUpdateCheck = 0820;
574-
LastUpgradeCheck = 0800;
574+
LastUpgradeCheck = 0930;
575575
ORGANIZATIONNAME = "Matt Rubin";
576576
TargetAttributes = {
577577
1D6058900D05DD3D006BFB54 = {
578578
DevelopmentTeam = WD7ETSN9J9;
579-
LastSwiftMigration = 0830;
579+
LastSwiftMigration = 0910;
580580
ProvisioningStyle = Automatic;
581581
};
582582
C9906A2D1812522100BAEF53 = {
583-
LastSwiftMigration = 0830;
583+
LastSwiftMigration = 0910;
584584
TestTargetID = 1D6058900D05DD3D006BFB54;
585585
};
586586
C9A262CC1E170BD4004E6CEB = {
587587
CreatedOnToolsVersion = 8.2.1;
588+
LastSwiftMigration = 0910;
588589
TestTargetID = 1D6058900D05DD3D006BFB54;
589590
};
590591
};
@@ -763,6 +764,7 @@
763764
INFOPLIST_FILE = Authenticator/Resources/Info.plist;
764765
PRODUCT_BUNDLE_IDENTIFIER = me.mattrubin.authenticator;
765766
PRODUCT_NAME = Authenticator;
767+
SWIFT_TREAT_WARNINGS_AS_ERRORS = NO;
766768
TARGETED_DEVICE_FAMILY = 1;
767769
VERSIONING_SYSTEM = "apple-generic";
768770
};
@@ -779,7 +781,7 @@
779781
);
780782
GCC_DYNAMIC_NO_PIC = NO;
781783
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
782-
SWIFT_VERSION = 3.0;
784+
SWIFT_VERSION = 4.0;
783785
};
784786
name = Debug;
785787
};
@@ -794,7 +796,7 @@
794796
);
795797
GCC_DYNAMIC_NO_PIC = NO;
796798
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
797-
SWIFT_VERSION = 3.0;
799+
SWIFT_VERSION = 4.0;
798800
};
799801
name = Release;
800802
};

Authenticator.xcodeproj/xcshareddata/xcschemes/Authenticator Demo.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0820"
3+
LastUpgradeVersion = "0930"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Authenticator.xcodeproj/xcshareddata/xcschemes/Authenticator.xcscheme

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0800"
3+
LastUpgradeVersion = "0930"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,8 +26,8 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
shouldUseLaunchSchemeArgsEnv = "YES"
30-
codeCoverageEnabled = "YES">
29+
codeCoverageEnabled = "YES"
30+
shouldUseLaunchSchemeArgsEnv = "YES">
3131
<Testables>
3232
<TestableReference
3333
skipped = "NO">
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

Authenticator/Resources/Acknowledgements.html

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ <h2><a href="https://github.com/ekscrypto/Base32">
3333
<h2><a href="https://github.com/mattrubin/OneTimePassword">
3434
OneTimePassword
3535
</a></h2>
36-
<p>Copyright (c) 2013-2017 Matt Rubin and the OneTimePassword authors</p>
36+
<p>Copyright (c) 2013-2018 Matt Rubin and the OneTimePassword authors</p>
3737
<p>Permission is hereby granted, free of charge, to any person obtaining a copy
3838
of this software and associated documentation files (the "Software"), to deal
3939
in the Software without restriction, including without limitation the rights
@@ -53,10 +53,22 @@ <h2><a href="https://github.com/mattrubin/OneTimePassword">
5353
<h2><a href="https://github.com/SVProgressHUD/SVProgressHUD">
5454
SVProgressHUD
5555
</a></h2>
56-
<p>Copyright (c) 2011-2017 Sam Vermette, Tobias Tiemerding and contributors.</p>
57-
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p>
58-
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>
59-
<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
56+
<p>Copyright (c) 2011-2018 Sam Vermette, Tobias Tiemerding and contributors.</p>
57+
<p>Permission is hereby granted, free of charge, to any person obtaining a copy
58+
of this software and associated documentation files (the "Software"), to deal
59+
in the Software without restriction, including without limitation the rights
60+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
61+
copies of the Software, and to permit persons to whom the Software is
62+
furnished to do so, subject to the following conditions:</p>
63+
<p>The above copyright notice and this permission notice shall be included in all
64+
copies or substantial portions of the Software.</p>
65+
<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
66+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
67+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
68+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
69+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
70+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
71+
SOFTWARE.</p>
6072

6173
<h2><a href="https://github.com/jspahrsummers/xcconfigs">
6274
xcconfigs

Authenticator/Resources/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<key>CFBundlePackageType</key>
1818
<string>APPL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>2.0.2</string>
20+
<string>2.0.3</string>
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleURLTypes</key>

Authenticator/Source/AppController.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// AppController.swift
33
// Authenticator
44
//
5-
// Copyright (c) 2016 Authenticator authors
5+
// Copyright (c) 2016-2017 Authenticator authors
66
//
77
// Permission is hereby granted, free of charge, to any person obtaining a copy
88
// of this software and associated documentation files (the "Software"), to deal
@@ -37,7 +37,7 @@ class AppController {
3737
}
3838
}
3939
private lazy var view: RootViewController = {
40-
let (currentViewModel, nextRefreshTime) = self.component.viewModel(for: self.store.persistentTokens,
40+
let (currentViewModel, nextRefreshTime) = self.component.viewModel(with: self.store.persistentTokens,
4141
at: .currentDisplayTime())
4242
self.setTimer(withNextRefreshTime: nextRefreshTime)
4343
return RootViewController(
@@ -75,10 +75,10 @@ class AppController {
7575

7676
@objc
7777
func updateView() {
78-
let (currentViewModel, nextRefreshTime) = component.viewModel(for: store.persistentTokens,
78+
let (currentViewModel, nextRefreshTime) = component.viewModel(with: store.persistentTokens,
7979
at: .currentDisplayTime())
8080
setTimer(withNextRefreshTime: nextRefreshTime)
81-
view.updateWithViewModel(currentViewModel)
81+
view.update(with: currentViewModel)
8282
}
8383

8484
private func setTimer(withNextRefreshTime nextRefreshTime: Date) {
@@ -97,7 +97,7 @@ class AppController {
9797

9898
private func handleAction(_ action: Root.Action) {
9999
do {
100-
let sideEffect = try component.update(action)
100+
let sideEffect = try component.update(with: action)
101101
if let effect = sideEffect {
102102
handleEffect(effect)
103103
}
@@ -107,7 +107,7 @@ class AppController {
107107
}
108108

109109
private func handleEvent(_ event: Root.Event) {
110-
let sideEffect = component.update(event)
110+
let sideEffect = component.update(with: event)
111111
if let effect = sideEffect {
112112
handleEffect(effect)
113113
}

Authenticator/Source/BarButtonViewModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// BarButtonViewModel.swift
33
// Authenticator
44
//
5-
// Copyright (c) 2015 Authenticator authors
5+
// Copyright (c) 2015-2017 Authenticator authors
66
//
77
// Permission is hereby granted, free of charge, to any person obtaining a copy
88
// of this software and associated documentation files (the "Software"), to deal

Authenticator/Source/ButtonHeaderView.swift

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// ButtonHeaderView.swift
33
// Authenticator
44
//
5-
// Copyright (c) 2015 Authenticator authors
5+
// Copyright (c) 2015-2017 Authenticator authors
66
//
77
// Permission is hereby granted, free of charge, to any person obtaining a copy
88
// of this software and associated documentation files (the "Software"), to deal
@@ -58,7 +58,7 @@ class ButtonHeaderView<Action>: UIButton {
5858
private func configureSubviews() {
5959
titleLabel?.textAlignment = .center
6060
setTitleColor(.otpForegroundColor, for: UIControlState.normal)
61-
titleLabel?.font = UIFont.systemFont(ofSize: 16, weight: UIFontWeightLight)
61+
titleLabel?.font = UIFont.systemFont(ofSize: 16, weight: .light)
6262

6363
addTarget(self, action: #selector(ButtonHeaderView.buttonWasPressed), for: .touchUpInside)
6464
}
@@ -68,20 +68,21 @@ class ButtonHeaderView<Action>: UIButton {
6868
convenience init(viewModel: ButtonHeaderViewModel<Action>, dispatchAction: @escaping (Action) -> Void) {
6969
self.init()
7070
self.dispatchAction = dispatchAction
71-
updateWithViewModel(viewModel)
71+
update(with: viewModel)
7272
}
7373

74-
func updateWithViewModel(_ viewModel: ButtonHeaderViewModel<Action>) {
74+
func update(with viewModel: ButtonHeaderViewModel<Action>) {
7575
setTitle(viewModel.title, for: .normal)
7676
buttonAction = viewModel.action
7777
}
7878

79-
static func heightWithViewModel(_ viewModel: ButtonHeaderViewModel<Action>) -> CGFloat {
79+
static func heightForHeader(with viewModel: ButtonHeaderViewModel<Action>) -> CGFloat {
8080
return preferredHeight
8181
}
8282

8383
// MARK: - Target Action
8484

85+
@objc
8586
func buttonWasPressed() {
8687
if let action = buttonAction {
8788
dispatchAction?(action)

Authenticator/Source/Colors.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Colors.swift
33
// Authenticator
44
//
5-
// Copyright (c) 2014-2015 Authenticator authors
5+
// Copyright (c) 2014-2017 Authenticator authors
66
//
77
// Permission is hereby granted, free of charge, to any person obtaining a copy
88
// of this software and associated documentation files (the "Software"), to deal

Authenticator/Source/Component.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Component.swift
33
// Authenticator
44
//
5-
// Copyright (c) 2016 Authenticator authors
5+
// Copyright (c) 2016-2017 Authenticator authors
66
//
77
// Permission is hereby granted, free of charge, to any person obtaining a copy
88
// of this software and associated documentation files (the "Software"), to deal
@@ -30,7 +30,7 @@ protocol Component {
3030
// MARK: Update
3131
associatedtype Action
3232
associatedtype Effect
33-
mutating func update(_ action: Action) throws -> Effect?
33+
mutating func update(with action: Action) throws -> Effect?
3434
}
3535

3636
struct ComponentError<C: Component>: Error {

Authenticator/Source/Demo.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Demo.swift
33
// Authenticator
44
//
5-
// Copyright (c) 2016 Authenticator authors
5+
// Copyright (c) 2016-2017 Authenticator authors
66
//
77
// Permission is hereby granted, free of charge, to any person obtaining a copy
88
// of this software and associated documentation files (the "Software"), to deal
@@ -106,12 +106,12 @@ extension TokenEntryForm {
106106
static let demoForm: TokenEntryForm = {
107107
// Construct a pre-filled demo form.
108108
var form = TokenEntryForm()
109-
_ = form.update(.issuer("Google"))
110-
_ = form.update(.name("john.appleseed@gmail.com"))
111-
_ = form.update(.secret("JBSWY3DPEHPK6PX9"))
109+
_ = form.update(with: .issuer("Google"))
110+
_ = form.update(with: .name("john.appleseed@gmail.com"))
111+
_ = form.update(with: .secret("JBSWY3DPEHPK6PX9"))
112112
if UIScreen.main.bounds.height > 550 {
113113
// Expand the advanced options for iPhone 5 and later, but not for the earlier 3.5-inch screens.
114-
_ = form.update(.showAdvancedOptions)
114+
_ = form.update(with: .showAdvancedOptions)
115115
}
116116
return form
117117
}()

Authenticator/Source/DisplayTime.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// DisplayTime.swift
33
// Authenticator
44
//
5-
// Copyright (c) 2016 Authenticator authors
5+
// Copyright (c) 2016-2018 Authenticator authors
66
//
77
// Permission is hereby granted, free of charge, to any person obtaining a copy
88
// of this software and associated documentation files (the "Software"), to deal
@@ -26,7 +26,7 @@
2626
import Foundation
2727

2828
/// A simple value representing a moment in time, stored as the number of seconds since the epoch.
29-
struct DisplayTime: Equatable {
29+
struct DisplayTime {
3030
let timeIntervalSince1970: TimeInterval
3131

3232
init(date: Date) {
@@ -37,7 +37,3 @@ struct DisplayTime: Equatable {
3737
return Date(timeIntervalSince1970: timeIntervalSince1970)
3838
}
3939
}
40-
41-
func == (lhs: DisplayTime, rhs: DisplayTime) -> Bool {
42-
return lhs.timeIntervalSince1970 == rhs.timeIntervalSince1970
43-
}

Authenticator/Source/FocusCell.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// FocusCell.swift
33
// Authenticator
44
//
5-
// Copyright (c) 2015 Authenticator authors
5+
// Copyright (c) 2015-2017 Authenticator authors
66
//
77
// Permission is hereby granted, free of charge, to any person obtaining a copy
88
// of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)