Skip to content

Commit

Permalink
Merge pull request #3 from marty-suzuki/swift4
Browse files Browse the repository at this point in the history
support swift4
  • Loading branch information
marty-suzuki committed Sep 25, 2017
2 parents 048e93d + d8f93d9 commit 8c96373
Show file tree
Hide file tree
Showing 21 changed files with 248 additions and 156 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0
4.0
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# * http://www.objc.io/issue-6/travis-ci.html
# * https://github.com/supermarin/xcpretty#usage

osx_image: xcode7.3
osx_image: xcode9
language: objective-c
# cache: cocoapods
# podfile: Example/Podfile
Expand Down
2 changes: 1 addition & 1 deletion NoticeObserveKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'NoticeObserveKit'
s.version = '0.3.0'
s.version = '0.4.0'
s.summary = 'NoticeObserveKit is type-safe NotificationCenter wrapper that associates notice type with info type.'

# This description is used to generate tags and improve search results.
Expand Down
5 changes: 5 additions & 0 deletions NoticeObserveKit/NoticeObserveKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,15 @@ public struct NoticeObserver {
self.observer = observer
}

@available(*, deprecated: 0.11.0)
public func addObserverTo(_ pool: NoticeObserverPool) {
pool.adding(observer)
}

public func disposed(by pool: NoticeObserverPool) {
pool.adding(observer)
}

public func dispose() {
NotificationCenter.default.removeObserver(observer)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0820;
LastUpgradeCheck = 0820;
LastUpgradeCheck = 0900;
ORGANIZATIONNAME = "marty-suzuki";
TargetAttributes = {
ED94F24A1E12127300E36EDE = {
Expand Down Expand Up @@ -283,13 +283,16 @@
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-NoticeObserveKitSample-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
AEFD696D0706F46B03BD4BD7 /* [CP] Embed Pods Frameworks */ = {
Expand All @@ -298,9 +301,12 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-NoticeObserveKitSample/Pods-NoticeObserveKitSample-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/NoticeObserveKit/NoticeObserveKit.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/NoticeObserveKit.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand Down Expand Up @@ -389,15 +395,21 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -440,15 +452,21 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -484,7 +502,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "jp.marty-suzuki.NoticeObserveKitSample";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -498,7 +516,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "jp.marty-suzuki.NoticeObserveKitSample";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Release;
};
Expand All @@ -511,7 +529,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "jp.marty-suzuki.NoticeObserveKitSampleTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/NoticeObserveKitSample.app/NoticeObserveKitSample";
};
name = Debug;
Expand All @@ -525,7 +543,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "jp.marty-suzuki.NoticeObserveKitSampleTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/NoticeObserveKitSample.app/NoticeObserveKitSample";
};
name = Release;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class ViewController: UIViewController {
self.view.layoutIfNeeded()
}, completion: nil)
self.setText("UIKeyboard will show = \($0)")
}.addObserverTo(pool)
}.disposed(by: pool)

UIKeyboardWillHide.observe { [unowned self] in
self.view.layoutIfNeeded()
Expand All @@ -52,18 +52,18 @@ class ViewController: UIViewController {
self.view.layoutIfNeeded()
}, completion: nil)
self.setText("UIKeyboard will hide = \($0)")
}.addObserverTo(pool)
}.disposed(by: pool)

NavigationControllerDidShow.observe { [unowned self] in
self.setText("UINavigationController did show = \($0)")
}.addObserverTo(pool)
}.disposed(by: pool)

NavigationControllerWillShow.observe { [unowned self] in
if $0.viewController is NextViewController {
$0.viewController.title = "Dummy VC"
}
self.setText("UINavigationController will show = \($0)")
}.addObserverTo(pool)
}.disposed(by: pool)
}

@objc private func didTapCancelButton(_ sender: UIBarButtonItem) {
Expand Down
6 changes: 3 additions & 3 deletions NoticeObserveKitSample/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- NoticeObserveKit (0.1.0)
- NoticeObserveKit (0.4.0)

DEPENDENCIES:
- NoticeObserveKit (from `../`)
Expand All @@ -9,8 +9,8 @@ EXTERNAL SOURCES:
:path: ../

SPEC CHECKSUMS:
NoticeObserveKit: 63cae3bdae0e98fed55a5868cfd4c40cce2764d3
NoticeObserveKit: 4808ece7423737e0416a30914ea7a9a8813df75d

PODFILE CHECKSUM: dfc22d33353e73a20c66a6f310ab9f90fe1138a6

COCOAPODS: 1.1.1
COCOAPODS: 1.3.1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions NoticeObserveKitSample/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8c96373

Please sign in to comment.