Skip to content

Commit

Permalink
Merge pull request #57 from AkkeyLab/feature/update-rx-600
Browse files Browse the repository at this point in the history
🆕 Update RxSwift 6.0.0
  • Loading branch information
AkkeyLab authored Jan 6, 2021
2 parents e56cbce + 1988380 commit c482566
Show file tree
Hide file tree
Showing 11 changed files with 72 additions and 60 deletions.
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
language: swift
matrix:
include:
- osx_image: xcode11.4
- osx_image: xcode12.2

before_install:
# - echo "git \"file://$($(dirname $0); pwd)\"" >> Cartfile
- cat Cartfile
- brew update
- brew outdated swiftlint || brew upgrade swiftlint
- carthage update --platform iOS
# - carthage update --platform iOS
- ./carthage.sh update --platform iOS

script:
- xcodebuild -scheme RxScreenProtectKit -sdk iphonesimulator -destination 'platform=iOS Simulator,OS=13.4.1,name=iPhone 11 Pro' -configuration Debug test | xcpretty -c
- xcodebuild -scheme RxScreenProtectKit -sdk iphonesimulator -destination 'platform=iOS Simulator,OS=14.2,name=iPhone 12 Pro' -configuration Debug test | xcpretty -c
- swiftlint

after_success:
Expand Down
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "ReactiveX/RxSwift" ~> 5.0
github "ReactiveX/RxSwift" ~> 6.0
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "ReactiveX/RxSwift" "5.1.1"
github "ReactiveX/RxSwift" "6.0.0"
8 changes: 4 additions & 4 deletions RxScreenProtectKit.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'RxScreenProtectKit'
s.version = '0.2.14'
s.version = '0.3.0'
s.summary = 'Protect the screen from recording'

s.homepage = 'https://github.com/AkkeyLab/RxScreenProtectKit'
Expand All @@ -9,13 +9,13 @@ Pod::Spec.new do |s|
s.source = { :git => 'https://github.com/AkkeyLab/RxScreenProtectKit.git', :tag => "#{s.version}" }
s.social_media_url = 'https://twitter.com/AkkeyLab'

s.platform = :ios, "11.0"
s.platform = :ios, "12.0"
s.swift_version = "5.0"

s.module_name = "RxScreenProtectKit"

s.dependency 'RxSwift', '~> 5.0'
s.dependency 'RxCocoa', '~> 5.0'
s.dependency 'RxSwift', '~> 6.0'
s.dependency 'RxCocoa', '~> 6.0'

