Skip to content

Commit 2a2fd96

Browse files
authored
Merge pull request #25 from hovaks/master
version 1.2.0
2 parents 73f9fef + f7940b1 commit 2a2fd96

File tree

14 files changed

+89
-74
lines changed

14 files changed

+89
-74
lines changed

.swift-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
# * http://www.objc.io/issue-6/travis-ci.html
33
# * https://github.com/supermarin/xcpretty#usage
44

5-
osx_image: xcode9.3
5+
osx_image: xcode10.2
66
language: swift
77
cache: cocoapods
88
podfile: Example/Podfile
99
before_install:
1010
- gem install cocoapods # Since Travis is not always on latest version
1111
- pod install --project-directory=Example --repo-update
1212
script:
13-
- set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/RxRestClient.xcworkspace -scheme RxRestClient-Example -destination 'platform=iOS Simulator,name=iPhone 6s,OS=9.3' ONLY_ACTIVE_ARCH=NO | xcpretty
13+
- set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/RxRestClient.xcworkspace -scheme RxRestClient-Example -destination 'platform=iOS Simulator,name=iPhone 6s,OS=10.0' ONLY_ACTIVE_ARCH=NO | xcpretty
1414
- pod lib lint --allow-warnings
1515
notifications:
1616
email:

Example/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use_frameworks!
44

55
target 'RxRestClient_Example' do
66
pod 'RxRestClient', :path => '../'
7-
pod 'RxOptional', '~> 3.5.0'
7+
pod 'RxOptional', '~> 4.0.0'
88
pod 'ObjectMapper', '~> 3.3.0'
99
pod 'AlamofireNetworkActivityIndicator', '~> 2.3.0'
1010
pod 'SDWebImage', '~> 4.4.2'

Example/Podfile.lock

Lines changed: 38 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,39 @@
11
PODS:
2-
- Alamofire (4.7.3)
2+
- Alamofire (4.8.2)
33
- AlamofireNetworkActivityIndicator (2.3.0):
44
- Alamofire (~> 4.7)
5-
- Nimble (7.3.1)
5+
- Nimble (7.3.4)
66
- ObjectMapper (3.3.0)
7-
- Quick (1.3.2)
8-
- RxAlamofire (4.3.0):
9-
- RxAlamofire/Core (= 4.3.0)
10-
- RxAlamofire/Core (4.3.0):
11-
- Alamofire (~> 4.5)
12-
- RxSwift (~> 4)
13-
- RxCocoa (4.3.1):
14-
- RxSwift (~> 4.0)
15-
- RxOptional (3.5.0):
16-
- RxCocoa (~> 4.0)
17-
- RxSwift (~> 4.0)
18-
- RxRestClient (1.0.3):
7+
- Quick (1.3.4)
8+
- RxAlamofire (5.0.0):
9+
- RxAlamofire/Core (= 5.0.0)
10+
- RxAlamofire/Core (5.0.0):
11+
- Alamofire (~> 4.8)
12+
- RxSwift (~> 5.0)
13+
- RxCocoa (5.0.0):
14+
- RxRelay (~> 5)
15+
- RxSwift (~> 5)
16+
- RxOptional (4.0.0):
17+
- RxCocoa (~> 5)
18+
- RxSwift (~> 5)
19+
- RxRelay (5.0.0):
20+
- RxSwift (~> 5)
21+
- RxRestClient (1.2.0):
1922
- Alamofire (~> 4)
20-
- RxAlamofire (~> 4)
21-
- RxCocoa (~> 4)
22-
- RxSwift (~> 4)
23-
- RxSwift (4.3.1)
24-
- SDWebImage (4.4.2):
25-
- SDWebImage/Core (= 4.4.2)
26-
- SDWebImage/Core (4.4.2)
23+
- RxAlamofire (~> 5)
24+
- RxCocoa (~> 5)
25+
- RxSwift (~> 5)
26+
- RxSwift (5.0.0)
27+
- SDWebImage (4.4.6):
28+
- SDWebImage/Core (= 4.4.6)
29+
- SDWebImage/Core (4.4.6)
2730

2831
DEPENDENCIES:
2932
- AlamofireNetworkActivityIndicator (~> 2.3.0)
3033
- Nimble (~> 7.3.1)
3134
- ObjectMapper (~> 3.3.0)
3235
- Quick (~> 1.3.2)
33-
- RxOptional (~> 3.5.0)
36+
- RxOptional (~> 4.0.0)
3437
- RxRestClient (from `../`)
3538
- SDWebImage (~> 4.4.2)
3639

@@ -44,6 +47,7 @@ SPEC REPOS:
4447
- RxAlamofire
4548
- RxCocoa
4649
- RxOptional
50+
- RxRelay
4751
- RxSwift
4852
- SDWebImage
4953

