Skip to content

Commit

Permalink
Pushwoosh Inbox UI 5.16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins CI committed Jun 24, 2019
1 parent 83bac4b commit 7d649ca
Show file tree
Hide file tree
Showing 22 changed files with 368 additions and 48 deletions.
Binary file modified Framework/PushwooshInboxBundle.bundle/Info.plist
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Framework/PushwooshInboxBundle.bundle/PWIInboxViewController.nib
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@protocol PWInboxMessageProtocol;

@interface PWIInboxViewController : UIViewController

@property (nonatomic) void (^onMessageClickBlock)(id<PWInboxMessageProtocol> message);

/**
Reloads everything from scratch.
*/
Expand Down
Binary file not shown.
8 changes: 2 additions & 6 deletions PushwooshInboxUI.podspec
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
#
# Be sure to run `pod spec lint PushwooshInboxUI.podspec' to ensure this is a
#

Pod::Spec.new do |s|

s.name = "PushwooshInboxUI"
s.version = "5.8.7"
s.summary = "Pushwoosh Inbox UI library by Pushwoosh."
s.platform = :ios
s.ios.deployment_target = '8.0'

s.version = "5.16.0"
s.description = "Pushwoosh Inbox UI library by Pushwoosh. " \
"http://www.pushwoosh.com "

Expand All @@ -20,7 +16,7 @@ Pod::Spec.new do |s|

s.source = { :git => "https://github.com/Pushwoosh/pushwoosh-inbox-ui-ios-sdk.git", :tag => s.version }

s.dependency 'Pushwoosh', '> 5.5'
s.dependency 'Pushwoosh', '~> 5.16'
s.ios.vendored_frameworks = 'Framework/PushwooshInboxUI.framework'
s.resources = 'Framework/PushwooshInboxBundle.bundle'

Expand Down
28 changes: 24 additions & 4 deletions PushwooshInboxUI/PushwooshInboxUI.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@
/* End PBXAggregateTarget section */

