From 257fde121e28f6aa61acc702b86e77deeb300aef Mon Sep 17 00:00:00 2001 From: Calvin Sugianto Date: Tue, 29 Aug 2017 14:15:38 +0700 Subject: [PATCH 1/3] add target/source ViewController in STPopupControllerTransitioningContext object --- STPopup/STPopupController.h | 14 ++++++-------- STPopup/STPopupController.m | 4 ++++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/STPopup/STPopupController.h b/STPopup/STPopupController.h index e33d7dd..6abd906 100644 --- a/STPopup/STPopupController.h +++ b/STPopup/STPopupController.h @@ -28,6 +28,12 @@ typedef NS_ENUM(NSUInteger, STPopupControllerTransitioningAction) { */ @property (nonatomic, strong, readonly) UIView *containerView; +/** + Indicating the target/source View Controller. + */ +@property (nonatomic, strong) UIViewController *targetViewController; +@property (nonatomic, strong) UIViewController *sourceViewController; + @end @protocol STPopupControllerTransitioning @@ -174,14 +180,6 @@ typedef NS_ENUM(NSUInteger, STPopupTransitionStyle) { */ - (void)popViewControllerAnimated:(BOOL)animated; - -/** - Pops all view controllers from the stack until it reaches the root view controller - - @param animated YES if animated - */ -- (void)popToRootViewControllerAnimated:(BOOL)animated; - /** Set hidden status of navigation bar with animated flag. @see navigationBarHidden diff --git a/STPopup/STPopupController.m b/STPopup/STPopupController.m index e622163..9430686 100644 --- a/STPopup/STPopupController.m +++ b/STPopup/STPopupController.m @@ -825,6 +825,7 @@ - (void)animateTransition:(id )transitionC UIViewController *topViewController = self.topViewController; STPopupControllerTransitioningContext *context = [self convertTransitioningContext:transitionContext]; + id transitioning = nil; switch (self.transitionStyle) { case STPopupTransitionStyleSlideVertical: @@ -839,6 +840,9 @@ - (void)animateTransition:(id )transitionC } NSAssert(transitioning, @"transitioning should be provided if it's using STPopupTransitionStyleCustom"); + context.targetViewController = topViewController; + context.sourceViewController = fromViewController; + if (context.action == STPopupControllerTransitioningActionPresent) { [fromViewController beginAppearanceTransition:NO animated:YES]; From 0ab23db54b44f5746f4cee1fe329da81c5503eec Mon Sep 17 00:00:00 2001 From: Calvin Sugianto Date: Mon, 4 Sep 2017 15:54:18 +0700 Subject: [PATCH 2/3] revert deleted method: popToRootViewControllerAnimated --- STPopup/STPopupController.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/STPopup/STPopupController.h b/STPopup/STPopupController.h index 6abd906..4950dbd 100644 --- a/STPopup/STPopupController.h +++ b/STPopup/STPopupController.h @@ -180,6 +180,12 @@ typedef NS_ENUM(NSUInteger, STPopupTransitionStyle) { */ - (void)popViewControllerAnimated:(BOOL)animated; +/** + Pops all view controllers from the stack until it reaches the root view controller + @param animated YES if animated + */ +- (void)popToRootViewControllerAnimated:(BOOL)animated; + /** Set hidden status of navigation bar with animated flag. @see navigationBarHidden From 04a6df0d4af9c0e7bda8160bae7b98b2e43865c0 Mon Sep 17 00:00:00 2001 From: Calvin Sugianto Date: Fri, 6 Oct 2017 23:50:25 +0700 Subject: [PATCH 3/3] merge from upstream master --- .travis.yml | 2 +- STPopup.podspec | 2 +- STPopup.xcodeproj/project.pbxproj | 14 +++++++++++++- .../xcshareddata/xcschemes/STPopup.xcscheme | 4 +++- STPopup/Info.plist | 2 +- STPopup/STPopupController.m | 1 + .../STPopupExample.xcodeproj/project.pbxproj | 14 +++++++++++++- 7 files changed, 33 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 87e5267..3b6aa24 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ language: objective-c -osx_image: xcode8 +osx_image: xcode9 script: - xcodebuild -project STPopup.xcodeproj -scheme STPopup -sdk iphonesimulator diff --git a/STPopup.podspec b/STPopup.podspec index ad344d4..8d6c67a 100644 --- a/STPopup.podspec +++ b/STPopup.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "STPopup" - s.version = "1.8.2" + s.version = "1.8.3" s.summary = "STPopup provides STPopupController, which works just like UINavigationController in form sheet/bottom sheet style, for both iPhone and iPad." s.description = <<-DESC diff --git a/STPopup.xcodeproj/project.pbxproj b/STPopup.xcodeproj/project.pbxproj index c4bf460..0e782ce 100644 --- a/STPopup.xcodeproj/project.pbxproj +++ b/STPopup.xcodeproj/project.pbxproj @@ -139,7 +139,7 @@ 76D8222F1C1DB5E400FCF988 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0800; + LastUpgradeCheck = 0900; ORGANIZATIONNAME = Sth4Me; TargetAttributes = { 76D822371C1DB5E400FCF988 = { @@ -200,14 +200,20 @@ 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_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; @@ -249,14 +255,20 @@ 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_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; diff --git a/STPopup.xcodeproj/xcshareddata/xcschemes/STPopup.xcscheme b/STPopup.xcodeproj/xcshareddata/xcschemes/STPopup.xcscheme index ee8fee8..a3c3ed1 100644 --- a/STPopup.xcodeproj/xcshareddata/xcschemes/STPopup.xcscheme +++ b/STPopup.xcodeproj/xcshareddata/xcschemes/STPopup.xcscheme @@ -1,6 +1,6 @@ @@ -36,6 +37,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/STPopup/Info.plist b/STPopup/Info.plist index 61ecdb0..e1e85ac 100644 --- a/STPopup/Info.plist +++ b/STPopup/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.8.2 + 1.8.3 CFBundleSignature ???? CFBundleVersion diff --git a/STPopup/STPopupController.m b/STPopup/STPopupController.m index 9430686..acd00b5 100644 --- a/STPopup/STPopupController.m +++ b/STPopup/STPopupController.m @@ -429,6 +429,7 @@ - (void)updateNavigationBarAniamted:(BOOL)animated UIView *fromTitleView, *toTitleView; if (lastTitleView == _defaultTitleLabel) { UILabel *tempLabel = [[UILabel alloc] initWithFrame:_defaultTitleLabel.frame]; + tempLabel.center = _navigationBar.center; tempLabel.textColor = _defaultTitleLabel.textColor; tempLabel.font = _defaultTitleLabel.font; tempLabel.attributedText = [[NSAttributedString alloc] initWithString:_defaultTitleLabel.text ? : @"" diff --git a/STPopupExample/STPopupExample.xcodeproj/project.pbxproj b/STPopupExample/STPopupExample.xcodeproj/project.pbxproj index 77dea79..eb460e9 100644 --- a/STPopupExample/STPopupExample.xcodeproj/project.pbxproj +++ b/STPopupExample/STPopupExample.xcodeproj/project.pbxproj @@ -184,7 +184,7 @@ 76ACB5461BA2934D00A09710 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0800; + LastUpgradeCheck = 0900; ORGANIZATIONNAME = Sth4Me; TargetAttributes = { 76ACB54D1BA2934D00A09710 = { @@ -298,14 +298,20 @@ 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_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; @@ -345,14 +351,20 @@ 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_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;