diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f811a36d..00000000 --- a/.travis.yml +++ /dev/null @@ -1,31 +0,0 @@ - -language: swift -osx_image: xcode10 - -env: - global: - - LC_CTYPE=en_US.UTF-8 - - LANG=en_US.UTF-8 - -jdk: - - oraclejdk9 - -before_install: - - env - - locale - - gem install xcpretty --no-rdoc --no-ri --no-document --quiet - - xcpretty --version - - xcodebuild -version - - xcodebuild -showsdks - - pod install --repo-update - - brew install pmd - -script: - - set -o pipefail - - xcodebuild -enableCodeCoverage YES CODE_SIGNING_ALLOWED=YES -workspace LeadKit.xcworkspace -scheme 'LeadKit iOS' -destination 'platform=iOS Simulator,OS=12.0,name=iPhone 7' build test | xcpretty -c - - xcodebuild -enableCodeCoverage YES CODE_SIGNING_ALLOWED=YES -workspace LeadKit.xcworkspace -scheme 'LeadKit iOS Extensions' -destination 'platform=iOS Simulator,OS=12.0,name=iPhone 7' build test | xcpretty -c - - xcodebuild -enableCodeCoverage YES CODE_SIGNING_ALLOWED=YES -workspace LeadKit.xcworkspace -scheme 'LeadKit tvOS' -destination 'platform=tvOS Simulator,name=Apple TV 4K' -sdk appletvsimulator build test | xcpretty -c - -after_success: - - sleep 5 - - bash < (curl -s https://codecov.io/bash) diff --git a/Cartfile b/Cartfile index d85cec25..a3994bb9 100644 --- a/Cartfile +++ b/Cartfile @@ -1,7 +1,7 @@ github "malcommac/SwiftDate" github "Alamofire/Alamofire" -github "RxSwiftCommunity/RxAlamofire" ~> 5.6.0 +github "RxSwiftCommunity/RxAlamofire" ~> 6.1 github "TouchInstinct/TableKit" -github "ReactiveX/RxSwift" ~> 5.1.0 +github "ReactiveX/RxSwift" ~> 6.0.0 github "pronebird/UIScrollView-InfiniteScroll" github "SnapKit/SnapKit" ~> 5.0 \ No newline at end of file diff --git a/Cartfile.resolved b/Cartfile.resolved index 0653077e..b941224c 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,7 +1,7 @@ -github "Alamofire/Alamofire" "5.2.2" -github "ReactiveX/RxSwift" "5.1.1" -github "RxSwiftCommunity/RxAlamofire" "v5.6.1" +github "Alamofire/Alamofire" "5.4.1" +github "ReactiveX/RxSwift" "6.0.0" +github "RxSwiftCommunity/RxAlamofire" "v6.1.1" github "SnapKit/SnapKit" "5.0.1" github "TouchInstinct/TableKit" "2.10008.1" -github "malcommac/SwiftDate" "6.1.0" +github "malcommac/SwiftDate" "6.3.1" github "pronebird/UIScrollView-InfiniteScroll" "1.1.0" diff --git a/LeadKit.podspec b/LeadKit.podspec index 8da751f4..bee613f2 100644 --- a/LeadKit.podspec +++ b/LeadKit.podspec @@ -7,12 +7,12 @@ Pod::Spec.new do |s| s.author = "Touch Instinct" s.source = { :git => "https://github.com/TouchInstinct/LeadKit.git", :tag => s.version } s.platform = :ios, '10.0' - s.swift_versions = ['5.0'] + s.swift_versions = ['5.1'] s.subspec 'UIColorHex' do |ss| - ss.ios.deployment_target = '8.0' - ss.tvos.deployment_target = '9.0' - ss.watchos.deployment_target = '2.0' + ss.ios.deployment_target = '10.0' + ss.tvos.deployment_target = '10.0' + ss.watchos.deployment_target = '3.0' ss.source_files = "Sources/Extensions/UIColor/UIColor+Hex.swift" end @@ -104,13 +104,13 @@ Pod::Spec.new do |s| "Sources/Structures/DataLoading/PaginationDataLoading/*" ] - ss.dependency "RxSwift", '~> 5.1.0' - ss.dependency "RxCocoa", '~> 5.1.0' - ss.dependency "RxAlamofire", '~> 5.6.0' + ss.dependency "RxSwift", '~> 6.0.0' + ss.dependency "RxCocoa", '~> 6.0.0' + ss.dependency "RxAlamofire", '~> 6.1.1' ss.dependency "SwiftDate", '~> 6' - ss.ios.dependency "TableKit", '~> 2.8' - ss.ios.dependency "SnapKit", '~> 5.0.0' + ss.ios.dependency "TableKit", '~> 2.11' + ss.ios.dependency "SnapKit", '~> 5.0.1' ss.ios.dependency "UIScrollView-InfiniteScroll", '~> 1.1.0' end diff --git a/LeadKit.xcodeproj/project.pbxproj b/LeadKit.xcodeproj/project.pbxproj index ab9769bd..0e84aa21 100644 --- a/LeadKit.xcodeproj/project.pbxproj +++ b/LeadKit.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -476,7 +476,6 @@ 785EDF7C220072B500985ED4 /* SwiftDate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 785EDF76220072B400985ED4 /* SwiftDate.framework */; }; 785EDF7D220072B500985ED4 /* RxCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 785EDF77220072B400985ED4 /* RxCocoa.framework */; }; 785EDF7E220072B500985ED4 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 785EDF78220072B500985ED4 /* Alamofire.framework */; }; - 785EDF7F220072B500985ED4 /* RxAtomic.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 785EDF79220072B500985ED4 /* RxAtomic.framework */; }; 785EDF80220072B500985ED4 /* RxAlamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 785EDF7A220072B500985ED4 /* RxAlamofire.framework */; }; 785EDF81220072B500985ED4 /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 785EDF7B220072B500985ED4 /* RxSwift.framework */; }; 785EDF8322007DF900985ED4 /* TableKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 785EDF8222007DF900985ED4 /* TableKit.framework */; }; @@ -484,11 +483,9 @@ 785EDFA1220081F200985ED4 /* RxCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 785EDF9C220081F100985ED4 /* RxCocoa.framework */; }; 785EDFA2220081F200985ED4 /* SwiftDate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 785EDF9D220081F100985ED4 /* SwiftDate.framework */; }; 785EDFA3220081F200985ED4 /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 785EDF9E220081F100985ED4 /* RxSwift.framework */; }; - 785EDFA4220081F200985ED4 /* RxAtomic.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 785EDF9F220081F100985ED4 /* RxAtomic.framework */; }; 785EDFA5220081F200985ED4 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 785EDFA0220081F100985ED4 /* Alamofire.framework */; }; 785EDFB22200833100985ED4 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 785EDFA8220082E600985ED4 /* Alamofire.framework */; }; 785EDFB32200833100985ED4 /* RxAlamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 785EDFA9220082E600985ED4 /* RxAlamofire.framework */; }; - 785EDFB42200833100985ED4 /* RxAtomic.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 785EDFAB220082E600985ED4 /* RxAtomic.framework */; }; 785EDFB52200833100985ED4 /* RxCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 785EDFA7220082E500985ED4 /* RxCocoa.framework */; }; 785EDFB62200833100985ED4 /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 785EDFA6220082E500985ED4 /* RxSwift.framework */; }; 785EDFB72200833100985ED4 /* SwiftDate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 785EDFAA220082E600985ED4 /* SwiftDate.framework */; }; @@ -829,7 +826,6 @@ files = ( 785EDF7E220072B500985ED4 /* Alamofire.framework in Frameworks */, 785EDF81220072B500985ED4 /* RxSwift.framework in Frameworks */, - 785EDF7F220072B500985ED4 /* RxAtomic.framework in Frameworks */, 785EDF7D220072B500985ED4 /* RxCocoa.framework in Frameworks */, 785EDF80220072B500985ED4 /* RxAlamofire.framework in Frameworks */, 82D296712264B4C10067735C /* SnapKit.framework in Frameworks */, @@ -844,7 +840,6 @@ buildActionMask = 2147483647; files = ( 785EDFA5220081F200985ED4 /* Alamofire.framework in Frameworks */, - 785EDFA4220081F200985ED4 /* RxAtomic.framework in Frameworks */, 785EDFA1220081F200985ED4 /* RxCocoa.framework in Frameworks */, 785EDFA2220081F200985ED4 /* SwiftDate.framework in Frameworks */, 785EDFA3220081F200985ED4 /* RxSwift.framework in Frameworks */, @@ -856,7 +851,6 @@ buildActionMask = 2147483647; files = ( 785EDFB22200833100985ED4 /* Alamofire.framework in Frameworks */, - 785EDFB42200833100985ED4 /* RxAtomic.framework in Frameworks */, 785EDFB62200833100985ED4 /* RxSwift.framework in Frameworks */, 785EDFB52200833100985ED4 /* RxCocoa.framework in Frameworks */, 785EDFB32200833100985ED4 /* RxAlamofire.framework in Frameworks */, @@ -2326,7 +2320,7 @@ }; }; buildConfigurationList = 78CFEE241C5C456B00F50370 /* Build configuration list for PBXProject "LeadKit" */; - compatibilityVersion = "Xcode 3.2"; + compatibilityVersion = "Xcode 12.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( @@ -3019,8 +3013,12 @@ ); INFOPLIST_FILE = "$(SRCROOT)/Sources/Info-iOS.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); OTHER_SWIFT_FLAGS = "$(inherited) -Xfrontend -warn-long-expression-type-checking=200 -Xfrontend -warn-long-function-bodies=200 -Xfrontend -debug-time-function-bodies"; PRODUCT_BUNDLE_IDENTIFIER = "ru.touchin.LeadKit-iOS"; PRODUCT_NAME = LeadKit; @@ -3049,8 +3047,12 @@ ); INFOPLIST_FILE = "$(SRCROOT)/Sources/Info-iOS.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); OTHER_SWIFT_FLAGS = "$(inherited) -Xfrontend -warn-long-expression-type-checking=200 -Xfrontend -warn-long-function-bodies=200 -Xfrontend -debug-time-function-bodies"; PRODUCT_BUNDLE_IDENTIFIER = "ru.touchin.LeadKit-iOS"; PRODUCT_NAME = LeadKit; @@ -3078,7 +3080,11 @@ ); INFOPLIST_FILE = "$(SRCROOT)/Sources/Info-watchOS.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); OTHER_SWIFT_FLAGS = "$(inherited) -Xfrontend -warn-long-expression-type-checking=200 -Xfrontend -warn-long-function-bodies=200 -Xfrontend -debug-time-function-bodies"; PRODUCT_BUNDLE_IDENTIFIER = "ru.touchin.LeadKit-watchOS"; PRODUCT_NAME = LeadKit; @@ -3110,7 +3116,11 @@ ); INFOPLIST_FILE = "$(SRCROOT)/Sources/Info-watchOS.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); OTHER_SWIFT_FLAGS = "$(inherited) -Xfrontend -warn-long-expression-type-checking=200 -Xfrontend -warn-long-function-bodies=200 -Xfrontend -debug-time-function-bodies"; PRODUCT_BUNDLE_IDENTIFIER = "ru.touchin.LeadKit-watchOS"; PRODUCT_NAME = LeadKit; @@ -3140,7 +3150,11 @@ ); INFOPLIST_FILE = "$(SRCROOT)/Sources/Info-tvOS.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); OTHER_SWIFT_FLAGS = "$(inherited) -Xfrontend -warn-long-expression-type-checking=200 -Xfrontend -warn-long-function-bodies=200 -Xfrontend -debug-time-function-bodies"; PRODUCT_BUNDLE_IDENTIFIER = "ru.touchin.LeadKit-tvOS"; PRODUCT_NAME = LeadKit; @@ -3149,7 +3163,7 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.0; + TVOS_DEPLOYMENT_TARGET = 10.0; }; name = Debug; }; @@ -3171,7 +3185,11 @@ ); INFOPLIST_FILE = "$(SRCROOT)/Sources/Info-tvOS.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); OTHER_SWIFT_FLAGS = "$(inherited) -Xfrontend -warn-long-expression-type-checking=200 -Xfrontend -warn-long-function-bodies=200 -Xfrontend -debug-time-function-bodies"; PRODUCT_BUNDLE_IDENTIFIER = "ru.touchin.LeadKit-tvOS"; PRODUCT_NAME = LeadKit; @@ -3179,7 +3197,7 @@ SKIP_INSTALL = YES; SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.0; + TVOS_DEPLOYMENT_TARGET = 10.0; }; name = Release; }; @@ -3231,7 +3249,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -3284,10 +3302,11 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; diff --git a/LeadKit.xcworkspace/contents.xcworkspacedata b/LeadKit.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index eed5408a..00000000 --- a/LeadKit.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/LeadKit.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/LeadKit.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d98100..00000000 --- a/LeadKit.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/OTPSwiftView/Sources/Views/OTPSwiftView/OTPSwiftView.swift b/OTPSwiftView/Sources/Views/OTPSwiftView/OTPSwiftView.swift index 1df6a0b1..b15a4b7a 100644 --- a/OTPSwiftView/Sources/Views/OTPSwiftView/OTPSwiftView.swift +++ b/OTPSwiftView/Sources/Views/OTPSwiftView/OTPSwiftView.swift @@ -21,7 +21,7 @@ // import UIKit -import TIUIKitCore +import TIUIElements import TISwiftUtils /// Base full OTP View for entering the verification code diff --git a/OTPSwiftView/Sources/Views/OTPView/OTPView.swift b/OTPSwiftView/Sources/Views/OTPView/OTPView.swift index c2a29468..db0533f2 100644 --- a/OTPSwiftView/Sources/Views/OTPView/OTPView.swift +++ b/OTPSwiftView/Sources/Views/OTPView/OTPView.swift @@ -20,7 +20,7 @@ // THE SOFTWARE. // -import TIUIKitCore +import TIUIElements import TISwiftUtils /// Base OTP view with textfield for entering a one symbol diff --git a/Package.swift b/Package.swift index 3489e4a0..6c5640d1 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.0 +// swift-tools-version:5.1 import PackageDescription let package = Package( @@ -25,6 +25,6 @@ let package = Package( .target(name: "TIFoundationUtils", dependencies: ["TISwiftUtils"], path: "TIFoundationUtils/Sources"), .target(name: "TIUIElements", dependencies: ["TIUIKitCore", "TISwiftUtils"], path: "TIUIElements/Sources"), .target(name: "TITableKitUtils", dependencies: ["TIUIElements", "TableKit"], path: "TITableKitUtils/Sources"), - .target(name: "OTPSwiftView", dependencies: ["TIUIKitCore", "TISwiftUtils"], path: "OTPSwiftView/Sources") + .target(name: "OTPSwiftView", dependencies: ["TIUIElements"], path: "OTPSwiftView/Sources") ] ) diff --git a/Sources/Classes/Controllers/BaseOrientationController.swift b/Sources/Classes/Controllers/BaseOrientationController.swift index 3d6981d8..1b63a347 100644 --- a/Sources/Classes/Controllers/BaseOrientationController.swift +++ b/Sources/Classes/Controllers/BaseOrientationController.swift @@ -23,7 +23,7 @@ open class BaseOrientationController: UIViewController { return super.supportedInterfaceOrientations } } - + open override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation { return forcedInterfaceOrientation ?? super.preferredInterfaceOrientationForPresentation } diff --git a/Sources/Classes/DataLoading/RxNetworkOperationModel.swift b/Sources/Classes/DataLoading/RxNetworkOperationModel.swift index f0acc160..f5d5d0fe 100644 --- a/Sources/Classes/DataLoading/RxNetworkOperationModel.swift +++ b/Sources/Classes/DataLoading/RxNetworkOperationModel.swift @@ -81,10 +81,10 @@ open class RxNetworkOperationModel: Net func requestResult(from dataSource: DataSourceType) { currentRequestDisposable = dataSource .resultSingle() - .observeOn(MainScheduler.instance) + .observe(on: MainScheduler.instance) .subscribe(onSuccess: { [weak self] result in self?.onGot(result: result, from: dataSource) - }, onError: { [weak self] error in + }, onFailure: { [weak self] error in self?.onGot(error: error) }) } diff --git a/Sources/Classes/Search/BaseSearchViewController.swift b/Sources/Classes/Search/BaseSearchViewController.swift index ce84d686..f4bbe615 100644 --- a/Sources/Classes/Search/BaseSearchViewController.swift +++ b/Sources/Classes/Search/BaseSearchViewController.swift @@ -58,14 +58,16 @@ where ViewModel: BaseSearchViewModel { open override func bindViews() { super.bindViews() viewModel.itemsViewModelsDriver - .drive(onNext: { [weak self] viewModels in - self?.handle(itemViewModels: viewModels) + .withUnretained(self) + .drive(onNext: { owner, viewModels in + owner.handle(itemViewModels: viewModels) }) .disposed(by: disposeBag) Observable.merge(searchResults, resetResults) - .subscribe(onNext: { [weak self] state in - self?.handle(searchResultsState: state) + .withUnretained(self) + .subscribe(onNext: { owner, state in + owner.handle(searchResultsState: state) }) .disposed(by: disposeBag) @@ -151,8 +153,9 @@ where ViewModel: BaseSearchViewModel { open var searchResults: Observable { return viewModel.searchResultsDriver .asObservable() - .map { [weak self] viewModels -> SearchResultsViewControllerState in - self?.stateForUpdate(with: viewModels) ?? .rowsContent(rows: []) + .withUnretained(self) + .map { owner, viewModels -> SearchResultsViewControllerState in + owner.stateForUpdate(with: viewModels) ?? .rowsContent(rows: []) } } diff --git a/Sources/Classes/Search/BaseSearchViewModel.swift b/Sources/Classes/Search/BaseSearchViewModel.swift index 709dda0f..6c0edf7d 100644 --- a/Sources/Classes/Search/BaseSearchViewModel.swift +++ b/Sources/Classes/Search/BaseSearchViewModel.swift @@ -36,8 +36,9 @@ open class BaseSearchViewModel: GeneralDataLoadingViewModel open var itemsViewModelsDriver: Driver<[ItemViewModel]> { return loadingResultObservable - .map { [weak self] items in - self?.viewModels(from: items) + .withUnretained(self) + .map { owner, items in + owner.viewModels(from: items) } .flatMap { Observable.from(optional: $0) } .share(replay: 1, scope: .forever) @@ -54,8 +55,9 @@ open class BaseSearchViewModel: GeneralDataLoadingViewModel .flatMapLatest { [weak self] searchText, items -> Observable in self?.search(by: searchText, from: items).asObservable() ?? .empty() } - .map { [weak self] items in - self?.viewModels(from: items) + .withUnretained(self) + .map { owner, items in + owner.viewModels(from: items) } .flatMap { Observable.from(optional: $0) } .share(replay: 1, scope: .forever) diff --git a/Sources/Classes/Views/CustomizableButton/CustomizableButtonView.swift b/Sources/Classes/Views/CustomizableButton/CustomizableButtonView.swift index 80488726..e777815a 100644 --- a/Sources/Classes/Views/CustomizableButton/CustomizableButtonView.swift +++ b/Sources/Classes/Views/CustomizableButton/CustomizableButtonView.swift @@ -21,7 +21,6 @@ // import RxSwift -import RxCocoa public typealias Spinner = UIView & Animatable diff --git a/Sources/Extensions/Rx/PrimitiveSequence/Single/Single+DeferredJust.swift b/Sources/Extensions/Rx/PrimitiveSequence/Single/Single+DeferredJust.swift index 0018eea0..bfb66c15 100644 --- a/Sources/Extensions/Rx/PrimitiveSequence/Single/Single+DeferredJust.swift +++ b/Sources/Extensions/Rx/PrimitiveSequence/Single/Single+DeferredJust.swift @@ -34,7 +34,7 @@ public extension Single { do { observer(.success(try elementFactory())) } catch { - observer(.error(error)) + observer(.failure(error)) } return Disposables.create() diff --git a/Sources/Extensions/UIInterfaceOrientation/UIInterfaceOrientation+ VideoOrientation.swift b/Sources/Extensions/UIInterfaceOrientation/UIInterfaceOrientation+ VideoOrientation.swift index 616968bf..2c87a1b1 100644 --- a/Sources/Extensions/UIInterfaceOrientation/UIInterfaceOrientation+ VideoOrientation.swift +++ b/Sources/Extensions/UIInterfaceOrientation/UIInterfaceOrientation+ VideoOrientation.swift @@ -2,7 +2,7 @@ import Foundation import AVFoundation public extension UIInterfaceOrientation { - + var videoOrientation: AVCaptureVideoOrientation { switch self { case .portrait, .unknown: @@ -16,7 +16,7 @@ public extension UIInterfaceOrientation { case .portraitUpsideDown: return .portraitUpsideDown - + @unknown default: return .portrait } diff --git a/Sources/Extensions/UIKit/UIButton/UIButton+ViewTextConfigurable.swift b/Sources/Extensions/UIKit/UIButton/UIButton+ViewTextConfigurable.swift index f0fb45f2..fdffbac4 100644 --- a/Sources/Extensions/UIKit/UIButton/UIButton+ViewTextConfigurable.swift +++ b/Sources/Extensions/UIKit/UIButton/UIButton+ViewTextConfigurable.swift @@ -100,6 +100,13 @@ private extension UIControl.ContentHorizontalAlignment { } else { self = .left } + + @unknown default: + if #available(iOS 11, tvOS 11, *) { + self = .leading + } else { + self = .left + } } } @@ -122,6 +129,9 @@ private extension UIControl.ContentHorizontalAlignment { case .trailing: return .right + + @unknown default: + return .left } } } diff --git a/Sources/Extensions/UIKit/UIImageView/UIImageView+ExpandCollapseDisclosure.swift b/Sources/Extensions/UIKit/UIImageView/UIImageView+ExpandCollapseDisclosure.swift index b61c18dd..af58b6eb 100644 --- a/Sources/Extensions/UIKit/UIImageView/UIImageView+ExpandCollapseDisclosure.swift +++ b/Sources/Extensions/UIKit/UIImageView/UIImageView+ExpandCollapseDisclosure.swift @@ -20,7 +20,7 @@ // THE SOFTWARE. // -import RxCocoa +import RxSwift private extension Double { static let halfPeriod = 0.5