/* Begin PBXBuildFile section */
2A708F9322C15C01002086B2 /* PWIInboxAttachmentViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9090D98E22A12ECD005853B9 /* PWIInboxAttachmentViewController.m */; };
2A708F9422C15C15002086B2 /* PWIInboxAttachmentViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9090D98F22A12ECD005853B9 /* PWIInboxAttachmentViewController.xib */; };
2A708F9522C15C16002086B2 /* PWIInboxAttachmentViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9090D98F22A12ECD005853B9 /* PWIInboxAttachmentViewController.xib */; };
2A708F9622C15C24002086B2 /* PWIInboxAttachmentViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 9090D98D22A12ECD005853B9 /* PWIInboxAttachmentViewController.h */; };
9090D99022A12ECD005853B9 /* PWIInboxAttachmentViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 9090D98D22A12ECD005853B9 /* PWIInboxAttachmentViewController.h */; };
9090D99122A12ECD005853B9 /* PWIInboxAttachmentViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9090D98E22A12ECD005853B9 /* PWIInboxAttachmentViewController.m */; };
9090D99222A12ECD005853B9 /* PWIInboxAttachmentViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9090D98F22A12ECD005853B9 /* PWIInboxAttachmentViewController.xib */; };
A42B59F11FBF12C80061E583 /* NSBundle+PWIHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = A42B59EF1FBF12C80061E583 /* NSBundle+PWIHelper.h */; };
A42B59F21FBF12C80061E583 /* NSBundle+PWIHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = A42B59EF1FBF12C80061E583 /* NSBundle+PWIHelper.h */; };
A42B59F31FBF12C80061E583 /* NSBundle+PWIHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = A42B59F01FBF12C80061E583 /* NSBundle+PWIHelper.m */; };
Expand Down Expand Up @@ -98,6 +105,9 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
9090D98D22A12ECD005853B9 /* PWIInboxAttachmentViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PWIInboxAttachmentViewController.h; sourceTree = "<group>"; };
9090D98E22A12ECD005853B9 /* PWIInboxAttachmentViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PWIInboxAttachmentViewController.m; sourceTree = "<group>"; };
9090D98F22A12ECD005853B9 /* PWIInboxAttachmentViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PWIInboxAttachmentViewController.xib; sourceTree = "<group>"; };
A42B59EF1FBF12C80061E583 /* NSBundle+PWIHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSBundle+PWIHelper.h"; sourceTree = "<group>"; };
A42B59F01FBF12C80061E583 /* NSBundle+PWIHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSBundle+PWIHelper.m"; sourceTree = "<group>"; };
A469F6191FBD85030062CBF5 /* PushwooshInboxBundle.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PushwooshInboxBundle.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -216,6 +226,9 @@
A4DB69CA1FA98FE9007210E6 /* PWIInboxViewController.h */,
A4DB69CB1FA98FE9007210E6 /* PWIInboxViewController.m */,
A4F321AE1FA9B74B00A8058E /* PWIInboxViewController.xib */,
9090D98D22A12ECD005853B9 /* PWIInboxAttachmentViewController.h */,
9090D98E22A12ECD005853B9 /* PWIInboxAttachmentViewController.m */,
9090D98F22A12ECD005853B9 /* PWIInboxAttachmentViewController.xib */,
);
path = ViewControllers;
sourceTree = "<group>";
Expand Down Expand Up @@ -285,6 +298,7 @@
A4DB69E71FA9AA50007210E6 /* UIImageView+PWILoadImage.h in Headers */,
A4DB69DF1FA9913F007210E6 /* PWIWeakRef.h in Headers */,
A4DB69C51FA98E67007210E6 /* PWIInboxUI.h in Headers */,
9090D99022A12ECD005853B9 /* PWIInboxAttachmentViewController.h in Headers */,
A4F321D21FAC07FC00A8058E /* UIImage+PWITintColor.h in Headers */,
A4DB69A61FA98A37007210E6 /* PushwooshInboxUI.h in Headers */,
A42B59F11FBF12C80061E583 /* NSBundle+PWIHelper.h in Headers */,
Expand All @@ -304,6 +318,7 @@
A4DCE5251FBB1768009CE923 /* PWIInboxMessageViewCell.h in Headers */,
A4DCE5261FBB176C009CE923 /* PWIInboxViewController.h in Headers */,
A4DCE5291FBB1783009CE923 /* PushwooshInboxUI.h in Headers */,
2A708F9622C15C24002086B2 /* PWIInboxAttachmentViewController.h in Headers */,
A4DCE5241FBB1764009CE923 /* UIImageView+PWILoadImage.h in Headers */,
A4DCE5201FBB1751009CE923 /* PWIWeakRef.h in Headers */,
A42B59F21FBF12C80061E583 /* NSBundle+PWIHelper.h in Headers */,
Expand Down Expand Up @@ -421,6 +436,7 @@
buildActionMask = 2147483647;
files = (
A469F5B91FBD749B0062CBF5 /* PWIInboxViewController.xib in Resources */,
2A708F9422C15C15002086B2 /* PWIInboxAttachmentViewController.xib in Resources */,
A469F5B81FBD74930062CBF5 /* PWIInboxMessageViewCell.xib in Resources */,
A469F5B51FBD743C0062CBF5 /* unread.png in Resources */,
A469F5B41FBD74390062CBF5 /* inbox_icon.png in Resources */,
Expand All @@ -434,6 +450,7 @@
buildActionMask = 2147483647;
files = (
A469F6241FBD85310062CBF5 /* PWIInboxViewController.xib in Resources */,
2A708F9522C15C16002086B2 /* PWIInboxAttachmentViewController.xib in Resources */,
A469F6201FBD851D0062CBF5 /* unread.png in Resources */,
A469F61F1FBD851A0062CBF5 /* inbox_icon.png in Resources */,
A469F6231FBD852D0062CBF5 /* PWIInboxMessageViewCell.xib in Resources */,
Expand All @@ -447,6 +464,7 @@
buildActionMask = 2147483647;
files = (
A46D6F4D1FB303EB003979C7 /* [email protected] in Resources */,
9090D99222A12ECD005853B9 /* PWIInboxAttachmentViewController.xib in Resources */,
A4F321D51FAC0C6800A8058E /* unread.png in Resources */,
A4F321D61FAC0C6B00A8058E /* inbox_icon.png in Resources */,
A4F321AF1FA9B74B00A8058E /* PWIInboxViewController.xib in Resources */,
Expand Down Expand Up @@ -491,6 +509,7 @@
A4DB69C21FA98DDA007210E6 /* PWIInboxStyle.m in Sources */,
A4DB69E01FA9913F007210E6 /* UITableViewCell+PWIHelper.m in Sources */,
A4DB69CE1FA98FE9007210E6 /* PWIInboxViewController.m in Sources */,
9090D99122A12ECD005853B9 /* PWIInboxAttachmentViewController.m in Sources */,
A4DB69DD1FA9913F007210E6 /* PWIWeakRef.m in Sources */,
A42B59F31FBF12C80061E583 /* NSBundle+PWIHelper.m in Sources */,
A4DB69C61FA98E67007210E6 /* PWIInboxUI.m in Sources */,
Expand All @@ -508,6 +527,7 @@
A4DCE5151FBAEA16009CE923 /* PWIInboxMessageViewCell.m in Sources */,
A4DCE5141FBAEA10009CE923 /* PWIInboxViewController.m in Sources */,
A4DCE5171FBAEA35009CE923 /* UIImage+PWITintColor.m in Sources */,
2A708F9322C15C01002086B2 /* PWIInboxAttachmentViewController.m in Sources */,
A4DCE5121FBAE9F4009CE923 /* PWIInboxUI.m in Sources */,
A42B59F41FBF12C80061E583 /* NSBundle+PWIHelper.m in Sources */,
A4DCE5191FBAEAC0009CE923 /* UITableViewCell+PWIHelper.m in Sources */,
Expand Down Expand Up @@ -615,7 +635,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 5.8.7;
CURRENT_PROJECT_VERSION = 5.8.5;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
Expand Down Expand Up @@ -675,7 +695,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 5.8.7;
CURRENT_PROJECT_VERSION = 5.8.5;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand Down Expand Up @@ -705,7 +725,7 @@
DEFINES_MODULE = YES;
DEPLOYMENT_POSTPROCESSING = NO;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 5.8.7;
DYLIB_CURRENT_VERSION = 5.8.5;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = PushwooshInboxUI/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
Expand All @@ -727,7 +747,7 @@
DEFINES_MODULE = YES;
DEPLOYMENT_POSTPROCESSING = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 5.8.7;
DYLIB_CURRENT_VERSION = 5.8.5;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = PushwooshInboxUI/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
Expand Down

This file was deleted.

4 changes: 2 additions & 2 deletions PushwooshInboxUI/PushwooshInboxUI/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>5.8.7</string>
<string>5.16.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<string>5.16.0</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
Expand Down
4 changes: 4 additions & 0 deletions PushwooshInboxUI/PushwooshInboxUI/Public/PWIInboxUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@protocol PWInboxMessageProtocol;

@interface PWIInboxViewController : UIViewController

@property (nonatomic) void (^onMessageClickBlock)(id<PWInboxMessageProtocol> message);

/**
Reloads everything from scratch.
*/
Expand Down
2 changes: 1 addition & 1 deletion PushwooshInboxUI/PushwooshInboxUI/Public/PWIInboxUI.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#import "PWIInboxStyle.h"
#import "PWIInboxViewController.h"

NSString * const PushwooshInboxUIVersion = @"5.8.7";
NSString * const PushwooshInboxUIVersion = @"5.8.5";

@implementation PWIInboxUI

Expand Down
2 changes: 2 additions & 0 deletions PushwooshInboxUI/PushwooshInboxUI/Utils/PWInbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ typedef NS_ENUM(NSInteger, PWInboxMessageType) {
@property (readonly, nonatomic) PWInboxMessageType type;
@property (readonly, nonatomic) BOOL isRead;
@property (readonly, nonatomic) BOOL isActionPerformed;
@property (readonly, nonatomic) NSString *attachmentUrl;
@property (readonly, nonatomic) NSDictionary *actionParams;

@end

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// PWIInboxAttachmentViewController.h
// PushwooshInboxUI
//
// Created by Nikolay Galizin on 31/05/2019.
// Copyright © 2019 Pushwoosh. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "PWIInboxStyle.h"

@interface PWIInboxAttachmentViewController : UIViewController<UIViewControllerTransitioningDelegate>

@property (nonatomic) UIImageView *animationBeginView;
@property (nonatomic) NSString *attachmentUrl;

- (instancetype)initWithStyle:(PWIInboxStyle *)style;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
//
// PWIInboxAttachmentViewController.m
// PushwooshInboxUI
//
// Created by Nikolay Galizin on 31/05/2019.
// Copyright © 2019 Pushwoosh. All rights reserved.
//
#import <UIKit/UIViewControllerTransitioning.h>
#import "PWIInboxAttachmentViewController.h"
#import "UIImageView+PWILoadImage.h"
#import "NSBundle+PWIHelper.h"
#import "PWIInboxStyle.h"

@interface PWIInboxAttachmentViewController () <UIViewControllerAnimatedTransitioning>

@property (weak, nonatomic) IBOutlet UIImageView *imageView;
@property (nonatomic) PWIInboxStyle *style;

@end

@implementation PWIInboxAttachmentViewController

- (instancetype)initWithStyle:(PWIInboxStyle *)style {
NSString *stringName = self.nibName;
if (self = [super initWithNibName:stringName bundle:[NSBundle pwi_bundleForClass:self.class]]) {
_style = style;
self.modalPresentationCapturesStatusBarAppearance = YES;
}
return self;
}

- (NSString *)nibName {
return @"PWIInboxAttachmentViewController";
}

- (void)loadView {
[[NSBundle pwi_bundleForClass:self.class] loadNibNamed:self.nibName owner:self options:nil];
if (!_style) {
_style = [PWIInboxStyle defaultStyle];
}
}

- (UIStatusBarStyle)preferredStatusBarStyle {
return [self respondsToSelector:NSSelectorFromString(@"isModalInPresentation")] ? 3 : UIStatusBarStyleDefault;
}

- (void)viewDidLoad {
[super viewDidLoad];
[_imageView pwi_loadImageFromUrl:_attachmentUrl callback:nil];
[self updateStyle:_style];
}

- (void)updateStyle:(PWIInboxStyle *)style {
_style = style;
self.view.tintColor = _style.accentColor;
self.view.backgroundColor = _style.backgroundColor;
}

- (IBAction)imageViewTapped:(id)sender {
[self dismissViewControllerAnimated:YES completion:nil];
}

- (nullable id <UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController* )presenting sourceController:(UIViewController *)source {
return self;
}

- (nullable id <UIViewControllerAnimatedTransitioning>)animationControllerForDismissedController:(UIViewController *)dismissed {
return self;
}

- (NSTimeInterval)transitionDuration:(nullable id <UIViewControllerContextTransitioning>)transitionContext {
return 0.4;
}

- (void)animateTransition:(id <UIViewControllerContextTransitioning>)transitionContext {
UIViewController *toController = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
UIViewController *fromController = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];

UIView *fromView = fromController.view;
UIView *toView = toController.view;
if ([toController isKindOfClass:[UINavigationController class]]) {
toController = ((UINavigationController *)toController).viewControllers.firstObject;
}

BOOL isPresenting = toController == self;

if (isPresenting) {
[transitionContext.containerView addSubview:toView];
}

self.view.frame = [transitionContext finalFrameForViewController:self];

UIView *beginAnimationView = [_animationBeginView snapshotViewAfterScreenUpdates:YES];
CGRect beginAnimationFrame = beginAnimationView.frame = [_animationBeginView convertRect:_animationBeginView.bounds toView:transitionContext.containerView];
CGRect imageFrame = [_imageView convertRect:_imageView.bounds toView:transitionContext.containerView];
CGFloat xScale = beginAnimationView.frame.size.width/_imageView.image.size.width;
CGFloat yScale = beginAnimationView.frame.size.height/_imageView.image.size.height;

CGFloat scale = 1;
if (xScale > yScale) {
scale = imageFrame.size.height / _imageView.image.size.height * _imageView.image.size.width / beginAnimationView.frame.size.width;
} else {
scale = imageFrame.size.width / _imageView.image.size.width * _imageView.image.size.height / beginAnimationView.frame.size.height;
}

if (isPresenting) {
self.view.alpha = 0;
[transitionContext.containerView addSubview:beginAnimationView];

_imageView.transform = CGAffineTransformMakeScale(1/scale, 1/scale);
_imageView.center = beginAnimationView.center;

_animationBeginView.hidden = YES;

[UIView animateWithDuration:0.4 delay:0. usingSpringWithDamping:45.71 initialSpringVelocity:0 options:0 animations:^{
beginAnimationView.center = CGPointMake(transitionContext.containerView.frame.size.width/2, transitionContext.containerView.frame.size.height/2);
beginAnimationView.transform = CGAffineTransformMakeScale(scale, scale);
self.view.alpha = 1;
beginAnimationView.alpha = 0;
_imageView.transform = CGAffineTransformIdentity;
_imageView.center = self.view.center;
} completion:^(BOOL finished) {
_animationBeginView.hidden = NO;
[transitionContext completeTransition:finished];
[beginAnimationView removeFromSuperview];
}];
} else {
UIView *endAnimationView = [_imageView snapshotViewAfterScreenUpdates:YES];
[transitionContext.containerView addSubview:endAnimationView];
_imageView.hidden = YES;
_animationBeginView.alpha = 0;

[UIView animateWithDuration:0.4 delay:0. usingSpringWithDamping:45.71 initialSpringVelocity:0 options:0 animations:^{
endAnimationView.transform = CGAffineTransformMakeScale(1/scale, 1/scale);
endAnimationView.center = CGPointMake(beginAnimationFrame.origin.x + beginAnimationFrame.size.width/2, beginAnimationFrame.origin.y + beginAnimationFrame.size.height/2);
endAnimationView.alpha = 0;
self.view.alpha = 0;
_animationBeginView.alpha = 1;
} completion:^(BOOL finished) {
[transitionContext completeTransition:finished];
[fromView removeFromSuperview];
}];
}
}

@end
Loading

0 comments on commit 7d649ca

Please sign in to comment.