s.source_files = 'Source/**/*'
end
24 changes: 13 additions & 11 deletions RxScreenProtectKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1020;
LastUpgradeCheck = 1030;
LastUpgradeCheck = 1230;
ORGANIZATIONNAME = AKIO;
TargetAttributes = {
E5583BAF2265DC1F0081702C = {
Expand Down Expand Up @@ -526,6 +526,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand All @@ -552,7 +553,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -592,6 +593,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand All @@ -612,7 +614,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -643,13 +645,13 @@
);
INFOPLIST_FILE = SupportingFiles/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 0.2.14;
MARKETING_VERSION = 0.3.0;
PRODUCT_BUNDLE_IDENTIFIER = com.akkeylab.lib.RxScreenProtectKit;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -679,13 +681,13 @@
);
INFOPLIST_FILE = SupportingFiles/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 0.2.14;
MARKETING_VERSION = 0.3.0;
PRODUCT_BUNDLE_IDENTIFIER = com.akkeylab.lib.RxScreenProtectKit;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -742,7 +744,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
BUILD_LIBRARY_FOR_DISTRIBUTION = NO;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1.1.14.0;
CURRENT_PROJECT_VERSION = 1.2.0.0;
DEVELOPMENT_TEAM = Y6Y8U7YGDU;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -754,7 +756,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1.14;
MARKETING_VERSION = 1.2.0;
PRODUCT_BUNDLE_IDENTIFIER = com.akkeylab.lib.RxScreenProtectKitExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -769,7 +771,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
BUILD_LIBRARY_FOR_DISTRIBUTION = NO;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1.1.14.0;
CURRENT_PROJECT_VERSION = 1.2.0.0;
DEVELOPMENT_TEAM = Y6Y8U7YGDU;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -781,7 +783,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1.14;
MARKETING_VERSION = 1.2.0;
PRODUCT_BUNDLE_IDENTIFIER = com.akkeylab.lib.RxScreenProtectKitExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1030"
LastUpgradeVersion = "1230"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,8 +26,17 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
codeCoverageEnabled = "YES"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E5583BAF2265DC1F0081702C"
BuildableName = "RxScreenProtectKit.framework"
BlueprintName = "RxScreenProtectKit"
ReferencedContainer = "container:RxScreenProtectKit.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -40,17 +49,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E5583BAF2265DC1F0081702C"
BuildableName = "RxScreenProtectKit.framework"
BlueprintName = "RxScreenProtectKit"
ReferencedContainer = "container:RxScreenProtectKit.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -71,8 +69,6 @@
ReferencedContainer = "container:RxScreenProtectKit.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1030"
LastUpgradeVersion = "1230"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -27,8 +27,6 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
Expand All @@ -38,8 +36,8 @@
ReferencedContainer = "container:RxScreenProtectKit.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -61,8 +59,6 @@
ReferencedContainer = "container:RxScreenProtectKit.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
20 changes: 10 additions & 10 deletions Source/SPImageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,35 @@ public final class SPImageView: UIImageView {
private var load = PublishSubject<Void>()

override public var image: UIImage? {
get {
return super.image
}
set {
super.image = newValue
if newValue != nil {
load.onNext(())
}
}
get {
return super.image
}
}

override public var frame: CGRect {
get {
return super.frame
}
set {
super.frame = newValue
load.onNext(())
}
get {
return super.frame
}
}

override public var bounds: CGRect {
get {
return super.bounds
}
set {
super.bounds = newValue
load.onNext(())
}
get {
return super.bounds
}
}

override public func layoutSubviews() {
Expand All @@ -56,7 +56,7 @@ public final class SPImageView: UIImageView {
)
.merge()
.withLatestFrom(self.rx.isScreenRecord)
.takeUntil(self.rx.deallocated)
.take(until: self.rx.deallocated)
.bind(to: self.layer.rx.isMosaic)
return {}
}()
Expand Down
8 changes: 4 additions & 4 deletions Source/SPLabel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ public final class SPLabel: UILabel {
/// The current text that is displayed by the label.
/// Please note that when recording, a different string will be returned from the original string.
override public var text: String? {
get {
return super.text
}
set {
super.text = newValue
original = newValue
load.onNext(())
}
get {
return super.text
}
}

override public func layoutSubviews() {
Expand All @@ -44,7 +44,7 @@ public final class SPLabel: UILabel {
)
.merge()
.withLatestFrom(self.rx.isScreenRecord)
.takeUntil(self.rx.deallocated)
.take(until: self.rx.deallocated)
.subscribe(onNext: { [weak self] isScreenRecord in
guard let self = self else { return }
self.internalChanges(text: isScreenRecord ? self.protectText : self.original)
Expand Down
6 changes: 3 additions & 3 deletions Source/ScreenProtectKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ public final class ScreenProtectKit {
false will flow once from `isScreenRecord` regardless of whether screen recording is performed.
*/
public var isValid: Bool {
set {
_isValid.accept(newValue)
}
get {
return _isValid.value
}
set {
_isValid.accept(newValue)
}
}

/**
Expand Down
17 changes: 17 additions & 0 deletions carthage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

# carthage.sh
# Usage example: ./carthage.sh build --platform iOS

set -euo pipefail

xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
trap 'rm -f "$xcconfig"' INT TERM HUP EXIT

# For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise
# the build will fail on lipo due to duplicate architectures.
echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = arm64 arm64e armv7 armv7s armv6 armv8' >> $xcconfig
echo 'EXCLUDED_ARCHS = $(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT)__XCODE_$(XCODE_VERSION_MAJOR))' >> $xcconfig

export XCODE_XCCONFIG_FILE="$xcconfig"
carthage "$@"

0 comments on commit c482566

Please sign in to comment.