feat!: update dependencies and project settings

This commit is contained in:
Vlad 2021-01-11 23:18:29 +03:00
parent 7408446b18
commit 7ffac03d73
19 changed files with 91 additions and 107 deletions

View File

@ -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)

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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";

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:LeadKit.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@ -21,7 +21,7 @@
//
import UIKit
import TIUIKitCore
import TIUIElements
import TISwiftUtils
/// Base full OTP View for entering the verification code

View File

@ -20,7 +20,7 @@
// THE SOFTWARE.
//
import TIUIKitCore
import TIUIElements
import TISwiftUtils
/// Base OTP view with textfield for entering a one symbol

View File

@ -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")
]
)

View File

@ -23,7 +23,7 @@ open class BaseOrientationController: UIViewController {
return super.supportedInterfaceOrientations
}
}
open override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
return forcedInterfaceOrientation ?? super.preferredInterfaceOrientationForPresentation
}

View File

@ -81,10 +81,10 @@ open class RxNetworkOperationModel<LoadingStateType: NetworkOperationState>: 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)
})
}

View File

@ -58,14 +58,16 @@ where ViewModel: BaseSearchViewModel<Item, ItemViewModel> {
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<Item, ItemViewModel> {
open var searchResults: Observable<SearchResultsViewControllerState> {
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: [])
}
}

View File

@ -36,8 +36,9 @@ open class BaseSearchViewModel<Item, ItemViewModel>: 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<Item, ItemViewModel>: GeneralDataLoadingViewModel
.flatMapLatest { [weak self] searchText, items -> Observable<ItemsList> 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)

View File

@ -21,7 +21,6 @@
//
import RxSwift
import RxCocoa
public typealias Spinner = UIView & Animatable

View File

@ -34,7 +34,7 @@ public extension Single {
do {
observer(.success(try elementFactory()))
} catch {
observer(.error(error))
observer(.failure(error))
}
return Disposables.create()

View File

@ -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
}

View File

@ -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
}
}
}

View File

@ -20,7 +20,7 @@
// THE SOFTWARE.
//
import RxCocoa
import RxSwift
private extension Double {
static let halfPeriod = 0.5