@@ -52,18 +56,19 @@ EXTERNAL SOURCES:
5256
:path: "../"
5357

5458
SPEC CHECKSUMS:
55-
Alamofire: c7287b6e5d7da964a70935e5db17046b7fde6568
59+
Alamofire: ae5c501addb7afdbb13687d7f2f722c78734c2d3
5660
AlamofireNetworkActivityIndicator: 18346ff6d770d9513d0ac6f2d99706f40f93dbaa
57-
Nimble: 04f732da099ea4d153122aec8c2a88fd0c7219ae
61+
Nimble: 051e3d8912d40138fa5591c78594f95fb172af37
5862
ObjectMapper: b612bf8c8e99c4dc0bb6013a51f7c27966ed5da9
59-
Quick: 2623cb30d7a7f41ca62f684f679586558f483d46
60-
RxAlamofire: 09624d0f2d48ed8b686e4eb4cf68e28cbd2df556
61-
RxCocoa: 78763c7b07d02455598d9fc3c1ad091a28b73635
62-
RxOptional: bd32ff8ca9df4177683d56ffeb618a9d4d5d5cad
63-
RxRestClient: 340008f96fd0efc0c8c5c5dab884641077d64649
64-
RxSwift: fe0fd770a43acdb7d0a53da411c9b892e69bb6e4
65-
SDWebImage: 624d6e296c69b244bcede364c72ae0430ac14681
63+
Quick: f4f7f063c524394c73ed93ac70983c609805d481
64+
RxAlamofire: e7875a012aff55345672d0f70a2a9cd6aeb0f211
65+
RxCocoa: fcf32050ac00d801f34a7f71d5e8e7f23026dcd8
66+
RxOptional: 9904e2219d59260c3c171273d475b2126de187e8
67+
RxRelay: 4f7409406a51a55cd88483f21ed898c234d60f18
68+
RxRestClient: 8bffa40d201a99a25e6537921bed2c596a7cc908
69+
RxSwift: 8b0671caa829a763bbce7271095859121cbd895f
70+
SDWebImage: 3f3f0c02f09798048c47a5ed0a13f17b063572d8
6671

67-
PODFILE CHECKSUM: 245160e961b6336397158c6bbd6db9b87829aa88
72+
PODFILE CHECKSUM: e36ea5b45e7317f482ff7b8fb57fc3a886f1a890
6873

69-
COCOAPODS: 1.5.3
74+
COCOAPODS: 1.7.0

