Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
pikacode committed Nov 8, 2019
1 parent 4df7440 commit 3d030f6
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 14 deletions.
Binary file modified .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion EBBannerView.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
#

s.name = "EBBannerView"
s.version = "1.1.1"
s.version = "1.1.2"
s.summary = "展示跟iOS9~13推送一样的横幅/提示音/振动,或自定义view|Show a banner the same with iOS9/10/11/12 nofitication(sound/vibrate), or customize."

# This description is used to generate tags and improve search results.
Expand Down
7 changes: 6 additions & 1 deletion EBBannerView/Classes/EBBannerView.m
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ -(void)show{
self.frame = CGRectMake(self.fixedX, -self.standardHeight, self.fixedWidth, self.standardHeight);

CGFloat damping = _maker.style == 9 ? 1 : kAnimationDamping;

sharedWindow.hidden = NO;

[UIView animateWithDuration:_maker.showAnimationDuration delay:0 usingSpringWithDamping:damping initialSpringVelocity:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{

weakSelf.frame = CGRectMake(weakSelf.fixedX, weakSelf.fixedY, weakSelf.fixedWidth, weakSelf.standardHeight);
Expand Down Expand Up @@ -154,7 +157,9 @@ -(void)hide{

weakSelf.frame = CGRectMake(weakSelf.fixedX, -weakSelf.standardHeight - (weakSelf.frame.size.height - weakSelf.standardHeight), weakSelf.fixedWidth, weakSelf.frame.size.height);
} completion:^(BOOL finished) {

if (weakSelf.superview.subviews.count == 1) {
sharedWindow.hidden = YES;
}
[weakSelf removeFromSuperview];
}];
}
Expand Down
9 changes: 7 additions & 2 deletions EBBannerView/Classes/EBBannerWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@ @implementation EBBannerWindow
+(instancetype)sharedWindow{
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
if (@available(iOS 13.0, *)) {
sharedWindow = [[EBBannerWindow alloc] initWithWindowScene:UIApplication.sharedApplication.keyWindow.windowScene];
SEL sel = @selector(initWithWindowScene:);
if ([EBBannerWindow.new respondsToSelector:sel]) {
id obj = [UIApplication.sharedApplication.keyWindow valueForKey:@"windowScene"];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
sharedWindow = [[EBBannerWindow alloc] performSelector:sel withObject:obj];
#pragma clang diagnostic pop
} else {
// Fallback on earlier versions
sharedWindow = [[self alloc] initWithFrame:CGRectZero];
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion demo/Podfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
target 'demo' do
# pod 'EBBannerView', '1.1.1'
# pod 'EBBannerView', '1.1.2'
pod 'EBBannerView', :path => '../../EBBannerView'
end
6 changes: 3 additions & 3 deletions demo/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- EBBannerView (1.1.0)
- EBBannerView (1.1.2)

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

SPEC CHECKSUMS:
EBBannerView: 3d987535d0236c1f87c2b064267d94002c23dd1e
EBBannerView: 268002f8d9d3e979cb8649cbfefd0da5ddef72b3

PODFILE CHECKSUM: ca8ccef25743728fdcab283f2cc793ce586ee81e
PODFILE CHECKSUM: 90f7b9d231aa1e228ab4f7e64027378e898d42e8

COCOAPODS: 1.7.5
6 changes: 3 additions & 3 deletions demo/Pods/Local Podspecs/EBBannerView.podspec.json

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

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

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

Binary file not shown.

0 comments on commit 3d030f6

Please sign in to comment.