From 39ca3d7fbd8bb1f22d0085d4dae1315c41c953d8 Mon Sep 17 00:00:00 2001 From: Alexey Gerasimov Date: Thu, 27 Apr 2017 15:58:44 +0300 Subject: [PATCH] Oops --- .../Classes/LoadingBarButton.swift | 7 +++--- .../Enums/ApiErrorProtocol.swift | 22 +++++++++++++++---- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/LeadKitAdditions/LeadKitAdditions/Classes/LoadingBarButton.swift b/LeadKitAdditions/LeadKitAdditions/Classes/LoadingBarButton.swift index c22f87d..4056510 100644 --- a/LeadKitAdditions/LeadKitAdditions/Classes/LoadingBarButton.swift +++ b/LeadKitAdditions/LeadKitAdditions/Classes/LoadingBarButton.swift @@ -32,7 +32,7 @@ public enum LoadingBarButtonSide { public class LoadingBarButton { fileprivate weak var navigationItem: UINavigationItem? - fileprivate var savedBarButton: UIBarButtonItem? + fileprivate var initialBarButton: UIBarButtonItem? private let side: LoadingBarButtonSide private var barButtonItem: UIBarButtonItem? { @@ -57,17 +57,16 @@ public class LoadingBarButton { public init(navigationItem: UINavigationItem, side: LoadingBarButtonSide) { self.navigationItem = navigationItem self.side = side + initialBarButton = barButtonItem } fileprivate func setState(waiting: Bool = false) { if waiting { - savedBarButton = barButtonItem - let activityIndicatorItem = UIBarButtonItem.activityIndicator barButtonItem = activityIndicatorItem.barButton activityIndicatorItem.activityIndicator.startAnimating() } else { - barButtonItem = savedBarButton + barButtonItem = initialBarButton } } diff --git a/LeadKitAdditions/LeadKitAdditions/Enums/ApiErrorProtocol.swift b/LeadKitAdditions/LeadKitAdditions/Enums/ApiErrorProtocol.swift index 3f7d8c9..e71b6ae 100644 --- a/LeadKitAdditions/LeadKitAdditions/Enums/ApiErrorProtocol.swift +++ b/LeadKitAdditions/LeadKitAdditions/Enums/ApiErrorProtocol.swift @@ -1,9 +1,23 @@ // -// ApiErrorProtocol.swift -// LeadKitAdditions +// Copyright (c) 2017 Touch Instinct // -// Created by Alexey Gerasimov on 27/04/2017. -// Copyright © 2017 TouchInstinct. All rights reserved. +// 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: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// 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. // public protocol ApiErrorProtocol: RawRepresentable {}