Example/RxRestClient.xcodeproj/project.pbxproj

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -299,23 +299,25 @@
299299
isa = PBXProject;
300300
attributes = {
301301
LastSwiftUpdateCheck = 0830;
302-
LastUpgradeCheck = 0930;
302+
LastUpgradeCheck = 1020;
303303
ORGANIZATIONNAME = CocoaPods;
304304
TargetAttributes = {
305305
607FACCF1AFB9204008FA782 = {
306306
CreatedOnToolsVersion = 6.3.1;
307-
LastSwiftMigration = 1000;
307+
DevelopmentTeam = Y2RY2C6N5B;
308+
LastSwiftMigration = 1020;
308309
};
309310
607FACE41AFB9204008FA782 = {
310311
CreatedOnToolsVersion = 6.3.1;
311-
LastSwiftMigration = 1000;
312+
DevelopmentTeam = Y2RY2C6N5B;
313+
LastSwiftMigration = 1020;
312314
TestTargetID = 607FACCF1AFB9204008FA782;
313315
};
314316
};
315317
};
316318
buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "RxRestClient" */;
317319
compatibilityVersion = "Xcode 3.2";
318-
developmentRegion = English;
320+
developmentRegion = en;
319321
hasScannedForEncodings = 0;
320322
knownRegions = (
321323
en,
@@ -359,7 +361,7 @@
359361
files = (
360362
);
361363
inputPaths = (
362-
"${SRCROOT}/Pods/Target Support Files/Pods-RxRestClient_Tests/Pods-RxRestClient_Tests-frameworks.sh",
364+
"${PODS_ROOT}/Target Support Files/Pods-RxRestClient_Tests/Pods-RxRestClient_Tests-frameworks.sh",
363365
"${BUILT_PRODUCTS_DIR}/Nimble/Nimble.framework",
364366
"${BUILT_PRODUCTS_DIR}/Quick/Quick.framework",
365367
);
@@ -370,7 +372,7 @@
370372
);
371373
runOnlyForDeploymentPostprocessing = 0;
372374
shellPath = /bin/sh;
373-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-RxRestClient_Tests/Pods-RxRestClient_Tests-frameworks.sh\"\n";
375+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RxRestClient_Tests/Pods-RxRestClient_Tests-frameworks.sh\"\n";
374376
showEnvVarsInLog = 0;
375377
};
376378
4B7A092D988BF9C591785B1A /* [CP] Check Pods Manifest.lock */ = {
@@ -415,13 +417,14 @@
415417
files = (
416418
);
417419
inputPaths = (
418-
"${SRCROOT}/Pods/Target Support Files/Pods-RxRestClient_Example/Pods-RxRestClient_Example-frameworks.sh",
420+
"${PODS_ROOT}/Target Support Files/Pods-RxRestClient_Example/Pods-RxRestClient_Example-frameworks.sh",
419421
"${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework",
420422
"${BUILT_PRODUCTS_DIR}/AlamofireNetworkActivityIndicator/AlamofireNetworkActivityIndicator.framework",
421423
"${BUILT_PRODUCTS_DIR}/ObjectMapper/ObjectMapper.framework",
422424
"${BUILT_PRODUCTS_DIR}/RxAlamofire/RxAlamofire.framework",
423425
"${BUILT_PRODUCTS_DIR}/RxCocoa/RxCocoa.framework",
424426
"${BUILT_PRODUCTS_DIR}/RxOptional/RxOptional.framework",
427+
"${BUILT_PRODUCTS_DIR}/RxRelay/RxRelay.framework",
425428
"${BUILT_PRODUCTS_DIR}/RxRestClient/RxRestClient.framework",
426429
"${BUILT_PRODUCTS_DIR}/RxSwift/RxSwift.framework",
427430
"${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework",
@@ -434,13 +437,14 @@
434437
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxAlamofire.framework",
435438
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxCocoa.framework",
436439
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxOptional.framework",
440+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxRelay.framework",
437441
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxRestClient.framework",
438442
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxSwift.framework",
439443
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework",
440444
);
441445
runOnlyForDeploymentPostprocessing = 0;
442446
shellPath = /bin/sh;
443-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-RxRestClient_Example/Pods-RxRestClient_Example-frameworks.sh\"\n";
447+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RxRestClient_Example/Pods-RxRestClient_Example-frameworks.sh\"\n";
444448
showEnvVarsInLog = 0;
445449
};
446450
/* End PBXShellScriptBuildPhase section */
@@ -514,6 +518,7 @@
514518
isa = XCBuildConfiguration;
515519
buildSettings = {
516520
ALWAYS_SEARCH_USER_PATHS = NO;
521+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
517522
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
518523
CLANG_CXX_LIBRARY = "libc++";
519524
CLANG_ENABLE_MODULES = YES;
@@ -569,6 +574,7 @@
569574
isa = XCBuildConfiguration;
570575
buildSettings = {
571576
ALWAYS_SEARCH_USER_PATHS = NO;
577+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
572578
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
573579
CLANG_CXX_LIBRARY = "libc++";
574580
CLANG_ENABLE_MODULES = YES;
@@ -618,12 +624,13 @@
618624
baseConfigurationReference = A42DAEEC8A3AEE1412D49087 /* Pods-RxRestClient_Example.debug.xcconfig */;
619625
buildSettings = {
620626
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
627+
DEVELOPMENT_TEAM = Y2RY2C6N5B;
621628
INFOPLIST_FILE = RxRestClient/Info.plist;
622629
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
623630
MODULE_NAME = ExampleApp;
624631
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
625632
PRODUCT_NAME = "$(TARGET_NAME)";
626-
SWIFT_VERSION = 4.2;
633+
SWIFT_VERSION = 5.0;
627634
};
628635
name = Debug;
629636
};
@@ -632,19 +639,21 @@
632639
baseConfigurationReference = 0B15649EE24899A594BBCD81 /* Pods-RxRestClient_Example.release.xcconfig */;
633640
buildSettings = {
634641
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
642+
DEVELOPMENT_TEAM = Y2RY2C6N5B;
635643
INFOPLIST_FILE = RxRestClient/Info.plist;
636644
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
637645
MODULE_NAME = ExampleApp;
638646
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
639647
PRODUCT_NAME = "$(TARGET_NAME)";
640-
SWIFT_VERSION = 4.2;
648+
SWIFT_VERSION = 5.0;
641649
};
642650
name = Release;
643651
};
644652
607FACF31AFB9204008FA782 /* Debug */ = {
645653
isa = XCBuildConfiguration;
646654
baseConfigurationReference = 6A57BB764AFFA38C35D1BEAB /* Pods-RxRestClient_Tests.debug.xcconfig */;
647655
buildSettings = {
656+
DEVELOPMENT_TEAM = Y2RY2C6N5B;
648657
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
649658
GCC_PREPROCESSOR_DEFINITIONS = (
650659
"DEBUG=1",
@@ -654,7 +663,7 @@
654663
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
655664
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
656665
PRODUCT_NAME = "$(TARGET_NAME)";
657-
SWIFT_VERSION = 4.2;
666+
SWIFT_VERSION = 5.0;
658667
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RxRestClient_Example.app/RxRestClient_Example";
659668
};
660669
name = Debug;
@@ -663,12 +672,13 @@
663672
isa = XCBuildConfiguration;
664673
baseConfigurationReference = 6D54F3BC098218181BCF97B3 /* Pods-RxRestClient_Tests.release.xcconfig */;
665674
buildSettings = {
675+
DEVELOPMENT_TEAM = Y2RY2C6N5B;
666676
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
667677
INFOPLIST_FILE = Tests/Info.plist;
668678
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
669679
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
670680
PRODUCT_NAME = "$(TARGET_NAME)";
671-
SWIFT_VERSION = 4.2;
681+
SWIFT_VERSION = 5.0;
672682
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RxRestClient_Example.app/RxRestClient_Example";
673683
};
674684
name = Release;

Example/RxRestClient.xcodeproj/xcshareddata/xcschemes/RxRestClient-Example.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 = "1000"
3+
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Example/RxRestClient/Models/ImageUploadState.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct ImageUploadState: ResponseState {
2727
switch response.0.statusCode {
2828
case 200..<300:
2929
if let body = response.1 {
30-
self.response = try? ImageUploadResponse(JSONString: body)
30+
self.response = ImageUploadResponse(JSONString: body)
3131
}
3232
case 413:
3333
self.tooLarge = true

Example/RxRestClient/ViewModels/NewContactViewModel.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ class NewContactViewModel {
1616

1717
private let disposeBag = DisposeBag()
1818

19-
let firstName = Variable<String?>(nil)
20-
let lastName = Variable<String?>(nil)
21-
let email = Variable<String?>(nil)
22-
let image = Variable<UIImage?>(nil)
19+
let firstName = BehaviorRelay<String?>(value: nil)
20+
let lastName = BehaviorRelay<String?>(value: nil)
21+
let email = BehaviorRelay<String?>(value: nil)
22+
let image = BehaviorRelay<UIImage?>(value: nil)
2323
let saveCommand = PublishSubject<Void>()
2424

2525
var createState: Driver<DefaultState> = .never()
@@ -46,12 +46,12 @@ class NewContactViewModel {
4646

4747
private func initData() {
4848
guard let contact = oldContact else { return }
49-
firstName.value = contact.firstName
50-
lastName.value = contact.lastName
51-
email.value = contact.email
49+
firstName.accept(contact.firstName)
50+
lastName.accept(contact.lastName)
51+
email.accept(contact.email)
5252

5353
SDWebImageDownloader.shared().downloadImage(with: contact.imageURL, progress: nil) { [weak self] image, _, _, _ in
54-
self?.image.value = image
54+
self?.image.accept(image)
5555
self?.imageUploaded.onNext(contact.images.first)
5656
}
5757
}

Example/RxRestClient/ViewModels/RepositoriesViewModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ final class RepositoriesViewModel {
3737

3838
private func doBindings() {
3939
let state = search
40-
.throttle(0.3, scheduler: MainScheduler.instance)
40+
.throttle(.milliseconds(300), scheduler: MainScheduler.instance)
4141
.map { RepositoryQuery(q: $0) }
4242
.flatMapLatest { [service, loadMore] query in
4343
service.get(query: query, loadNextPageTrigger: loadMore.asObservable())

Example/RxRestClient/Views/NewContactViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class NewContactViewController: UIViewController {
6666
.disposed(by: disposeBag)
6767
}
6868

69-
private func twoWayBind<Base>(_ variable: Variable<Base>, _ property: ControlProperty<Base>) -> Disposable {
69+
private func twoWayBind<Base>(_ variable: BehaviorRelay<Base>, _ property: ControlProperty<Base>) -> Disposable {
7070
let d1 = property
7171
.skip(1)
7272
.bind(to: variable)
@@ -153,7 +153,7 @@ extension NewContactViewController: UIImagePickerControllerDelegate, UINavigatio
153153
#if swift(>=4.2)
154154
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
155155
if let pickedImage = info[UIImagePickerController.InfoKey.originalImage] as? UIImage {
156-
viewModel.image.value = pickedImage
156+
viewModel.image.accept(pickedImage)
157157
}
158158

159159
dismiss(animated: true, completion: nil)

0 commit comments

Comments
 (0)