├── .PKShortVideo.podspec.swp ├── LICENSE ├── PKShortVideo.podspec ├── PKShortVideo.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ ├── TYM01.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ │ ├── jiangxincai.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ │ └── pepsikirk.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ ├── TYM01.xcuserdatad │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ │ ├── PKShortVideo.xcscheme │ │ └── xcschememanagement.plist │ ├── jiangxincai.xcuserdatad │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ │ ├── PKShortVideo.xcscheme │ │ └── xcschememanagement.plist │ └── pepsikirk.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── PKShortVideo.xcscheme │ └── xcschememanagement.plist ├── PKShortVideo ├── Category │ ├── UIImage+PKShortVideoPlayer.h │ └── UIImage+PKShortVideoPlayer.m ├── GPUImage │ ├── GLProgram.h │ ├── GLProgram.m │ ├── GPUImageContext.h │ ├── GPUImageContext.m │ ├── GPUImageFramebuffer.h │ ├── GPUImageFramebuffer.m │ ├── GPUImageFramebufferCache.h │ └── GPUImageFramebufferCache.m ├── PKAsset │ ├── PK_Camera_Turn@2x.png │ ├── PK_Delete@2x.png │ └── PK_Play@2x.png ├── PKShortVideo.h ├── PKShortVideoPlayer │ ├── PKChatMessagePlayerView.h │ ├── PKChatMessagePlayerView.m │ ├── PKColorConversion.h │ ├── PKColorConversion.m │ ├── PKFullScreenPlayerView.h │ ├── PKFullScreenPlayerView.m │ ├── PKFullScreenPlayerViewController.h │ ├── PKFullScreenPlayerViewController.m │ ├── PKPlayerManager.h │ ├── PKPlayerManager.m │ ├── PKPlayerView.h │ ├── PKPlayerView.m │ ├── PKVideoDecoder.h │ └── PKVideoDecoder.m └── PKShortVideoWriter │ ├── PKRecordShortVideoViewController.h │ ├── PKRecordShortVideoViewController.m │ ├── PKShortVideoProgressBar.h │ ├── PKShortVideoProgressBar.m │ ├── PKShortVideoRecorder.h │ ├── PKShortVideoRecorder.m │ ├── PKShortVideoSession.h │ └── PKShortVideoSession.m ├── PKShortVideoDemo ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── DemoAvatars │ │ ├── demo_avatar_cook.imageset │ │ │ ├── Contents.json │ │ │ ├── demo_avatar_cook.png │ │ │ ├── demo_avatar_cook@2x.png │ │ │ └── demo_avatar_cook@3x.png │ │ ├── demo_avatar_jobs.imageset │ │ │ ├── Contents.json │ │ │ ├── demo_avatar_jobs.png │ │ │ ├── demo_avatar_jobs@2x.png │ │ │ └── demo_avatar_jobs@3x.png │ │ └── demo_avatar_woz.imageset │ │ │ ├── Contents.json │ │ │ ├── demo_avatar_woz.png │ │ │ ├── demo_avatar_woz@2x.png │ │ │ └── demo_avatar_woz@3x.png │ └── goldengate.imageset │ │ ├── Contents.json │ │ ├── goldengate.png │ │ ├── goldengate@2x.png │ │ └── goldengate@3x.png ├── Base.lproj │ └── LaunchScreen.storyboard ├── Info.plist ├── Main.storyboard ├── PKDemoModelData.h ├── PKDemoModelData.m ├── PKMessageViewController.h ├── PKMessageViewController.m ├── PKMessageViewController2.h ├── PKMessageViewController2.m ├── PKRootViewController.h ├── PKRootViewController.m ├── PKShortVideoItem.h ├── PKShortVideoItem.m ├── PKShortVideoItem2.h ├── PKShortVideoItem2.m ├── jsq_messages_sample.m4a └── main.m ├── PKShortVideoTests ├── Info.plist └── PKShortVideoTests.m ├── PKShortVideoUITests ├── Info.plist └── PKShortVideoUITests.m ├── README.md ├── Screenshots ├── gif.gif └── png.png └── Vendor ├── JSQMessagesViewController ├── Assets │ └── JSQMessagesAssets.bundle │ │ ├── Base.lproj │ │ └── JSQMessages.strings │ │ ├── Images │ │ ├── bubble_min.png │ │ ├── bubble_min@2x.png │ │ ├── bubble_min@3x.png │ │ ├── bubble_min_tailless.png │ │ ├── bubble_min_tailless@2x.png │ │ ├── bubble_min_tailless@3x.png │ │ ├── bubble_regular.png │ │ ├── bubble_regular@2x.png │ │ ├── bubble_regular@3x.png │ │ ├── bubble_stroked.png │ │ ├── bubble_stroked@2x.png │ │ ├── bubble_stroked@3x.png │ │ ├── bubble_stroked_tailless.png │ │ ├── bubble_stroked_tailless@2x.png │ │ ├── bubble_stroked_tailless@3x.png │ │ ├── bubble_tailless.png │ │ ├── bubble_tailless@2x.png │ │ ├── bubble_tailless@3x.png │ │ ├── clip.png │ │ ├── clip@2x.png │ │ ├── clip@3x.png │ │ ├── pause.png │ │ ├── pause@2x.png │ │ ├── pause@3x.png │ │ ├── play.png │ │ ├── play@2x.png │ │ ├── play@3x.png │ │ ├── typing.png │ │ ├── typing@2x.png │ │ └── typing@3x.png │ │ ├── Sounds │ │ ├── message_received.aiff │ │ └── message_sent.aiff │ │ ├── ar.lproj │ │ └── JSQMessages.strings │ │ ├── de.lproj │ │ └── JSQMessages.strings │ │ ├── en.lproj │ │ └── JSQMessages.strings │ │ ├── es.lproj │ │ └── JSQMessages.strings │ │ ├── fi.lproj │ │ └── JSQMessages.strings │ │ ├── fr.lproj │ │ └── JSQMessages.strings │ │ ├── he.lproj │ │ └── JSQMessages.strings │ │ ├── id.lproj │ │ └── JSQMessages.strings │ │ ├── it.lproj │ │ └── JSQMessages.strings │ │ ├── ja.lproj │ │ └── JSQMessages.strings │ │ ├── ko.lproj │ │ └── JSQMessages.strings │ │ ├── ms.lproj │ │ └── JSQMessages.strings │ │ ├── nb.lproj │ │ └── JSQMessages.strings │ │ ├── nl.lproj │ │ └── JSQMessages.strings │ │ ├── pl.lproj │ │ └── JSQMessages.strings │ │ ├── pt.lproj │ │ └── JSQMessages.strings │ │ ├── ro.lproj │ │ └── JSQMessages.strings │ │ ├── ru.lproj │ │ └── JSQMessages.strings │ │ ├── th.lproj │ │ └── JSQMessages.strings │ │ ├── tr.lproj │ │ └── JSQMessages.strings │ │ ├── vi.lproj │ │ └── JSQMessages.strings │ │ ├── zh-Hans.lproj │ │ └── JSQMessages.strings │ │ └── zh-Hant.lproj │ │ └── JSQMessages.strings ├── Categories │ ├── JSQSystemSoundPlayer+JSQMessages.h │ ├── JSQSystemSoundPlayer+JSQMessages.m │ ├── NSBundle+JSQMessages.h │ ├── NSBundle+JSQMessages.m │ ├── NSString+JSQMessages.h │ ├── NSString+JSQMessages.m │ ├── UIColor+JSQMessages.h │ ├── UIColor+JSQMessages.m │ ├── UIDevice+JSQMessages.h │ ├── UIDevice+JSQMessages.m │ ├── UIImage+JSQMessages.h │ ├── UIImage+JSQMessages.m │ ├── UIView+JSQMessages.h │ └── UIView+JSQMessages.m ├── Controllers │ ├── JSQMessagesKeyboardController.h │ ├── JSQMessagesKeyboardController.m │ ├── JSQMessagesViewController.h │ ├── JSQMessagesViewController.m │ └── JSQMessagesViewController.xib ├── Factories │ ├── JSQMessagesAvatarImageFactory.h │ ├── JSQMessagesAvatarImageFactory.m │ ├── JSQMessagesBubbleImageFactory.h │ ├── JSQMessagesBubbleImageFactory.m │ ├── JSQMessagesMediaViewBubbleImageMasker.h │ ├── JSQMessagesMediaViewBubbleImageMasker.m │ ├── JSQMessagesTimestampFormatter.h │ ├── JSQMessagesTimestampFormatter.m │ ├── JSQMessagesToolbarButtonFactory.h │ └── JSQMessagesToolbarButtonFactory.m ├── JSQMessages.h ├── Layout │ ├── JSQAudioMediaViewAttributes.h │ ├── JSQAudioMediaViewAttributes.m │ ├── JSQMessagesBubbleSizeCalculating.h │ ├── JSQMessagesBubblesSizeCalculator.h │ ├── JSQMessagesBubblesSizeCalculator.m │ ├── JSQMessagesCollectionViewFlowLayout.h │ ├── JSQMessagesCollectionViewFlowLayout.m │ ├── JSQMessagesCollectionViewFlowLayoutInvalidationContext.h │ ├── JSQMessagesCollectionViewFlowLayoutInvalidationContext.m │ ├── JSQMessagesCollectionViewLayoutAttributes.h │ └── JSQMessagesCollectionViewLayoutAttributes.m ├── Model │ ├── JSQAudioMediaItem.h │ ├── JSQAudioMediaItem.m │ ├── JSQLocationMediaItem.h │ ├── JSQLocationMediaItem.m │ ├── JSQMediaItem.h │ ├── JSQMediaItem.m │ ├── JSQMessage.h │ ├── JSQMessage.m │ ├── JSQMessageAvatarImageDataSource.h │ ├── JSQMessageBubbleImageDataSource.h │ ├── JSQMessageData.h │ ├── JSQMessageMediaData.h │ ├── JSQMessagesAvatarImage.h │ ├── JSQMessagesAvatarImage.m │ ├── JSQMessagesBubbleImage.h │ ├── JSQMessagesBubbleImage.m │ ├── JSQMessagesCollectionViewDataSource.h │ ├── JSQMessagesCollectionViewDelegateFlowLayout.h │ ├── JSQPhotoMediaItem.h │ ├── JSQPhotoMediaItem.m │ ├── JSQVideoMediaItem.h │ └── JSQVideoMediaItem.m └── Views │ ├── JSQMessagesCellTextView.h │ ├── JSQMessagesCellTextView.m │ ├── JSQMessagesCollectionView.h │ ├── JSQMessagesCollectionView.m │ ├── JSQMessagesCollectionViewCell.h │ ├── JSQMessagesCollectionViewCell.m │ ├── JSQMessagesCollectionViewCellIncoming.h │ ├── JSQMessagesCollectionViewCellIncoming.m │ ├── JSQMessagesCollectionViewCellIncoming.xib │ ├── JSQMessagesCollectionViewCellOutgoing.h │ ├── JSQMessagesCollectionViewCellOutgoing.m │ ├── JSQMessagesCollectionViewCellOutgoing.xib │ ├── JSQMessagesComposerTextView.h │ ├── JSQMessagesComposerTextView.m │ ├── JSQMessagesInputToolbar.h │ ├── JSQMessagesInputToolbar.m │ ├── JSQMessagesLabel.h │ ├── JSQMessagesLabel.m │ ├── JSQMessagesLoadEarlierHeaderView.h │ ├── JSQMessagesLoadEarlierHeaderView.m │ ├── JSQMessagesLoadEarlierHeaderView.xib │ ├── JSQMessagesMediaPlaceholderView.h │ ├── JSQMessagesMediaPlaceholderView.m │ ├── JSQMessagesToolbarContentView.h │ ├── JSQMessagesToolbarContentView.m │ ├── JSQMessagesToolbarContentView.xib │ ├── JSQMessagesTypingIndicatorFooterView.h │ ├── JSQMessagesTypingIndicatorFooterView.m │ └── JSQMessagesTypingIndicatorFooterView.xib └── JSQSystemSoundPlayer └── JSQSystemSoundPlayer └── Classes ├── JSQSystemSoundPlayer.h └── JSQSystemSoundPlayer.m /.PKShortVideo.podspec.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/.PKShortVideo.podspec.swp -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | MIT License 3 | Copyright (c) 2016-present Xincai Jiang 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | associated documentation files (the "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 15 | LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 18 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | -------------------------------------------------------------------------------- /PKShortVideo.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "PKShortVideo" 3 | s.version = “0.9.4” 4 | s.license = "MIT" 5 | s.summary = "A video library like WeChat short video for iOS." 6 | s.homepage = "https://github.com/pepsikirk/PKShortVideo" 7 | s.social_media_url = "http://weibo.com/u/1776530813" 8 | s.author = { "pepsikirk" => "pepsikirk@gmail.com" } 9 | s.source = { :git => "https://github.com/pepsikirk/PKShortVideo.git", :tag => s.version } 10 | s.screenshots = "https://raw.githubusercontent.com/pepsikirk/PKShortVideo/master/Screenshots/gif.gif" 11 | s.platform = :ios, "7.0" 12 | s.resources = "PKShortVideo/PKAsset/*.png" 13 | s.frameworks = "AVFoundation", "CoreMedia", "OpenGLES", "QuartzCore" 14 | s.requires_arc = true 15 | 16 | s.source_files = 'PKShortVideo/**/*.{h,m}' , 'PKShortVideo/*.{h,m}' 17 | 18 | end 19 | -------------------------------------------------------------------------------- /PKShortVideo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /PKShortVideo.xcodeproj/project.xcworkspace/xcuserdata/TYM01.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/PKShortVideo.xcodeproj/project.xcworkspace/xcuserdata/TYM01.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /PKShortVideo.xcodeproj/project.xcworkspace/xcuserdata/jiangxincai.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/PKShortVideo.xcodeproj/project.xcworkspace/xcuserdata/jiangxincai.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /PKShortVideo.xcodeproj/project.xcworkspace/xcuserdata/pepsikirk.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/PKShortVideo.xcodeproj/project.xcworkspace/xcuserdata/pepsikirk.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /PKShortVideo.xcodeproj/xcuserdata/TYM01.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 20 | 21 | 22 | 24 | 36 | 37 | 38 | 40 | 52 | 53 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /PKShortVideo.xcodeproj/xcuserdata/TYM01.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | PKShortVideo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | AEDD7D421C34329100977BD0 16 | 17 | primary 18 | 19 | 20 | AEDD7D5B1C34329100977BD0 21 | 22 | primary 23 | 24 | 25 | AEDD7D661C34329100977BD0 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /PKShortVideo.xcodeproj/xcuserdata/jiangxincai.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 14 | 15 | 16 | 18 | 30 | 31 | 32 | 34 | 46 | 47 | 48 | 50 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /PKShortVideo.xcodeproj/xcuserdata/jiangxincai.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | PKShortVideo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | AEDD7D421C34329100977BD0 16 | 17 | primary 18 | 19 | 20 | AEDD7D5B1C34329100977BD0 21 | 22 | primary 23 | 24 | 25 | AEDD7D661C34329100977BD0 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /PKShortVideo.xcodeproj/xcuserdata/pepsikirk.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /PKShortVideo.xcodeproj/xcuserdata/pepsikirk.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | PKShortVideo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | AEDD7D421C34329100977BD0 16 | 17 | primary 18 | 19 | 20 | AEDD7D5B1C34329100977BD0 21 | 22 | primary 23 | 24 | 25 | AEDD7D661C34329100977BD0 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /PKShortVideo/Category/UIImage+PKShortVideoPlayer.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+PKShortVideoPlayer.h 3 | // DevelopPlayerDemo 4 | // 5 | // Created by jiangxincai on 16/1/4. 6 | // Copyright © 2016年 pepsikirk. All rights reserved. 7 | // 8 | 9 | #import 10 | @class AVAsset; 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface UIImage (PKShortVideoPlayer) 15 | 16 | + (UIImage *)pk_previewImageWithVideoURL:(NSURL *)videoURL; 17 | 18 | @end 19 | 20 | NS_ASSUME_NONNULL_END -------------------------------------------------------------------------------- /PKShortVideo/Category/UIImage+PKShortVideoPlayer.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+PKShortVideoPlayer.m 3 | // DevelopPlayerDemo 4 | // 5 | // Created by jiangxincai on 16/1/4. 6 | // Copyright © 2016年 pepsikirk. All rights reserved. 7 | // 8 | 9 | #import "UIImage+PKShortVideoPlayer.h" 10 | @import AVFoundation; 11 | 12 | @implementation UIImage (PKShortVideoPlayer) 13 | 14 | + (UIImage *)pk_previewImageWithVideoURL:(NSURL *)videoURL { 15 | AVAsset *asset = [AVAsset assetWithURL:videoURL]; 16 | 17 | AVAssetImageGenerator *generator = [AVAssetImageGenerator assetImageGeneratorWithAsset:asset]; 18 | generator.appliesPreferredTrackTransform = YES; 19 | 20 | CGImageRef img = [generator copyCGImageAtTime:CMTimeMake(1, asset.duration.timescale) actualTime:NULL error:nil]; 21 | UIImage *image = [UIImage imageWithCGImage:img]; 22 | 23 | CGImageRelease(img); 24 | return image; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /PKShortVideo/GPUImage/GLProgram.h: -------------------------------------------------------------------------------- 1 | // This is Jeff LaMarche's GLProgram OpenGL shader wrapper class from his OpenGL ES 2.0 book. 2 | // A description of this can be found at his page on the topic: 3 | // http://iphonedevelopment.blogspot.com/2010/11/opengl-es-20-for-ios-chapter-4.html 4 | // I've extended this to be able to take programs as NSStrings in addition to files, for baked-in shaders 5 | 6 | #import 7 | 8 | #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE 9 | #import 10 | #import 11 | #else 12 | #import 13 | #import 14 | #endif 15 | 16 | @interface GLProgram : NSObject 17 | { 18 | NSMutableArray *attributes; 19 | NSMutableArray *uniforms; 20 | GLuint program, 21 | vertShader, 22 | fragShader; 23 | } 24 | 25 | @property(readwrite, nonatomic) BOOL initialized; 26 | @property(readwrite, copy, nonatomic) NSString *vertexShaderLog; 27 | @property(readwrite, copy, nonatomic) NSString *fragmentShaderLog; 28 | @property(readwrite, copy, nonatomic) NSString *programLog; 29 | 30 | - (id)initWithVertexShaderString:(NSString *)vShaderString 31 | fragmentShaderString:(NSString *)fShaderString; 32 | - (id)initWithVertexShaderString:(NSString *)vShaderString 33 | fragmentShaderFilename:(NSString *)fShaderFilename; 34 | - (id)initWithVertexShaderFilename:(NSString *)vShaderFilename 35 | fragmentShaderFilename:(NSString *)fShaderFilename; 36 | - (void)addAttribute:(NSString *)attributeName; 37 | - (GLuint)attributeIndex:(NSString *)attributeName; 38 | - (GLuint)uniformIndex:(NSString *)uniformName; 39 | - (BOOL)link; 40 | - (void)use; 41 | - (void)validate; 42 | @end 43 | -------------------------------------------------------------------------------- /PKShortVideo/GPUImage/GPUImageContext.h: -------------------------------------------------------------------------------- 1 | #import "GLProgram.h" 2 | #import "GPUImageFramebuffer.h" 3 | #import "GPUImageFramebufferCache.h" 4 | 5 | void runSynchronouslyOnVideoProcessingQueue(void (^block)(void)); 6 | void runAsynchronouslyOnVideoProcessingQueue(void (^block)(void)); 7 | 8 | #define GPUImageRotationSwapsWidthAndHeight(rotation) ((rotation) == kGPUImageRotateLeft || (rotation) == kGPUImageRotateRight || (rotation) == kGPUImageRotateRightFlipVertical || (rotation) == kGPUImageRotateRightFlipHorizontal) 9 | 10 | typedef enum { kGPUImageNoRotation, kGPUImageRotateLeft, kGPUImageRotateRight, kGPUImageFlipVertical, kGPUImageFlipHorizonal, kGPUImageRotateRightFlipVertical, kGPUImageRotateRightFlipHorizontal, kGPUImageRotate180 } GPUImageRotationMode; 11 | 12 | @interface GPUImageContext : NSObject 13 | 14 | @property(readonly, nonatomic) dispatch_queue_t contextQueue; 15 | @property(readwrite, retain, nonatomic) GLProgram *currentShaderProgram; 16 | @property(readonly, retain, nonatomic) EAGLContext *context; 17 | @property(readonly) CVOpenGLESTextureCacheRef coreVideoTextureCache; 18 | @property(readonly) GPUImageFramebufferCache *framebufferCache; 19 | 20 | + (void *)contextKey; 21 | + (GPUImageContext *)sharedImageProcessingContext; 22 | + (dispatch_queue_t)sharedContextQueue; 23 | + (GPUImageFramebufferCache *)sharedFramebufferCache; 24 | + (void)useImageProcessingContext; 25 | - (void)useAsCurrentContext; 26 | + (void)setActiveShaderProgram:(GLProgram *)shaderProgram; 27 | - (void)setContextShaderProgram:(GLProgram *)shaderProgram; 28 | + (GLint)maximumTextureSizeForThisDevice; 29 | + (GLint)maximumTextureUnitsForThisDevice; 30 | + (GLint)maximumVaryingVectorsForThisDevice; 31 | + (BOOL)deviceSupportsOpenGLESExtension:(NSString *)extension; 32 | + (BOOL)deviceSupportsRedTextures; 33 | + (BOOL)deviceSupportsFramebufferReads; 34 | + (CGSize)sizeThatFitsWithinATextureForSize:(CGSize)inputSize; 35 | 36 | - (void)presentBufferForDisplay; 37 | - (GLProgram *)programForVertexShaderString:(NSString *)vertexShaderString fragmentShaderString:(NSString *)fragmentShaderString; 38 | 39 | - (void)useSharegroup:(EAGLSharegroup *)sharegroup; 40 | 41 | // Manage fast texture upload 42 | + (BOOL)supportsFastTextureUpload; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /PKShortVideo/GPUImage/GPUImageFramebuffer.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE 4 | #import 5 | #import 6 | #import 7 | #else 8 | #import 9 | #import 10 | #endif 11 | 12 | #import 13 | #import 14 | 15 | 16 | typedef struct GPUTextureOptions { 17 | GLenum minFilter; 18 | GLenum magFilter; 19 | GLenum wrapS; 20 | GLenum wrapT; 21 | GLenum internalFormat; 22 | GLenum format; 23 | GLenum type; 24 | } GPUTextureOptions; 25 | 26 | @interface GPUImageFramebuffer : NSObject 27 | 28 | @property(readonly) CGSize size; 29 | @property(readonly) GPUTextureOptions textureOptions; 30 | @property(readonly) GLuint texture; 31 | @property(readonly) BOOL missingFramebuffer; 32 | 33 | // Initialization and teardown 34 | - (id)initWithSize:(CGSize)framebufferSize; 35 | - (id)initWithSize:(CGSize)framebufferSize textureOptions:(GPUTextureOptions)fboTextureOptions onlyTexture:(BOOL)onlyGenerateTexture; 36 | - (id)initWithSize:(CGSize)framebufferSize overriddenTexture:(GLuint)inputTexture; 37 | 38 | // Usage 39 | - (void)activateFramebuffer; 40 | 41 | // Reference counting 42 | - (void)lock; 43 | - (void)unlock; 44 | - (void)clearAllLocks; 45 | - (void)disableReferenceCounting; 46 | - (void)enableReferenceCounting; 47 | 48 | // Image capture 49 | - (CGImageRef)newCGImageFromFramebufferContents; 50 | - (void)restoreRenderTarget; 51 | 52 | // Raw data bytes 53 | - (void)lockForReading; 54 | - (void)unlockAfterReading; 55 | - (NSUInteger)bytesPerRow; 56 | - (GLubyte *)byteBuffer; 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /PKShortVideo/GPUImage/GPUImageFramebufferCache.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "GPUImageFramebuffer.h" 4 | 5 | @interface GPUImageFramebufferCache : NSObject 6 | 7 | // Framebuffer management 8 | - (GPUImageFramebuffer *)fetchFramebufferForSize:(CGSize)framebufferSize textureOptions:(GPUTextureOptions)textureOptions onlyTexture:(BOOL)onlyTexture; 9 | - (GPUImageFramebuffer *)fetchFramebufferForSize:(CGSize)framebufferSize onlyTexture:(BOOL)onlyTexture; 10 | - (void)returnFramebufferToCache:(GPUImageFramebuffer *)framebuffer; 11 | - (void)purgeAllUnassignedFramebuffers; 12 | - (void)addFramebufferToActiveImageCaptureList:(GPUImageFramebuffer *)framebuffer; 13 | - (void)removeFramebufferFromActiveImageCaptureList:(GPUImageFramebuffer *)framebuffer; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /PKShortVideo/PKAsset/PK_Camera_Turn@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/PKShortVideo/PKAsset/PK_Camera_Turn@2x.png -------------------------------------------------------------------------------- /PKShortVideo/PKAsset/PK_Delete@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/PKShortVideo/PKAsset/PK_Delete@2x.png -------------------------------------------------------------------------------- /PKShortVideo/PKAsset/PK_Play@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/PKShortVideo/PKAsset/PK_Play@2x.png -------------------------------------------------------------------------------- /PKShortVideo/PKShortVideo.h: -------------------------------------------------------------------------------- 1 | // 2 | // PKShortVideo.h 3 | // PKShortVideo 4 | // 5 | // Created by pepsikirk on 16/9/11. 6 | // Copyright © 2016年 pepsikirk. All rights reserved. 7 | // 8 | 9 | //PKShortVideoPlayer 10 | #import "PKChatMessagePlayerView.h" 11 | #import "PKVideoDecoder.h" 12 | #import "PKFullScreenPlayerView.h" 13 | #import "PKFullScreenPlayerViewController.h" 14 | #import "PKPlayerManager.h" 15 | #import "PKPlayerManager.h" 16 | 17 | //PKShortVideoWriter 18 | #import "PKShortVideoProgressBar.h" 19 | #import "PKShortVideoRecorder.h" 20 | #import "PKShortVideoSession.h" 21 | #import "PKRecordShortVideoViewController.h" 22 | 23 | #import "UIImage+PKShortVideoPlayer.h" -------------------------------------------------------------------------------- /PKShortVideo/PKShortVideoPlayer/PKChatMessagePlayerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // PKChatMessagePlayerView.h 3 | // DevelopPlayerDemo 4 | // 5 | // Created by jiangxincai on 16/1/11. 6 | // Copyright © 2016年 pepsikirk. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface PKChatMessagePlayerView : UIView 14 | 15 | @property (readonly, nonatomic) CGSize sizeInPixels; 16 | 17 | - (instancetype)initWithFrame:(CGRect)frame videoPath:(NSString *)videoPath previewImage:(UIImage *)previewImage; 18 | 19 | - (void)play; 20 | - (void)stop; 21 | 22 | @end 23 | 24 | NS_ASSUME_NONNULL_END 25 | -------------------------------------------------------------------------------- /PKShortVideo/PKShortVideoPlayer/PKColorConversion.h: -------------------------------------------------------------------------------- 1 | // 2 | // PKColorConversion.h 3 | // DevelopPlayerDemo 4 | // 5 | // Created by jiangxincai on 16/1/11. 6 | // Copyright © 2016年 pepsikirk. All rights reserved. 7 | // 8 | 9 | #ifndef PKColorConversion_h 10 | #define PKColorConversion_h 11 | 12 | #import "GPUImageContext.h" 13 | 14 | extern GLfloat *kColorConversion601; 15 | extern GLfloat *kColorConversion601FullRange; 16 | extern GLfloat *kColorConversion709; 17 | extern NSString *const kGPUImageVertexShaderString; 18 | extern NSString *const kGPUImageYUVFullRangeConversionForLAFragmentShaderString; 19 | extern NSString *const kGPUImagePassthroughFragmentShaderString; 20 | 21 | #endif /* PKColorConversion_h */ 22 | -------------------------------------------------------------------------------- /PKShortVideo/PKShortVideoPlayer/PKColorConversion.m: -------------------------------------------------------------------------------- 1 | // 2 | // PKColorConversion.m 3 | // DevelopPlayerDemo 4 | // 5 | // Created by jiangxincai on 16/1/11. 6 | // Copyright © 2016年 pepsikirk. All rights reserved. 7 | // 8 | 9 | #import "PKColorConversion.h" 10 | 11 | GLfloat kColorConversion601Default[] = { 12 | 1.164, 1.164, 1.164, 13 | 0.0, -0.392, 2.017, 14 | 1.596, -0.813, 0.0, 15 | }; 16 | 17 | GLfloat kColorConversion709Default[] = { 18 | 1.164, 1.164, 1.164, 19 | 0.0, -0.213, 2.112, 20 | 1.793, -0.533, 0.0, 21 | }; 22 | 23 | GLfloat kColorConversion601FullRangeDefault[] = { 24 | 1.0, 1.0, 1.0, 25 | 0.0, -0.343, 1.765, 26 | 1.4, -0.711, 0.0, 27 | }; 28 | 29 | 30 | GLfloat *kColorConversion601 = kColorConversion601Default; 31 | GLfloat *kColorConversion601FullRange = kColorConversion601FullRangeDefault; 32 | GLfloat *kColorConversion709 = kColorConversion709Default; 33 | 34 | #define STRINGIZE(x) #x 35 | #define STRINGIZE2(x) STRINGIZE(x) 36 | #define SHADER_STRING(text) @ STRINGIZE2(text) 37 | 38 | NSString *const kGPUImageVertexShaderString = SHADER_STRING 39 | ( 40 | attribute vec4 position; 41 | attribute vec4 inputTextureCoordinate; 42 | 43 | varying vec2 textureCoordinate; 44 | 45 | void main() 46 | { 47 | gl_Position = position; 48 | textureCoordinate = inputTextureCoordinate.xy; 49 | } 50 | ); 51 | 52 | NSString *const kGPUImageYUVFullRangeConversionForLAFragmentShaderString = SHADER_STRING 53 | ( 54 | varying highp vec2 textureCoordinate; 55 | 56 | uniform sampler2D luminanceTexture; 57 | uniform sampler2D chrominanceTexture; 58 | uniform mediump mat3 colorConversionMatrix; 59 | 60 | void main() 61 | { 62 | mediump vec3 yuv; 63 | lowp vec3 rgb; 64 | 65 | yuv.x = texture2D(luminanceTexture, textureCoordinate).r; 66 | yuv.yz = texture2D(chrominanceTexture, textureCoordinate).ra - vec2(0.5, 0.5); 67 | rgb = colorConversionMatrix * yuv; 68 | 69 | gl_FragColor = vec4(rgb, 1); 70 | } 71 | ); 72 | 73 | NSString *const kGPUImagePassthroughFragmentShaderString = SHADER_STRING 74 | ( 75 | varying highp vec2 textureCoordinate; 76 | 77 | uniform sampler2D inputImageTexture; 78 | 79 | void main() 80 | { 81 | gl_FragColor = texture2D(inputImageTexture, textureCoordinate); 82 | } 83 | ); 84 | 85 | -------------------------------------------------------------------------------- /PKShortVideo/PKShortVideoPlayer/PKFullScreenPlayerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // PKFullScreenPlayerView.h 3 | // DevelopPlayerDemo 4 | // 5 | // Created by jiangxincai on 16/1/4. 6 | // Copyright © 2016年 pepsikirk. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface PKFullScreenPlayerView : UIView 14 | 15 | - (instancetype)initWithFrame:(CGRect)frame videoPath:(NSString *)videoPath previewImage:(UIImage *)previewImage; 16 | 17 | - (void)play; 18 | 19 | - (void)pause; 20 | 21 | @end 22 | 23 | NS_ASSUME_NONNULL_END 24 | 25 | -------------------------------------------------------------------------------- /PKShortVideo/PKShortVideoPlayer/PKFullScreenPlayerViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PKFullScreenPlayerViewController.h 3 | // DevelopPlayerDemo 4 | // 5 | // Created by jiangxincai on 16/1/4. 6 | // Copyright © 2016年 pepsikirk. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface PKFullScreenPlayerViewController : UIViewController 14 | 15 | - (instancetype)initWithVideoPath:(NSString *)videoPath previewImage:(UIImage *)previewImage; 16 | 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /PKShortVideo/PKShortVideoPlayer/PKFullScreenPlayerViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // PKFullScreenPlayerViewController.m 3 | // DevelopPlayerDemo 4 | // 5 | // Created by jiangxincai on 16/1/4. 6 | // Copyright © 2016年 pepsikirk. All rights reserved. 7 | // 8 | 9 | #import "PKFullScreenPlayerViewController.h" 10 | #import "PKFullScreenPlayerView.h" 11 | #import 12 | 13 | @interface PKFullScreenPlayerViewController () 14 | 15 | @property (nonatomic, strong) PKFullScreenPlayerView *playerView; 16 | 17 | @property (nonatomic, strong) NSString *videoPath; 18 | @property (nonatomic, strong) UIImage *image; 19 | 20 | @end 21 | 22 | @implementation PKFullScreenPlayerViewController 23 | 24 | #pragma mark - Initialization 25 | 26 | - (instancetype)initWithVideoPath:(NSString *)videoPath previewImage:(UIImage *)previewImage { 27 | NSParameterAssert(videoPath != nil); 28 | NSParameterAssert(previewImage != nil); 29 | 30 | self = [super init]; 31 | if (self) { 32 | _videoPath = videoPath; 33 | _image = previewImage; 34 | } 35 | return self; 36 | } 37 | 38 | - (void)dealloc { 39 | [_playerView pause]; 40 | } 41 | 42 | 43 | 44 | #pragma mark - View Lifecycle 45 | 46 | - (void)viewDidLoad { 47 | [super viewDidLoad]; 48 | 49 | //静音模式也有声音 50 | if (![[AVAudioSession sharedInstance].category isEqualToString:AVAudioSessionCategoryPlayback]) { 51 | [[AVAudioSession sharedInstance] setCategory :AVAudioSessionCategoryPlayback error:nil]; 52 | } 53 | 54 | self.view.backgroundColor = [UIColor blackColor]; 55 | 56 | CGSize viewSize = self.view.bounds.size; 57 | CGSize imageSize = self.image.size; 58 | 59 | self.playerView = [[PKFullScreenPlayerView alloc] initWithFrame:CGRectMake(0, 0, viewSize.width, viewSize.width* (imageSize.height/imageSize.width) ) videoPath:self.videoPath previewImage:self.image]; 60 | self.playerView.center = self.view.center; 61 | 62 | [self.view addSubview:self.playerView]; 63 | 64 | UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapGestureRecognizer:)]; 65 | [self.view addGestureRecognizer:tap]; 66 | } 67 | 68 | - (void)viewWillAppear:(BOOL)animated { 69 | [super viewWillAppear:animated]; 70 | 71 | [self.navigationController setNavigationBarHidden:YES animated:YES]; 72 | } 73 | 74 | - (void)viewWillDisappear:(BOOL)animated { 75 | [super viewWillDisappear:animated]; 76 | 77 | [self.navigationController setNavigationBarHidden:NO animated:YES]; 78 | } 79 | 80 | - (BOOL)prefersStatusBarHidden { 81 | return YES; 82 | } 83 | 84 | - (void)didReceiveMemoryWarning { 85 | [super didReceiveMemoryWarning]; 86 | } 87 | 88 | 89 | 90 | #pragma mark - Tap GestureRecognizer 91 | 92 | - (void)tapGestureRecognizer:(UITapGestureRecognizer *)tap { 93 | [self.playerView pause]; 94 | 95 | CATransition *animation = [CATransition animation]; 96 | [animation setDuration:0.25]; 97 | [animation setType: kCATransitionFade]; 98 | 99 | [animation setSubtype: kCATransitionFromLeft]; 100 | [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]]; 101 | 102 | [self.navigationController.view.layer addAnimation:animation forKey:nil]; 103 | 104 | if (self.navigationController) { 105 | [self.navigationController popViewControllerAnimated:NO]; 106 | } else { 107 | [self dismissViewControllerAnimated:NO completion:NULL]; 108 | } 109 | } 110 | 111 | @end 112 | -------------------------------------------------------------------------------- /PKShortVideo/PKShortVideoPlayer/PKPlayerManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // PKPlayerManager.h 3 | // PKShortVideo 4 | // 5 | // Created by jiangxincai on 16/9/26. 6 | // Copyright © 2016年 pepsikirk. All rights reserved. 7 | // 8 | 9 | #import 10 | @class AVPlayer; 11 | @class AVPlayerItem; 12 | 13 | @interface PKPlayerManager : NSObject 14 | 15 | /** 16 | * 播放器最大数量,默认8个,不建议少于6个,会导致显示问题 17 | */ 18 | @property (assign, nonatomic) NSUInteger playerMaxCount; 19 | 20 | + (instancetype)sharedManager; 21 | 22 | /** 23 | * 获取 AVPlayer 对象 24 | * 25 | * @param item PlayerItem 26 | * @param uniqueID 唯一ID 27 | * 28 | * @return 返回 player 对象 29 | */ 30 | - (AVPlayer *)getAVQueuePlayWithPlayerItem:(AVPlayerItem *)item uniqueID:(NSString *)uniqueID; 31 | 32 | /** 33 | * 播放之前要创建 Player 对象,默认创建8个复用 34 | */ 35 | - (void)creatMessagePlayer; 36 | 37 | /** 38 | * 一般来说退出聊天页面可以释放缓存的 AVPlayer 对象减少内存消耗 39 | */ 40 | - (void)removeAllPlayer; 41 | 42 | /** 43 | * 移除 Player 对象通过唯一ID 44 | * 45 | * @param uniqueID <#uniqueID description#> 46 | */ 47 | - (void)removePlayerWithuniqueID:(NSString *)uniqueID; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /PKShortVideo/PKShortVideoPlayer/PKPlayerManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // PKPlayerManager.m 3 | // PKShortVideo 4 | // 5 | // Created by jiangxincai on 16/9/26. 6 | // Copyright © 2016年 pepsikirk. All rights reserved. 7 | // 8 | 9 | #import "PKPlayerManager.h" 10 | @import AVFoundation; 11 | 12 | @interface PKPlayerManager () 13 | 14 | /** 15 | * AVPlayer 对象缓存快速取出字典 16 | */ 17 | @property (strong, nonatomic) NSMutableDictionary *playerDict; 18 | 19 | /** 20 | * AVPlayer 对象缓存排序数组 21 | */ 22 | @property (strong, nonatomic) NSMutableArray *playerArray; 23 | 24 | /** 25 | * AVPlayer 排序顺序 26 | */ 27 | @property (assign, nonatomic) NSInteger playerIndex; 28 | 29 | @end 30 | 31 | @implementation PKPlayerManager 32 | 33 | + (instancetype)sharedManager { 34 | static PKPlayerManager* module; 35 | static dispatch_once_t onceToken; 36 | dispatch_once(&onceToken, ^{ 37 | module = [[PKPlayerManager alloc] init]; 38 | }); 39 | return module; 40 | } 41 | 42 | - (instancetype)init { 43 | self = [super init]; 44 | if (self) { 45 | _playerDict = [NSMutableDictionary new]; 46 | _playerArray = [NSMutableArray new]; 47 | 48 | _playerMaxCount = 8; 49 | } 50 | return self; 51 | } 52 | 53 | - (AVPlayer *)getAVQueuePlayWithPlayerItem:(AVPlayerItem *)item uniqueID:(NSString *)uniqueID { 54 | //通过uniqueID取Player对象 55 | AVPlayer *player = self.playerDict[uniqueID]; 56 | if (player) { 57 | //对象不等时替换player对象的item 58 | if (player.currentItem != item) { 59 | [player replaceCurrentItemWithPlayerItem:item]; 60 | } 61 | return player; 62 | } else { 63 | //未在界面创建小视频时返回nil 64 | if (!self.playerArray.count) { 65 | return nil; 66 | } 67 | if (self.playerArray.count <= self.playerIndex) { 68 | self.playerIndex = 0; 69 | } 70 | //按顺序平均分配player数组里面的player 71 | AVPlayer *player = self.playerArray[self.playerIndex]; 72 | if (self.playerIndex == self.playerMaxCount - 1) { 73 | self.playerIndex = 0; 74 | } else { 75 | self.playerIndex = self.playerIndex + 1; 76 | } 77 | [player replaceCurrentItemWithPlayerItem:item]; 78 | //缓存play可以快速获取对应的player 79 | [self.playerDict setObject:player forKey:uniqueID]; 80 | 81 | return player; 82 | } 83 | } 84 | 85 | - (void)creatMessagePlayer { 86 | if (self.playerArray.count > 0) { 87 | return; 88 | } 89 | dispatch_async(dispatch_get_global_queue(0, 0), ^{ 90 | for (NSInteger i = 0; i < self.playerMaxCount ; i++) { 91 | AVPlayer *player = [AVPlayer new]; 92 | player.volume = 0; 93 | [self.playerArray addObject:player]; 94 | } 95 | }); 96 | } 97 | 98 | - (void)removeAllPlayer { 99 | [self.playerDict removeAllObjects]; 100 | for (AVPlayer *player in self.playerArray) { 101 | [PKPlayerManager removePlayer:player]; 102 | } 103 | [self.playerArray removeAllObjects]; 104 | } 105 | 106 | - (void)removePlayerWithuniqueID:(NSString *)uniqueID { 107 | AVPlayer *player = self.playerDict[uniqueID]; 108 | if (player) { 109 | [PKPlayerManager removePlayer:player]; 110 | [self.playerArray removeObject:player]; 111 | } 112 | } 113 | 114 | + (void)removePlayer:(AVPlayer *)player { 115 | [player pause]; 116 | [player.currentItem cancelPendingSeeks]; 117 | [player.currentItem.asset cancelLoading]; 118 | [player replaceCurrentItemWithPlayerItem:nil]; 119 | } 120 | 121 | 122 | @end 123 | -------------------------------------------------------------------------------- /PKShortVideo/PKShortVideoPlayer/PKPlayerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // PKPlayerView.h 3 | // PKShortVideo 4 | // 5 | // Created by jiangxincai on 16/9/26. 6 | // Copyright © 2016年 pepsikirk. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface PKPlayerView : UIView 14 | 15 | @property (assign, nonatomic ,readonly) BOOL isPlayable; 16 | @property (nonatomic ,assign ,readonly) BOOL isPlaying; 17 | 18 | - (instancetype)initWithFrame:(CGRect)frame videoPath:(NSString *)videoPath previewImage:(UIImage *)previewImage; 19 | 20 | - (void)play; 21 | - (void)stop; 22 | 23 | @end 24 | 25 | NS_ASSUME_NONNULL_END 26 | -------------------------------------------------------------------------------- /PKShortVideo/PKShortVideoPlayer/PKVideoDecoder.h: -------------------------------------------------------------------------------- 1 | // 2 | // PKVideoDecoder.h 3 | // DevelopPlayerDemo 4 | // 5 | // Created by jiangxincai on 16/1/11. 6 | // Copyright © 2016年 pepsikirk. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @class GPUImageFramebuffer; 13 | 14 | NS_ASSUME_NONNULL_BEGIN 15 | 16 | @protocol PKVideoDecoderDelegate 17 | 18 | - (void)didCompletePlayingMovie; 19 | 20 | - (void)didDecodeInputFramebuffer:(GPUImageFramebuffer *)newInputFramebuffer inputSize:(CGSize)newSize frameTime:(CMTime)frameTime; 21 | 22 | @end 23 | 24 | @interface PKVideoDecoder : NSObject 25 | 26 | @property (nonatomic, strong) AVAsset *asset; 27 | @property (nonatomic, strong) NSString *videoPath; 28 | @property (nonatomic, strong, readonly) AVAssetReader *assetReader; 29 | @property (nonatomic, assign, readonly) CGFloat progress; 30 | 31 | @property (nonatomic, assign) BOOL keepLooping; 32 | 33 | @property (nonatomic, weak) id delegate; 34 | 35 | - (instancetype)initWithVideoPath:(NSString *)videoPath size:(CGSize)size; 36 | 37 | - (void)startProcessing; 38 | - (void)endProcessing; 39 | - (void)cancelProcessing; 40 | 41 | @end 42 | 43 | NS_ASSUME_NONNULL_END 44 | 45 | -------------------------------------------------------------------------------- /PKShortVideo/PKShortVideoWriter/PKRecordShortVideoViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PKShortVideoViewController.h 3 | // DevelopWriterDemo 4 | // 5 | // Created by jiangxincai on 16/1/14. 6 | // Copyright © 2016年 pepsikirk. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol PKRecordShortVideoDelegate 12 | 13 | - (void)didFinishRecordingToOutputFilePath:(NSString *)outputFilePath; 14 | 15 | @end 16 | 17 | @interface PKRecordShortVideoViewController : UIViewController 18 | 19 | @property (nonatomic, assign) NSTimeInterval videoMaximumDuration; 20 | @property (nonatomic, assign) NSTimeInterval videoMinimumDuration; 21 | @property (nonatomic, weak) id delegate; 22 | 23 | - (instancetype)initWithOutputFilePath:(NSString *)outputFilePath outputSize:(CGSize)outputSize themeColor:(UIColor *)themeColor; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /PKShortVideo/PKShortVideoWriter/PKShortVideoProgressBar.h: -------------------------------------------------------------------------------- 1 | // 2 | // PKShortVideoProgressBar.h 3 | // DevelopWriterDemo 4 | // 5 | // Created by jiangxincai on 16/1/15. 6 | // Copyright © 2016年 pepsikirk. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface PKShortVideoProgressBar : UIView 14 | 15 | - (instancetype)initWithFrame:(CGRect)frame themeColor:(UIColor *)themeColor duration:(NSTimeInterval)duration; 16 | - (void)play; 17 | - (void)stop; 18 | - (void)restore; 19 | 20 | @end 21 | 22 | NS_ASSUME_NONNULL_END 23 | -------------------------------------------------------------------------------- /PKShortVideo/PKShortVideoWriter/PKShortVideoProgressBar.m: -------------------------------------------------------------------------------- 1 | // 2 | // PKShortVideoProgressBar.m 3 | // DevelopWriterDemo 4 | // 5 | // Created by jiangxincai on 16/1/15. 6 | // Copyright © 2016年 pepsikirk. All rights reserved. 7 | // 8 | 9 | #import "PKShortVideoProgressBar.h" 10 | 11 | static NSInteger const PKProgressItemWidth = 5; 12 | 13 | @interface PKShortVideoProgressBar () 14 | 15 | @property (nonatomic, assign) NSTimeInterval duration; 16 | 17 | @property (nonatomic, strong) UIColor *themeColor; 18 | 19 | @property (strong, nonatomic) UIView *progressItem; 20 | @property (strong, nonatomic) UIView *progressingView; 21 | @property (nonatomic, strong) UIView *coverView; 22 | 23 | @property (nonatomic, assign) CFTimeInterval beginTime; 24 | 25 | @end 26 | 27 | @implementation PKShortVideoProgressBar 28 | 29 | #pragma mark - Public 30 | 31 | - (instancetype)initWithFrame:(CGRect)frame themeColor:(UIColor *)themeColor duration:(NSTimeInterval)duration { 32 | self = [super initWithFrame:frame]; 33 | if (self) { 34 | _themeColor = themeColor; 35 | _duration = duration; 36 | 37 | _coverView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.height)]; 38 | _coverView.backgroundColor = [UIColor blackColor]; 39 | _coverView.alpha = 0.4f; 40 | [self addSubview:_coverView]; 41 | 42 | _progressItem = [[UIView alloc] initWithFrame:CGRectMake(0, 0, PKProgressItemWidth, frame.size.height)]; 43 | _progressItem.backgroundColor = [UIColor whiteColor]; 44 | [self addSubview:_progressItem]; 45 | 46 | _progressingView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, frame.size.height)]; 47 | _progressingView.backgroundColor = themeColor; 48 | [self addSubview:_progressingView]; 49 | } 50 | return self; 51 | } 52 | 53 | - (void)play { 54 | [UIView animateWithDuration:self.duration delay:0 options:UIViewAnimationOptionCurveLinear animations:^{ 55 | self.progressItem.frame = CGRectMake(self.bounds.size.width - PKProgressItemWidth, 0, PKProgressItemWidth, self.bounds.size.height); 56 | self.progressingView.frame = CGRectMake(0, 0, self.bounds.size.width - PKProgressItemWidth, self.bounds.size.height); 57 | self.beginTime = CACurrentMediaTime(); 58 | } completion:NULL]; 59 | } 60 | 61 | - (void)stop { 62 | [self.progressItem.layer removeAllAnimations]; 63 | [self.progressingView.layer removeAllAnimations]; 64 | 65 | CGFloat temp = (CACurrentMediaTime() - self.beginTime)/self.duration; 66 | CGFloat progress = temp + 0.018*(1 - temp); 67 | self.progressItem.frame = CGRectMake(self.bounds.size.width*(progress) - PKProgressItemWidth, 0, PKProgressItemWidth, self.bounds.size.height); 68 | self.progressingView.frame = CGRectMake(0, 0, self.bounds.size.width*(progress) - PKProgressItemWidth, self.bounds.size.height); 69 | } 70 | 71 | - (void)restore { 72 | [self.progressItem.layer removeAllAnimations]; 73 | [self.progressingView.layer removeAllAnimations]; 74 | 75 | self.progressItem.frame = CGRectMake(0, 0, PKProgressItemWidth, self.bounds.size.height); 76 | self.progressingView.frame = CGRectMake(0, 0, 0, self.bounds.size.height); 77 | } 78 | 79 | 80 | @end 81 | -------------------------------------------------------------------------------- /PKShortVideo/PKShortVideoWriter/PKShortVideoRecorder.h: -------------------------------------------------------------------------------- 1 | // 2 | // PKShortVideoWriter.h 3 | // DevelopWriterDemo 4 | // 5 | // Created by jiangxincai on 16/1/14. 6 | // Copyright © 2016年 pepsikirk. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @class PKShortVideoRecorder; 15 | 16 | @protocol PKShortVideoRecorderDelegate 17 | 18 | @required 19 | 20 | - (void)recorderDidBeginRecording:(PKShortVideoRecorder *)recorder; 21 | - (void)recorderDidEndRecording:(PKShortVideoRecorder *)recorder; 22 | - (void)recorder:(PKShortVideoRecorder *)recorder didFinishRecordingToOutputFilePath:(nullable NSString *)outputFilePath error:(nullable NSError *)error; 23 | 24 | @end 25 | 26 | 27 | 28 | @class AVCaptureVideoPreviewLayer; 29 | 30 | @interface PKShortVideoRecorder : NSObject 31 | 32 | @property (nonatomic, weak) id delegate; 33 | 34 | - (instancetype)initWithOutputFilePath:(NSString *)outputFilePath outputSize:(CGSize)outputSize; 35 | 36 | - (void)startRunning; 37 | - (void)stopRunning; 38 | 39 | - (void)startRecording; 40 | - (void)stopRecording; 41 | 42 | - (void)swapFrontAndBackCameras; 43 | 44 | - (AVCaptureVideoPreviewLayer *)previewLayer; 45 | 46 | @end 47 | 48 | NS_ASSUME_NONNULL_END 49 | 50 | 51 | -------------------------------------------------------------------------------- /PKShortVideo/PKShortVideoWriter/PKShortVideoSession.h: -------------------------------------------------------------------------------- 1 | // 2 | // PKAssetWriter.h 3 | // DevelopWriterDemo 4 | // 5 | // Created by jiangxincai on 16/1/17. 6 | // Copyright © 2016年 pepsikirk. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @protocol PKShortVideoSessionDelegate; 16 | 17 | @interface PKShortVideoSession : NSObject 18 | 19 | @property (nonatomic, readonly) BOOL videoInitialized; 20 | @property (nonatomic, readonly) BOOL audioInitialized; 21 | 22 | @property (nonatomic, weak) id delegate; 23 | 24 | - (instancetype)initWithTempFilePath:(NSString *)tempFilePath; 25 | 26 | - (void)addVideoTrackWithSourceFormatDescription:(CMFormatDescriptionRef)formatDescription settings:(NSDictionary *)videoSettings; 27 | - (void)addAudioTrackWithSourceFormatDescription:(CMFormatDescriptionRef)formatDescription settings:(NSDictionary *)audioSettings; 28 | 29 | - (void)appendVideoSampleBuffer:(CMSampleBufferRef)sampleBuffer; 30 | - (void)appendAudioSampleBuffer:(CMSampleBufferRef)sampleBuffer; 31 | 32 | - (void)prepareToRecord; 33 | - (void)finishRecording; 34 | 35 | @end 36 | 37 | 38 | @protocol PKShortVideoSessionDelegate 39 | 40 | - (void)sessionDidFinishPreparing:(PKShortVideoSession *)session; 41 | - (void)session:(PKShortVideoSession *)session didFailWithError:(NSError *)error; 42 | - (void)sessionDidFinishRecording:(PKShortVideoSession *)session; 43 | 44 | @end 45 | 46 | NS_ASSUME_NONNULL_END 47 | 48 | 49 | -------------------------------------------------------------------------------- /PKShortVideoDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // PKShortVideo 4 | // 5 | // Created by pepsikirk on 15/12/30. 6 | // Copyright © 2015年 pepsikirk. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /PKShortVideoDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // PKShortVideo 4 | // 5 | // Created by pepsikirk on 15/12/30. 6 | // Copyright © 2015年 pepsikirk. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /PKShortVideoDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /PKShortVideoDemo/Assets.xcassets/DemoAvatars/demo_avatar_cook.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "demo_avatar_cook.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "demo_avatar_cook@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x", 16 | "filename" : "demo_avatar_cook@3x.png" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /PKShortVideoDemo/Assets.xcassets/DemoAvatars/demo_avatar_cook.imageset/demo_avatar_cook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/PKShortVideoDemo/Assets.xcassets/DemoAvatars/demo_avatar_cook.imageset/demo_avatar_cook.png -------------------------------------------------------------------------------- /PKShortVideoDemo/Assets.xcassets/DemoAvatars/demo_avatar_cook.imageset/demo_avatar_cook@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/PKShortVideoDemo/Assets.xcassets/DemoAvatars/demo_avatar_cook.imageset/demo_avatar_cook@2x.png -------------------------------------------------------------------------------- /PKShortVideoDemo/Assets.xcassets/DemoAvatars/demo_avatar_cook.imageset/demo_avatar_cook@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/PKShortVideoDemo/Assets.xcassets/DemoAvatars/demo_avatar_cook.imageset/demo_avatar_cook@3x.png -------------------------------------------------------------------------------- /PKShortVideoDemo/Assets.xcassets/DemoAvatars/demo_avatar_jobs.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "demo_avatar_jobs.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "demo_avatar_jobs@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x", 16 | "filename" : "demo_avatar_jobs@3x.png" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /PKShortVideoDemo/Assets.xcassets/DemoAvatars/demo_avatar_jobs.imageset/demo_avatar_jobs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/PKShortVideoDemo/Assets.xcassets/DemoAvatars/demo_avatar_jobs.imageset/demo_avatar_jobs.png -------------------------------------------------------------------------------- /PKShortVideoDemo/Assets.xcassets/DemoAvatars/demo_avatar_jobs.imageset/demo_avatar_jobs@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/PKShortVideoDemo/Assets.xcassets/DemoAvatars/demo_avatar_jobs.imageset/demo_avatar_jobs@2x.png -------------------------------------------------------------------------------- /PKShortVideoDemo/Assets.xcassets/DemoAvatars/demo_avatar_jobs.imageset/demo_avatar_jobs@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/PKShortVideoDemo/Assets.xcassets/DemoAvatars/demo_avatar_jobs.imageset/demo_avatar_jobs@3x.png -------------------------------------------------------------------------------- /PKShortVideoDemo/Assets.xcassets/DemoAvatars/demo_avatar_woz.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "demo_avatar_woz.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "demo_avatar_woz@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x", 16 | "filename" : "demo_avatar_woz@3x.png" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /PKShortVideoDemo/Assets.xcassets/DemoAvatars/demo_avatar_woz.imageset/demo_avatar_woz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/PKShortVideoDemo/Assets.xcassets/DemoAvatars/demo_avatar_woz.imageset/demo_avatar_woz.png -------------------------------------------------------------------------------- /PKShortVideoDemo/Assets.xcassets/DemoAvatars/demo_avatar_woz.imageset/demo_avatar_woz@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/PKShortVideoDemo/Assets.xcassets/DemoAvatars/demo_avatar_woz.imageset/demo_avatar_woz@2x.png -------------------------------------------------------------------------------- /PKShortVideoDemo/Assets.xcassets/DemoAvatars/demo_avatar_woz.imageset/demo_avatar_woz@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/PKShortVideoDemo/Assets.xcassets/DemoAvatars/demo_avatar_woz.imageset/demo_avatar_woz@3x.png -------------------------------------------------------------------------------- /PKShortVideoDemo/Assets.xcassets/goldengate.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "goldengate.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "goldengate@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x", 16 | "filename" : "goldengate@3x.png" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /PKShortVideoDemo/Assets.xcassets/goldengate.imageset/goldengate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/PKShortVideoDemo/Assets.xcassets/goldengate.imageset/goldengate.png -------------------------------------------------------------------------------- /PKShortVideoDemo/Assets.xcassets/goldengate.imageset/goldengate@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/PKShortVideoDemo/Assets.xcassets/goldengate.imageset/goldengate@2x.png -------------------------------------------------------------------------------- /PKShortVideoDemo/Assets.xcassets/goldengate.imageset/goldengate@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/PKShortVideoDemo/Assets.xcassets/goldengate.imageset/goldengate@3x.png -------------------------------------------------------------------------------- /PKShortVideoDemo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /PKShortVideoDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 0.9.4 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | NSCameraUsageDescription 34 | Need shoot 35 | NSPhotoLibraryUsageDescription 36 | Need photo 37 | NSMicrophoneUsageDescription 38 | Need microphone 39 | UISupportedInterfaceOrientations 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationLandscapeRight 43 | UIInterfaceOrientationLandscapeLeft 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /PKShortVideoDemo/PKDemoModelData.h: -------------------------------------------------------------------------------- 1 | // 2 | // PKDemoModelData.h 3 | // PKShortVideo 4 | // 5 | // Created by jiangxincai on 16/6/4. 6 | // Copyright © 2016年 pepsikirk. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JSQMessages.h" 11 | 12 | /** 13 | * This is for demo/testing purposes only. 14 | * This object sets up some fake model data. 15 | * Do not actually do anything like this. 16 | */ 17 | static NSString * const kJSQDemoAvatarDisplayNameSquires = @"Jesse Squires"; 18 | static NSString * const kJSQDemoAvatarDisplayNameCook = @"Tim Cook"; 19 | static NSString * const kJSQDemoAvatarDisplayNameJobs = @"Jobs"; 20 | static NSString * const kJSQDemoAvatarDisplayNameWoz = @"Steve Wozniak"; 21 | 22 | static NSString * const kJSQDemoAvatarIdSquires = @"053496-4509-289"; 23 | static NSString * const kJSQDemoAvatarIdCook = @"468-768355-23123"; 24 | static NSString * const kJSQDemoAvatarIdJobs = @"707-8956784-57"; 25 | static NSString * const kJSQDemoAvatarIdWoz = @"309-41802-93823"; 26 | 27 | typedef NS_ENUM(NSUInteger, PKPlayType) { 28 | PKPlayTypeOpenGL, 29 | PKPlayTypeAVPlayer, 30 | }; 31 | 32 | 33 | @interface PKDemoModelData : NSObject 34 | 35 | @property (strong, nonatomic) NSMutableArray *messages; 36 | 37 | @property (strong, nonatomic) NSDictionary *avatars; 38 | 39 | @property (strong, nonatomic) JSQMessagesBubbleImage *outgoingBubbleImageData; 40 | 41 | @property (strong, nonatomic) JSQMessagesBubbleImage *incomingBubbleImageData; 42 | 43 | @property (strong, nonatomic) NSDictionary *users; 44 | 45 | - (void)addPhotoMediaMessage; 46 | 47 | - (void)addLocationMediaMessageCompletion:(JSQLocationMediaItemCompletionBlock)completion; 48 | 49 | - (void)addVideoMediaMessage; 50 | 51 | - (void)addAudioMediaMessage; 52 | 53 | - (void)addShortVideoMediaMessageWithVideoPath:(NSString *)videoPath playType:(PKPlayType)type; 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /PKShortVideoDemo/PKMessageViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PKMessageViewController.h 3 | // PKShortVideo 4 | // 5 | // Created by pepsikirk on 16/1/2. 6 | // Copyright © 2016年 pepsikirk. All rights reserved. 7 | // 8 | 9 | #import "JSQMessages.h" 10 | 11 | @interface PKMessageViewController : JSQMessagesViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /PKShortVideoDemo/PKMessageViewController2.h: -------------------------------------------------------------------------------- 1 | // 2 | // PKMessageViewController2.h 3 | // PKShortVideo 4 | // 5 | // Created by TYM01 on 16/9/26. 6 | // Copyright © 2016年 pepsikirk. All rights reserved. 7 | // 8 | 9 | #import "JSQMessages.h" 10 | 11 | @interface PKMessageViewController2 : JSQMessagesViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /PKShortVideoDemo/PKRootViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PKRootViewController.h 3 | // PKShortVideo 4 | // 5 | // Created by pepsikirk on 16/1/2. 6 | // Copyright © 2016年 pepsikirk. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface PKRootViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /PKShortVideoDemo/PKRootViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // PKRootViewController.m 3 | // PKShortVideo 4 | // 5 | // Created by pepsikirk on 16/1/2. 6 | // Copyright © 2016年 pepsikirk. All rights reserved. 7 | // 8 | 9 | #import "PKRootViewController.h" 10 | #import "PKMessageViewController.h" 11 | 12 | @interface PKRootViewController () 13 | 14 | @end 15 | 16 | @implementation PKRootViewController 17 | 18 | #pragma mark - View Lifecycle 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | self.title = @"PKShortVideo"; 23 | } 24 | 25 | - (void)viewWillAppear:(BOOL)animated { 26 | [super viewWillAppear:animated]; 27 | [self.tableView deselectRowAtIndexPath:[self.tableView indexPathForSelectedRow] animated:YES]; 28 | self.title = @"PKShortVideo"; 29 | } 30 | 31 | -(void)viewWillDisappear:(BOOL)animated { 32 | [super viewWillDisappear:animated]; 33 | self.title = nil; 34 | } 35 | 36 | 37 | 38 | #pragma mark - Table view data source 39 | 40 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 41 | return 1; 42 | } 43 | 44 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 45 | return 2; 46 | } 47 | 48 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 49 | static NSString *cellIdentifier = @"CellIdentifier"; 50 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; 51 | if (!cell) { 52 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier]; 53 | cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; 54 | } 55 | 56 | if (indexPath.section == 0) { 57 | switch (indexPath.row) { 58 | case 0: 59 | cell.textLabel.text = @"Push OpenGL Demo"; 60 | break; 61 | 62 | case 1: 63 | cell.textLabel.text = @"Push AVPlayer Demo"; 64 | break; 65 | } 66 | } 67 | 68 | return cell; 69 | } 70 | 71 | - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { 72 | return @"Presentation"; 73 | } 74 | 75 | 76 | 77 | #pragma mark - Table view delegate 78 | 79 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 80 | if (indexPath.section == 0) { 81 | switch (indexPath.row) { 82 | case 0: 83 | [self performSegueWithIdentifier:@"seguePushMessageVC1" sender:self]; 84 | break; 85 | 86 | case 1: 87 | [self performSegueWithIdentifier:@"seguePushMessageVC2" sender:self]; 88 | break; 89 | } 90 | } 91 | } 92 | 93 | 94 | @end 95 | -------------------------------------------------------------------------------- /PKShortVideoDemo/PKShortVideoItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // PKShortVideoItem.h 3 | // PKShortVideo 4 | // 5 | // Created by pepsikirk on 16/1/3. 6 | // Copyright © 2016年 pepsikirk. All rights reserved. 7 | // 8 | 9 | #import "JSQMediaItem.h" 10 | 11 | @interface PKShortVideoItem : JSQMediaItem 12 | 13 | @property (nonatomic, strong) NSString *videoPath; 14 | @property (strong, nonatomic) UIImage *image; 15 | 16 | - (instancetype)initWithVideoPath:(NSString *)videoPath previewImage:(UIImage *)image; 17 | 18 | - (void)play; 19 | - (void)pause; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /PKShortVideoDemo/PKShortVideoItem2.h: -------------------------------------------------------------------------------- 1 | // 2 | // PKShortVideoItem2.h 3 | // PKShortVideo 4 | // 5 | // Created by TYM01 on 16/9/26. 6 | // Copyright © 2016年 pepsikirk. All rights reserved. 7 | // 8 | 9 | #import "JSQMediaItem.h" 10 | 11 | @interface PKShortVideoItem2 : JSQMediaItem 12 | 13 | @property (nonatomic, strong) NSString *videoPath; 14 | @property (strong, nonatomic) UIImage *image; 15 | 16 | - (instancetype)initWithVideoPath:(NSString *)videoPath previewImage:(UIImage *)image; 17 | 18 | - (void)play; 19 | - (void)pause; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /PKShortVideoDemo/jsq_messages_sample.m4a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/PKShortVideoDemo/jsq_messages_sample.m4a -------------------------------------------------------------------------------- /PKShortVideoDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // PKShortVideo 4 | // 5 | // Created by pepsikirk on 15/12/30. 6 | // Copyright © 2015年 pepsikirk. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /PKShortVideoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /PKShortVideoTests/PKShortVideoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // PKShortVideoTests.m 3 | // PKShortVideoTests 4 | // 5 | // Created by pepsikirk on 15/12/30. 6 | // Copyright © 2015年 pepsikirk. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface PKShortVideoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation PKShortVideoTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /PKShortVideoUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /PKShortVideoUITests/PKShortVideoUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // PKShortVideoUITests.m 3 | // PKShortVideoUITests 4 | // 5 | // Created by pepsikirk on 15/12/30. 6 | // Copyright © 2015年 pepsikirk. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface PKShortVideoUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation PKShortVideoUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Screenshots/gif.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/Screenshots/gif.gif -------------------------------------------------------------------------------- /Screenshots/png.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/Screenshots/png.png -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Base.lproj/JSQMessages.strings: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | // ******************************** 20 | // Special thanks to the localization contributors! 21 | // 22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237 23 | // ******************************** 24 | 25 | "load_earlier_messages" = "Load Earlier Messages"; 26 | 27 | "send" = "Send"; 28 | 29 | "new_message" = "New Message"; 30 | 31 | "text_message_accessibility_label" = "%@: %@"; 32 | 33 | "media_message_accessibility_label" = "%@: media message"; 34 | 35 | "accessory_button_accessibility_label" = "Share media"; 36 | 37 | "new_message_received_accessibility_announcement" = "New message received"; -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_min.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_min.png -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_min@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_min@2x.png -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_min@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_min@3x.png -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_min_tailless.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_min_tailless.png -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_min_tailless@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_min_tailless@2x.png -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_min_tailless@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_min_tailless@3x.png -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_regular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_regular.png -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_regular@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_regular@2x.png -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_regular@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_regular@3x.png -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_stroked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_stroked.png -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_stroked@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_stroked@2x.png -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_stroked@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_stroked@3x.png -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_stroked_tailless.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_stroked_tailless.png -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_stroked_tailless@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_stroked_tailless@2x.png -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_stroked_tailless@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_stroked_tailless@3x.png -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_tailless.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_tailless.png -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_tailless@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_tailless@2x.png -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_tailless@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_tailless@3x.png -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/clip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/clip.png -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/clip@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/clip@2x.png -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/clip@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/clip@3x.png -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/pause.png -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/pause@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/pause@2x.png -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/pause@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/pause@3x.png -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/play.png -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/play@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/play@2x.png -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/play@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/play@3x.png -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/typing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/typing.png -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/typing@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/typing@2x.png -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/typing@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/typing@3x.png -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Sounds/message_received.aiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Sounds/message_received.aiff -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Sounds/message_sent.aiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pepsikirk/PKShortVideo/1391d95f805c6ea89575c2e403c0dc7628af403f/Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Sounds/message_sent.aiff -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/ar.lproj/JSQMessages.strings: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | // ******************************** 20 | // Special thanks to the localization contributors! 21 | // 22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237 23 | // ******************************** 24 | 25 | "load_earlier_messages" = "تحميل الرسائل السابقة"; 26 | 27 | "send" = "أرسال"; 28 | 29 | "new_message" = "رسالة جديدة"; 30 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/de.lproj/JSQMessages.strings: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | // ******************************** 20 | // Special thanks to the localization contributors! 21 | // 22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237 23 | // ******************************** 24 | 25 | "load_earlier_messages" = "Ältere Nachrichten laden"; 26 | 27 | "send" = "Senden"; 28 | 29 | "new_message" = "Neue Nachricht"; 30 | 31 | "text_message_accessibility_label" = "%@: %@"; 32 | 33 | "media_message_accessibility_label" = "%@: media Nachricht"; 34 | 35 | "accessory_button_accessibility_label" = "Aktien media"; 36 | 37 | "new_message_received_accessibility_announcement" = "Neue Nachricht empfangen"; 38 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/en.lproj/JSQMessages.strings: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | // ******************************** 20 | // Special thanks to the localization contributors! 21 | // 22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237 23 | // ******************************** 24 | 25 | "load_earlier_messages" = "Load Earlier Messages"; 26 | 27 | "send" = "Send"; 28 | 29 | "new_message" = "New Message"; 30 | 31 | "text_message_accessibility_label" = "%@: %@"; 32 | 33 | "media_message_accessibility_label" = "%@: media message"; 34 | 35 | "accessory_button_accessibility_label" = "Share media"; 36 | 37 | "new_message_received_accessibility_announcement" = "New message received"; -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/es.lproj/JSQMessages.strings: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | // ******************************** 20 | // Special thanks to the localization contributors! 21 | // 22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237 23 | // ******************************** 24 | 25 | "load_earlier_messages" = "Cargar mensajes anteriores"; 26 | 27 | "send" = "Enviar"; 28 | 29 | "new_message" = "Nuevo mensaje"; 30 | 31 | "text_message_accessibility_label" = "%@: %@"; 32 | 33 | "media_message_accessibility_label" = "%@: imagen"; 34 | 35 | "accessory_button_accessibility_label" = "Intercambio de archivos"; 36 | 37 | "new_message_received_accessibility_announcement" = "mensaje recibido"; 38 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/fi.lproj/JSQMessages.strings: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | // ******************************** 20 | // Special thanks to the localization contributors! 21 | // 22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237 23 | // ******************************** 24 | 25 | "load_earlier_messages" = "Lataa aiempia viestejä"; 26 | 27 | "send" = "Lähetä"; 28 | 29 | "new_message" = "Uusi viesti"; 30 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/fr.lproj/JSQMessages.strings: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | // ******************************** 20 | // Special thanks to the localization contributors! 21 | // 22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237 23 | // ******************************** 24 | 25 | "load_earlier_messages" = "Messages précedents"; 26 | 27 | "send" = "Envoyer"; 28 | 29 | "new_message" = "Nouveau message"; 30 | 31 | "text_message_accessibility_label" = "%@: %@"; 32 | 33 | "media_message_accessibility_label" = "%@: image"; 34 | 35 | "accessory_button_accessibility_label" = "Partager fichier"; 36 | 37 | "new_message_received_accessibility_announcement" = "Nouveau message reçu"; 38 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/he.lproj/JSQMessages.strings: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | // ******************************** 20 | // Special thanks to the localization contributors! 21 | // 22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237 23 | // ******************************** 24 | 25 | "load_earlier_messages" = "טען הודעות קודמות"; 26 | 27 | "send" = "שלח"; 28 | 29 | "new_message" = "הודעה חדשה"; 30 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/id.lproj/JSQMessages.strings: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | // ******************************** 20 | // Special thanks to the localization contributors! 21 | // 22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237 23 | // ******************************** 24 | 25 | "load_earlier_messages" = "Muat Pesan Sebelumnya"; 26 | 27 | "send" = "Kirim"; 28 | 29 | "new_message" = "Pesan Baru"; 30 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/it.lproj/JSQMessages.strings: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | // ******************************** 20 | // Special thanks to the localization contributors! 21 | // 22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237 23 | // ******************************** 24 | 25 | "load_earlier_messages" = "Carica messaggi precedenti"; 26 | 27 | "send" = "Invia"; 28 | 29 | "new_message" = "Nuovo Messaggio"; 30 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/ja.lproj/JSQMessages.strings: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | // ******************************** 20 | // Special thanks to the localization contributors! 21 | // 22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237 23 | // ******************************** 24 | 25 | "load_earlier_messages" = "古いメッセージを読み込む"; 26 | 27 | "send" = "送信"; 28 | 29 | "new_message" = "新しいメッセージ"; 30 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/ko.lproj/JSQMessages.strings: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | // ******************************** 20 | // Special thanks to the localization contributors! 21 | // 22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237 23 | // ******************************** 24 | 25 | "load_earlier_messages" = "이전 메시지 불러오기"; 26 | 27 | "send" = "전송"; 28 | 29 | "new_message" = "새로운 메시지"; 30 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/ms.lproj/JSQMessages.strings: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | // ******************************** 20 | // Special thanks to the localization contributors! 21 | // 22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237 23 | // ******************************** 24 | 25 | "load_earlier_messages" = "Muat Turun Mesej Lama"; 26 | 27 | "send" = "Hantar"; 28 | 29 | "new_message" = "Mesej Baru"; 30 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/nb.lproj/JSQMessages.strings: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | // ******************************** 20 | // Special thanks to the localization contributors! 21 | // 22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237 23 | // ******************************** 24 | 25 | "load_earlier_messages" = "Last tidligere beskjeder"; 26 | 27 | "send" = "Send"; 28 | 29 | "new_message" = "Ny melding"; 30 | 31 | "text_message_accessibility_label" = "%@: %@"; 32 | 33 | "media_message_accessibility_label" = "%@: mediamelding"; 34 | 35 | "accessory_button_accessibility_label" = "Del media"; 36 | 37 | "new_message_received_accessibility_announcement" = "Ny melding mottatt"; 38 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/nl.lproj/JSQMessages.strings: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | // ******************************** 20 | // Special thanks to the localization contributors! 21 | // 22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237 23 | // ******************************** 24 | 25 | "load_earlier_messages" = "Laad eerdere berichten"; 26 | 27 | "send" = "Stuur"; 28 | 29 | "new_message" = "Nieuw bericht"; 30 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/pl.lproj/JSQMessages.strings: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | // ******************************** 20 | // Special thanks to the localization contributors! 21 | // 22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237 23 | // ******************************** 24 | 25 | "load_earlier_messages" = "Otwórz wcześniejsze wiadomości"; 26 | 27 | "send" = "Wyślij"; 28 | 29 | "new_message" = "Nowa wiadomość"; 30 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/pt.lproj/JSQMessages.strings: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | // ******************************** 20 | // Special thanks to the localization contributors! 21 | // 22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237 23 | // ******************************** 24 | 25 | "load_earlier_messages" = "Carregar mensagens anteriores"; 26 | 27 | "send" = "Enviar"; 28 | 29 | "new_message" = "Nova Mensagem"; 30 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/ro.lproj/JSQMessages.strings: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | // ******************************** 20 | // Special thanks to the localization contributors! 21 | // 22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237 23 | // ******************************** 24 | 25 | "load_earlier_messages" = "Încărcați mesajele anterioare"; 26 | 27 | "send" = "Trimiteți"; 28 | 29 | "new_message" = "Mesaj nou"; 30 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/ru.lproj/JSQMessages.strings: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | // ******************************** 20 | // Special thanks to the localization contributors! 21 | // 22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237 23 | // ******************************** 24 | 25 | "load_earlier_messages" = "Предыдущие сообщения"; 26 | 27 | "send" = "Отпр"; 28 | 29 | "new_message" = "Сообщение"; 30 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/th.lproj/JSQMessages.strings: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | // ******************************** 20 | // Special thanks to the localization contributors! 21 | // 22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237 23 | // ******************************** 24 | 25 | "load_earlier_messages" = "โหลดข้อความก่อนหน้า"; 26 | 27 | "send" = "ส่ง"; 28 | 29 | "new_message" = "ข้อความใหม่"; 30 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/tr.lproj/JSQMessages.strings: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | // ******************************** 20 | // Special thanks to the localization contributors! 21 | // 22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237 23 | // ******************************** 24 | 25 | "load_earlier_messages" = "Eski mesajları yükle"; 26 | 27 | "send" = "Gönder"; 28 | 29 | "new_message" = "Yeni Mesaj"; 30 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/vi.lproj/JSQMessages.strings: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | // ******************************** 20 | // Special thanks to the localization contributors! 21 | // 22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237 23 | // ******************************** 24 | 25 | "load_earlier_messages" = "Tải thêm tin nhắn"; 26 | 27 | "send" = "Gửi"; 28 | 29 | "new_message" = "Tin nhắn mới"; 30 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/zh-Hans.lproj/JSQMessages.strings: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | // ******************************** 20 | // Special thanks to the localization contributors! 21 | // 22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237 23 | // ******************************** 24 | 25 | "load_earlier_messages" = "载入较早的信息"; 26 | 27 | "send" = "发送"; 28 | 29 | "new_message" = "新信息"; 30 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/zh-Hant.lproj/JSQMessages.strings: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | // ******************************** 20 | // Special thanks to the localization contributors! 21 | // 22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237 23 | // ******************************** 24 | 25 | "load_earlier_messages" = "載入之前的訊息"; 26 | 27 | "send" = "傳送"; 28 | 29 | "new_message" = "新信息"; 30 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Categories/JSQSystemSoundPlayer+JSQMessages.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import "JSQSystemSoundPlayer.h" 20 | 21 | @interface JSQSystemSoundPlayer (JSQMessages) 22 | 23 | /** 24 | * Plays the default sound for received messages. 25 | */ 26 | + (void)jsq_playMessageReceivedSound; 27 | 28 | /** 29 | * Plays the default sound for received messages *as an alert*, invoking device vibration if available. 30 | */ 31 | + (void)jsq_playMessageReceivedAlert; 32 | 33 | /** 34 | * Plays the default sound for sent messages. 35 | */ 36 | + (void)jsq_playMessageSentSound; 37 | 38 | /** 39 | * Plays the default sound for sent messages *as an alert*, invoking device vibration if available. 40 | */ 41 | + (void)jsq_playMessageSentAlert; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Categories/JSQSystemSoundPlayer+JSQMessages.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import "JSQSystemSoundPlayer+JSQMessages.h" 20 | 21 | #import "NSBundle+JSQMessages.h" 22 | 23 | 24 | static NSString * const kJSQMessageReceivedSoundName = @"message_received"; 25 | static NSString * const kJSQMessageSentSoundName = @"message_sent"; 26 | 27 | 28 | @implementation JSQSystemSoundPlayer (JSQMessages) 29 | 30 | #pragma mark - Public 31 | 32 | + (void)jsq_playMessageReceivedSound 33 | { 34 | [self jsq_playSoundFromJSQMessagesBundleWithName:kJSQMessageReceivedSoundName asAlert:NO]; 35 | } 36 | 37 | + (void)jsq_playMessageReceivedAlert 38 | { 39 | [self jsq_playSoundFromJSQMessagesBundleWithName:kJSQMessageReceivedSoundName asAlert:YES]; 40 | } 41 | 42 | + (void)jsq_playMessageSentSound 43 | { 44 | [self jsq_playSoundFromJSQMessagesBundleWithName:kJSQMessageSentSoundName asAlert:NO]; 45 | } 46 | 47 | + (void)jsq_playMessageSentAlert 48 | { 49 | [self jsq_playSoundFromJSQMessagesBundleWithName:kJSQMessageSentSoundName asAlert:YES]; 50 | } 51 | 52 | #pragma mark - Private 53 | 54 | + (void)jsq_playSoundFromJSQMessagesBundleWithName:(NSString *)soundName asAlert:(BOOL)asAlert 55 | { 56 | // save sound player original bundle 57 | NSString *originalPlayerBundleIdentifier = [JSQSystemSoundPlayer sharedPlayer].bundle.bundleIdentifier; 58 | 59 | // search for sounds in this library's bundle 60 | [JSQSystemSoundPlayer sharedPlayer].bundle = [NSBundle jsq_messagesBundle]; 61 | 62 | NSString *fileName = [NSString stringWithFormat:@"JSQMessagesAssets.bundle/Sounds/%@", soundName]; 63 | 64 | if (asAlert) { 65 | [[JSQSystemSoundPlayer sharedPlayer] playAlertSoundWithFilename:fileName fileExtension:kJSQSystemSoundTypeAIFF]; 66 | } 67 | else { 68 | [[JSQSystemSoundPlayer sharedPlayer] playSoundWithFilename:fileName fileExtension:kJSQSystemSoundTypeAIFF]; 69 | } 70 | 71 | // restore original bundle 72 | [JSQSystemSoundPlayer sharedPlayer].bundle = [NSBundle bundleWithIdentifier:originalPlayerBundleIdentifier]; 73 | } 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Categories/NSBundle+JSQMessages.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import 20 | 21 | @interface NSBundle (JSQMessages) 22 | 23 | /** 24 | * @return The bundle for JSQMessagesViewController. 25 | */ 26 | + (NSBundle *)jsq_messagesBundle; 27 | 28 | /** 29 | * @return The bundle for assets in JSQMessagesViewController. 30 | */ 31 | + (NSBundle *)jsq_messagesAssetBundle; 32 | 33 | /** 34 | * Returns a localized version of the string designated by the specified key and residing in the JSQMessages table. 35 | * 36 | * @param key The key for a string in the JSQMessages table. 37 | * 38 | * @return A localized version of the string designated by key in the JSQMessages table. 39 | */ 40 | + (NSString *)jsq_localizedStringForKey:(NSString *)key; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Categories/NSBundle+JSQMessages.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import "NSBundle+JSQMessages.h" 20 | 21 | #import "JSQMessagesViewController.h" 22 | 23 | @implementation NSBundle (JSQMessages) 24 | 25 | + (NSBundle *)jsq_messagesBundle 26 | { 27 | return [NSBundle bundleForClass:[JSQMessagesViewController class]]; 28 | } 29 | 30 | + (NSBundle *)jsq_messagesAssetBundle 31 | { 32 | NSString *bundleResourcePath = [NSBundle jsq_messagesBundle].resourcePath; 33 | NSString *assetPath = [bundleResourcePath stringByAppendingPathComponent:@"JSQMessagesAssets.bundle"]; 34 | return [NSBundle bundleWithPath:assetPath]; 35 | } 36 | 37 | + (NSString *)jsq_localizedStringForKey:(NSString *)key 38 | { 39 | return NSLocalizedStringFromTableInBundle(key, @"JSQMessages", [NSBundle jsq_messagesAssetBundle], nil); 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Categories/NSString+JSQMessages.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import 20 | 21 | @interface NSString (JSQMessages) 22 | 23 | /** 24 | * @return A copy of the receiver with all leading and trailing whitespace removed. 25 | */ 26 | - (NSString *)jsq_stringByTrimingWhitespace; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Categories/NSString+JSQMessages.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import "NSString+JSQMessages.h" 20 | 21 | @implementation NSString (JSQMessages) 22 | 23 | - (NSString *)jsq_stringByTrimingWhitespace 24 | { 25 | return [self stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Categories/UIColor+JSQMessages.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import 20 | 21 | @interface UIColor (JSQMessages) 22 | 23 | #pragma mark - Message bubble colors 24 | 25 | /** 26 | * @return A color object containing HSB values similar to the iOS 7 messages app green bubble color. 27 | */ 28 | + (UIColor *)jsq_messageBubbleGreenColor; 29 | 30 | /** 31 | * @return A color object containing HSB values similar to the iOS 7 messages app blue bubble color. 32 | */ 33 | + (UIColor *)jsq_messageBubbleBlueColor; 34 | 35 | /** 36 | * @return A color object containing HSB values similar to the iOS 7 red color. 37 | */ 38 | + (UIColor *)jsq_messageBubbleRedColor; 39 | 40 | /** 41 | * @return A color object containing HSB values similar to the iOS 7 messages app light gray bubble color. 42 | */ 43 | + (UIColor *)jsq_messageBubbleLightGrayColor; 44 | 45 | #pragma mark - Utilities 46 | 47 | /** 48 | * Creates and returns a new color object whose brightness component is decreased by the given value, using the initial color values of the receiver. 49 | * 50 | * @param value A floating point value describing the amount by which to decrease the brightness of the receiver. 51 | * 52 | * @return A new color object whose brightness is decreased by the given values. The other color values remain the same as the receiver. 53 | */ 54 | - (UIColor *)jsq_colorByDarkeningColorWithValue:(CGFloat)value; 55 | 56 | @end -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Categories/UIColor+JSQMessages.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import "UIColor+JSQMessages.h" 20 | 21 | @implementation UIColor (JSQMessages) 22 | 23 | #pragma mark - Message bubble colors 24 | 25 | + (UIColor *)jsq_messageBubbleGreenColor 26 | { 27 | return [UIColor colorWithHue:130.0f / 360.0f 28 | saturation:0.68f 29 | brightness:0.84f 30 | alpha:1.0f]; 31 | } 32 | 33 | + (UIColor *)jsq_messageBubbleBlueColor 34 | { 35 | return [UIColor colorWithHue:210.0f / 360.0f 36 | saturation:0.94f 37 | brightness:1.0f 38 | alpha:1.0f]; 39 | } 40 | 41 | + (UIColor *)jsq_messageBubbleRedColor 42 | { 43 | return [UIColor colorWithHue:0.0f / 360.0f 44 | saturation:0.79f 45 | brightness:1.0f 46 | alpha:1.0f]; 47 | } 48 | 49 | + (UIColor *)jsq_messageBubbleLightGrayColor 50 | { 51 | return [UIColor colorWithHue:240.0f / 360.0f 52 | saturation:0.02f 53 | brightness:0.92f 54 | alpha:1.0f]; 55 | } 56 | 57 | #pragma mark - Utilities 58 | 59 | - (UIColor *)jsq_colorByDarkeningColorWithValue:(CGFloat)value 60 | { 61 | NSUInteger totalComponents = CGColorGetNumberOfComponents(self.CGColor); 62 | BOOL isGreyscale = (totalComponents == 2) ? YES : NO; 63 | 64 | CGFloat *oldComponents = (CGFloat *)CGColorGetComponents(self.CGColor); 65 | CGFloat newComponents[4]; 66 | 67 | if (isGreyscale) { 68 | newComponents[0] = oldComponents[0] - value < 0.0f ? 0.0f : oldComponents[0] - value; 69 | newComponents[1] = oldComponents[0] - value < 0.0f ? 0.0f : oldComponents[0] - value; 70 | newComponents[2] = oldComponents[0] - value < 0.0f ? 0.0f : oldComponents[0] - value; 71 | newComponents[3] = oldComponents[1]; 72 | } 73 | else { 74 | newComponents[0] = oldComponents[0] - value < 0.0f ? 0.0f : oldComponents[0] - value; 75 | newComponents[1] = oldComponents[1] - value < 0.0f ? 0.0f : oldComponents[1] - value; 76 | newComponents[2] = oldComponents[2] - value < 0.0f ? 0.0f : oldComponents[2] - value; 77 | newComponents[3] = oldComponents[3]; 78 | } 79 | 80 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); 81 | CGColorRef newColor = CGColorCreate(colorSpace, newComponents); 82 | CGColorSpaceRelease(colorSpace); 83 | 84 | UIColor *retColor = [UIColor colorWithCGColor:newColor]; 85 | CGColorRelease(newColor); 86 | 87 | return retColor; 88 | } 89 | 90 | @end -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Categories/UIDevice+JSQMessages.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import 20 | 21 | @interface UIDevice (JSQMessages) 22 | 23 | /** 24 | * @return Whether or not the current device is running a version of iOS before 8.0. 25 | */ 26 | + (BOOL)jsq_isCurrentDeviceBeforeiOS8; 27 | 28 | /** 29 | * @return Whether or not the current device is running a version of iOS after 9.0. 30 | */ 31 | + (BOOL)jsq_isCurrentDeviceAfteriOS9; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Categories/UIDevice+JSQMessages.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import "UIDevice+JSQMessages.h" 20 | 21 | @implementation UIDevice (JSQMessages) 22 | 23 | + (BOOL)jsq_isCurrentDeviceBeforeiOS8 24 | { 25 | // iOS < 8.0 26 | return [[UIDevice currentDevice].systemVersion compare:@"8.0" options:NSNumericSearch] == NSOrderedAscending; 27 | } 28 | 29 | + (BOOL)jsq_isCurrentDeviceAfteriOS9 30 | { 31 | // iOS > 9.0 32 | return [[UIDevice currentDevice].systemVersion compare:@"9.0" options:NSNumericSearch] == NSOrderedDescending; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Categories/UIImage+JSQMessages.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import 20 | 21 | @interface UIImage (JSQMessages) 22 | 23 | /** 24 | * Creates and returns a new image object that is masked with the specified mask color. 25 | * 26 | * @param maskColor The color value for the mask. This value must not be `nil`. 27 | * 28 | * @return A new image object masked with the specified color. 29 | */ 30 | - (UIImage *)jsq_imageMaskedWithColor:(UIColor *)maskColor; 31 | 32 | /** 33 | * @return The regular message bubble image. 34 | */ 35 | + (UIImage *)jsq_bubbleRegularImage; 36 | 37 | /** 38 | * @return The regular message bubble image without a tail. 39 | */ 40 | + (UIImage *)jsq_bubbleRegularTaillessImage; 41 | 42 | /** 43 | * @return The regular message bubble image stroked, not filled. 44 | */ 45 | + (UIImage *)jsq_bubbleRegularStrokedImage; 46 | 47 | /** 48 | * @return The regular message bubble image stroked, not filled and without a tail. 49 | */ 50 | + (UIImage *)jsq_bubbleRegularStrokedTaillessImage; 51 | 52 | /** 53 | * @return The compact message bubble image. 54 | * 55 | * @discussion This is the default bubble image used by `JSQMessagesBubbleImageFactory`. 56 | */ 57 | + (UIImage *)jsq_bubbleCompactImage; 58 | 59 | /** 60 | * @return The compact message bubble image without a tail. 61 | */ 62 | + (UIImage *)jsq_bubbleCompactTaillessImage; 63 | 64 | /** 65 | * @return The default input toolbar accessory image. 66 | */ 67 | + (UIImage *)jsq_defaultAccessoryImage; 68 | 69 | /** 70 | * @return The default typing indicator image. 71 | */ 72 | + (UIImage *)jsq_defaultTypingIndicatorImage; 73 | 74 | /** 75 | * @return The default play icon image. 76 | */ 77 | + (UIImage *)jsq_defaultPlayImage; 78 | 79 | /** 80 | * @return The default pause icon image. 81 | */ 82 | + (UIImage *)jsq_defaultPauseImage; 83 | 84 | @end 85 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Categories/UIImage+JSQMessages.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import "UIImage+JSQMessages.h" 20 | 21 | #import "NSBundle+JSQMessages.h" 22 | 23 | 24 | @implementation UIImage (JSQMessages) 25 | 26 | - (UIImage *)jsq_imageMaskedWithColor:(UIColor *)maskColor 27 | { 28 | NSParameterAssert(maskColor != nil); 29 | 30 | CGRect imageRect = CGRectMake(0.0f, 0.0f, self.size.width, self.size.height); 31 | UIImage *newImage = nil; 32 | 33 | UIGraphicsBeginImageContextWithOptions(imageRect.size, NO, self.scale); 34 | { 35 | CGContextRef context = UIGraphicsGetCurrentContext(); 36 | 37 | CGContextScaleCTM(context, 1.0f, -1.0f); 38 | CGContextTranslateCTM(context, 0.0f, -(imageRect.size.height)); 39 | 40 | CGContextClipToMask(context, imageRect, self.CGImage); 41 | CGContextSetFillColorWithColor(context, maskColor.CGColor); 42 | CGContextFillRect(context, imageRect); 43 | 44 | newImage = UIGraphicsGetImageFromCurrentImageContext(); 45 | } 46 | UIGraphicsEndImageContext(); 47 | 48 | return newImage; 49 | } 50 | 51 | + (UIImage *)jsq_bubbleImageFromBundleWithName:(NSString *)name 52 | { 53 | NSBundle *bundle = [NSBundle jsq_messagesAssetBundle]; 54 | NSString *path = [bundle pathForResource:name ofType:@"png" inDirectory:@"Images"]; 55 | return [UIImage imageWithContentsOfFile:path]; 56 | } 57 | 58 | + (UIImage *)jsq_bubbleRegularImage 59 | { 60 | return [UIImage jsq_bubbleImageFromBundleWithName:@"bubble_regular"]; 61 | } 62 | 63 | + (UIImage *)jsq_bubbleRegularTaillessImage 64 | { 65 | return [UIImage jsq_bubbleImageFromBundleWithName:@"bubble_tailless"]; 66 | } 67 | 68 | + (UIImage *)jsq_bubbleRegularStrokedImage 69 | { 70 | return [UIImage jsq_bubbleImageFromBundleWithName:@"bubble_stroked"]; 71 | } 72 | 73 | + (UIImage *)jsq_bubbleRegularStrokedTaillessImage 74 | { 75 | return [UIImage jsq_bubbleImageFromBundleWithName:@"bubble_stroked_tailless"]; 76 | } 77 | 78 | + (UIImage *)jsq_bubbleCompactImage 79 | { 80 | return [UIImage jsq_bubbleImageFromBundleWithName:@"bubble_min"]; 81 | } 82 | 83 | + (UIImage *)jsq_bubbleCompactTaillessImage 84 | { 85 | return [UIImage jsq_bubbleImageFromBundleWithName:@"bubble_min_tailless"]; 86 | } 87 | 88 | + (UIImage *)jsq_defaultAccessoryImage 89 | { 90 | return [UIImage jsq_bubbleImageFromBundleWithName:@"clip"]; 91 | } 92 | 93 | + (UIImage *)jsq_defaultTypingIndicatorImage 94 | { 95 | return [UIImage jsq_bubbleImageFromBundleWithName:@"typing"]; 96 | } 97 | 98 | + (UIImage *)jsq_defaultPlayImage 99 | { 100 | return [UIImage jsq_bubbleImageFromBundleWithName:@"play"]; 101 | } 102 | 103 | + (UIImage *)jsq_defaultPauseImage 104 | { 105 | return [UIImage jsq_bubbleImageFromBundleWithName:@"pause"]; 106 | } 107 | 108 | @end 109 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Categories/UIView+JSQMessages.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import 20 | 21 | @interface UIView (JSQMessages) 22 | 23 | /** 24 | * Pins the subview of the receiver to the edge of its frame, as specified by the given attribute, by adding a layout constraint. 25 | * 26 | * @param subview The subview to which the receiver will be pinned. 27 | * @param attribute The layout constraint attribute specifying one of `NSLayoutAttributeBottom`, `NSLayoutAttributeTop`, `NSLayoutAttributeLeading`, `NSLayoutAttributeTrailing`. 28 | */ 29 | - (void)jsq_pinSubview:(UIView *)subview toEdge:(NSLayoutAttribute)attribute; 30 | 31 | /** 32 | * Pins all edges of the specified subview to the receiver. 33 | * 34 | * @param subview The subview to which the receiver will be pinned. 35 | */ 36 | - (void)jsq_pinAllEdgesOfSubview:(UIView *)subview; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Categories/UIView+JSQMessages.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import "UIView+JSQMessages.h" 20 | 21 | @implementation UIView (JSQMessages) 22 | 23 | - (void)jsq_pinSubview:(UIView *)subview toEdge:(NSLayoutAttribute)attribute 24 | { 25 | [self addConstraint:[NSLayoutConstraint constraintWithItem:self 26 | attribute:attribute 27 | relatedBy:NSLayoutRelationEqual 28 | toItem:subview 29 | attribute:attribute 30 | multiplier:1.0f 31 | constant:0.0f]]; 32 | } 33 | 34 | - (void)jsq_pinAllEdgesOfSubview:(UIView *)subview 35 | { 36 | [self jsq_pinSubview:subview toEdge:NSLayoutAttributeBottom]; 37 | [self jsq_pinSubview:subview toEdge:NSLayoutAttributeTop]; 38 | [self jsq_pinSubview:subview toEdge:NSLayoutAttributeLeading]; 39 | [self jsq_pinSubview:subview toEdge:NSLayoutAttributeTrailing]; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Factories/JSQMessagesBubbleImageFactory.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import 20 | #import 21 | 22 | #import "JSQMessagesBubbleImage.h" 23 | 24 | /** 25 | * `JSQMessagesBubbleImageFactory` is a factory that provides a means for creating and styling 26 | * `JSQMessagesBubbleImage` objects to be displayed in a `JSQMessagesCollectionViewCell` of a `JSQMessagesCollectionView`. 27 | */ 28 | @interface JSQMessagesBubbleImageFactory : NSObject 29 | 30 | /** 31 | * Creates and returns a new instance of `JSQMessagesBubbleImageFactory` that uses the 32 | * default bubble image assets and cap insets. 33 | * 34 | * @return An initialized `JSQMessagesBubbleImageFactory` object if created successfully, `nil` otherwise. 35 | */ 36 | - (instancetype)init; 37 | 38 | /** 39 | * Creates and returns a new instance of `JSQMessagesBubbleImageFactory` having the specified 40 | * bubbleImage and capInsets. These values are used internally in the factory to produce 41 | * `JSQMessagesBubbleImage` objects. 42 | * 43 | * @param bubbleImage A template bubble image from which all images will be generated. 44 | * The image should represent the *outgoing* message bubble image, which will be flipped 45 | * horizontally for generating the corresponding *incoming* message bubble images. This value must not be `nil`. 46 | * 47 | * @param capInsets The values to use for the cap insets that define the unstretchable regions of the image. 48 | * Specify `UIEdgeInsetsZero` to have the factory create insets that allow the image to stretch from its center point. 49 | * 50 | * @return An initialized `JSQMessagesBubbleImageFactory` object if created successfully, `nil` otherwise. 51 | */ 52 | - (instancetype)initWithBubbleImage:(UIImage *)bubbleImage capInsets:(UIEdgeInsets)capInsets; 53 | 54 | /** 55 | * Creates and returns a `JSQMessagesBubbleImage` object with the specified color for *outgoing* message image bubbles. 56 | * The `messageBubbleImage` property of the `JSQMessagesBubbleImage` is configured with a flat bubble image, masked to the given color. 57 | * The `messageBubbleHighlightedImage` property is configured similarly, but with a darkened version of the given color. 58 | * 59 | * @param color The color of the bubble image in the image view. This value must not be `nil`. 60 | * 61 | * @return An initialized `JSQMessagesBubbleImage` object if created successfully, `nil` otherwise. 62 | */ 63 | - (JSQMessagesBubbleImage *)outgoingMessagesBubbleImageWithColor:(UIColor *)color; 64 | 65 | /** 66 | * Creates and returns a `JSQMessagesBubbleImage` object with the specified color for *incoming* message image bubbles. 67 | * The `messageBubbleImage` property of the `JSQMessagesBubbleImage` is configured with a flat bubble image, masked to the given color. 68 | * The `messageBubbleHighlightedImage` property is configured similarly, but with a darkened version of the given color. 69 | * 70 | * @param color The color of the bubble image in the image view. This value must not be `nil`. 71 | * 72 | * @return An initialized `JSQMessagesBubbleImage` object if created successfully, `nil` otherwise. 73 | */ 74 | - (JSQMessagesBubbleImage *)incomingMessagesBubbleImageWithColor:(UIColor *)color; 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Factories/JSQMessagesMediaViewBubbleImageMasker.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import 20 | #import 21 | 22 | @class JSQMessagesBubbleImageFactory; 23 | 24 | /** 25 | * An instance of `JSQMessagesMediaViewBubbleImageMasker` is an object that masks 26 | * media views for a `JSQMessageMediaData` object. Given a view, it will mask the view 27 | * with a bubble image for an outgoing or incoming media view. 28 | * 29 | * @see JSQMessageMediaData. 30 | * @see JSQMessagesBubbleImageFactory. 31 | * @see JSQMessagesBubbleImage. 32 | */ 33 | @interface JSQMessagesMediaViewBubbleImageMasker : NSObject 34 | 35 | /** 36 | * Returns the bubble image factory that the masker uses to mask media views. 37 | */ 38 | @property (strong, nonatomic, readonly) JSQMessagesBubbleImageFactory *bubbleImageFactory; 39 | 40 | /** 41 | * Creates and returns a new instance of `JSQMessagesMediaViewBubbleImageMasker` 42 | * that uses a default instance of `JSQMessagesBubbleImageFactory`. The masker uses the `JSQMessagesBubbleImage` 43 | * objects returned by the factory to mask media views. 44 | * 45 | * @return An initialized `JSQMessagesMediaViewBubbleImageMasker` object if created successfully, `nil` otherwise. 46 | * 47 | * @see JSQMessagesBubbleImageFactory. 48 | * @see JSQMessagesBubbleImage. 49 | */ 50 | - (instancetype)init; 51 | 52 | /** 53 | * Creates and returns a new instance of `JSQMessagesMediaViewBubbleImageMasker` 54 | * having the specified bubbleImageFactory. The masker uses the `JSQMessagesBubbleImage` 55 | * objects returned by the factory to mask media views. 56 | * 57 | * @param bubbleImageFactory An initialized `JSQMessagesBubbleImageFactory` object to use for masking media views. This value must not be `nil`. 58 | * 59 | * @return An initialized `JSQMessagesMediaViewBubbleImageMasker` object if created successfully, `nil` otherwise. 60 | * 61 | * @see JSQMessagesBubbleImageFactory. 62 | * @see JSQMessagesBubbleImage. 63 | */ 64 | - (instancetype)initWithBubbleImageFactory:(JSQMessagesBubbleImageFactory *)bubbleImageFactory NS_DESIGNATED_INITIALIZER; 65 | 66 | /** 67 | * Applies an outgoing bubble image mask to the specified mediaView. 68 | * 69 | * @param mediaView The media view to mask. 70 | */ 71 | - (void)applyOutgoingBubbleImageMaskToMediaView:(UIView *)mediaView; 72 | 73 | /** 74 | * Applies an incoming bubble image mask to the specified mediaView. 75 | * 76 | * @param mediaView The media view to mask. 77 | */ 78 | - (void)applyIncomingBubbleImageMaskToMediaView:(UIView *)mediaView; 79 | 80 | /** 81 | * A convenience method for applying a bubble image mask to the specified mediaView. 82 | * This method uses the default instance of `JSQMessagesBubbleImageFactory`. 83 | * 84 | * @param mediaView The media view to mask. 85 | * @param isOutgoing A boolean value specifiying whether or not the mask should be for an outgoing or incoming view. 86 | * Specify `YES` for outgoing and `NO` for incoming. 87 | */ 88 | + (void)applyBubbleImageMaskToMediaView:(UIView *)mediaView isOutgoing:(BOOL)isOutgoing; 89 | 90 | @end 91 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Factories/JSQMessagesMediaViewBubbleImageMasker.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import "JSQMessagesMediaViewBubbleImageMasker.h" 20 | 21 | #import "JSQMessagesBubbleImageFactory.h" 22 | 23 | 24 | @implementation JSQMessagesMediaViewBubbleImageMasker 25 | 26 | #pragma mark - Initialization 27 | 28 | - (instancetype)init 29 | { 30 | return [self initWithBubbleImageFactory:[[JSQMessagesBubbleImageFactory alloc] init]]; 31 | } 32 | 33 | - (instancetype)initWithBubbleImageFactory:(JSQMessagesBubbleImageFactory *)bubbleImageFactory 34 | { 35 | NSParameterAssert(bubbleImageFactory != nil); 36 | 37 | self = [super init]; 38 | if (self) { 39 | _bubbleImageFactory = bubbleImageFactory; 40 | } 41 | return self; 42 | } 43 | 44 | #pragma mark - View masking 45 | 46 | - (void)applyOutgoingBubbleImageMaskToMediaView:(UIView *)mediaView 47 | { 48 | JSQMessagesBubbleImage *bubbleImageData = [self.bubbleImageFactory outgoingMessagesBubbleImageWithColor:[UIColor whiteColor]]; 49 | [self jsq_maskView:mediaView withImage:[bubbleImageData messageBubbleImage]]; 50 | } 51 | 52 | - (void)applyIncomingBubbleImageMaskToMediaView:(UIView *)mediaView 53 | { 54 | JSQMessagesBubbleImage *bubbleImageData = [self.bubbleImageFactory incomingMessagesBubbleImageWithColor:[UIColor whiteColor]]; 55 | [self jsq_maskView:mediaView withImage:[bubbleImageData messageBubbleImage]]; 56 | } 57 | 58 | + (void)applyBubbleImageMaskToMediaView:(UIView *)mediaView isOutgoing:(BOOL)isOutgoing 59 | { 60 | JSQMessagesMediaViewBubbleImageMasker *masker = [[JSQMessagesMediaViewBubbleImageMasker alloc] init]; 61 | 62 | if (isOutgoing) { 63 | [masker applyOutgoingBubbleImageMaskToMediaView:mediaView]; 64 | } 65 | else { 66 | [masker applyIncomingBubbleImageMaskToMediaView:mediaView]; 67 | } 68 | } 69 | 70 | #pragma mark - Private 71 | 72 | - (void)jsq_maskView:(UIView *)view withImage:(UIImage *)image 73 | { 74 | NSParameterAssert(view != nil); 75 | NSParameterAssert(image != nil); 76 | 77 | UIImageView *imageViewMask = [[UIImageView alloc] initWithImage:image]; 78 | imageViewMask.frame = CGRectInset(view.frame, 2.0f, 2.0f); 79 | 80 | view.layer.mask = imageViewMask.layer; 81 | } 82 | 83 | @end 84 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Factories/JSQMessagesTimestampFormatter.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import 20 | #import 21 | 22 | /** 23 | * An instance of `JSQMessagesTimestampFormatter` is a singleton object that provides an efficient means 24 | * for creating attributed and non-attributed string representations of `NSDate` objects. 25 | * It is intended to be used as the method by which you display timestamps in a `JSQMessagesCollectionView`. 26 | */ 27 | @interface JSQMessagesTimestampFormatter : NSObject 28 | 29 | /** 30 | * Returns the cached date formatter object used by the `JSQMessagesTimestampFormatter` shared instance. 31 | */ 32 | @property (strong, nonatomic, readonly) NSDateFormatter *dateFormatter; 33 | 34 | /** 35 | * The text attributes to apply to the day, month, and year components of the string representation of a given date. 36 | * The default value is a dictionary containing attributes that specify centered, light gray text and the bold system font at size `12.0f`. 37 | */ 38 | @property (copy, nonatomic) NSDictionary *dateTextAttributes; 39 | 40 | /** 41 | * The text attributes to apply to the minute and hour componenents of the string representation of a given date. 42 | * The default value is a dictionary containing attributes that specify centered, light gray text and the system font at size `12.0f`. 43 | */ 44 | @property (copy, nonatomic) NSDictionary *timeTextAttributes; 45 | 46 | /** 47 | * Returns the shared timestamp formatter object. 48 | * 49 | * @return The shared timestamp formatter object. 50 | */ 51 | + (JSQMessagesTimestampFormatter *)sharedFormatter; 52 | 53 | /** 54 | * Returns a string representation of the given date formatted in the current locale using `NSDateFormatterMediumStyle` for the date style 55 | * and `NSDateFormatterShortStyle` for the time style. It uses relative date formatting where possible. 56 | * 57 | * @param date The date to format. 58 | * 59 | * @return A formatted string representation of date. 60 | */ 61 | - (NSString *)timestampForDate:(NSDate *)date; 62 | 63 | /** 64 | * Returns an attributed string representation of the given date formatted as described in `timestampForDate:`. 65 | * It applies the attributes in `dateTextAttributes` and `timeTextAttributes`, respectively. 66 | * 67 | * @param date The date to format. 68 | * 69 | * @return A formatted, attributed string representation of date. 70 | * 71 | * @see `timestampForDate:`. 72 | * @see `dateTextAttributes`. 73 | * @see `timeTextAttributes`. 74 | */ 75 | - (NSAttributedString *)attributedTimestampForDate:(NSDate *)date; 76 | 77 | /** 78 | * Returns a string representation of *only* the minute and hour components of the given date formatted in the current locale styled using `NSDateFormatterShortStyle`. 79 | * 80 | * @param date The date to format. 81 | * 82 | * @return A formatted string representation of the minute and hour components of date. 83 | */ 84 | - (NSString *)timeForDate:(NSDate *)date; 85 | 86 | /** 87 | * Returns a string representation of *only* the day, month, and year components of the given date formatted in the current locale styled using `NSDateFormatterMediumStyle`. 88 | * 89 | * @param date The date to format. 90 | * 91 | * @return A formatted string representation of the day, month, and year components of date. 92 | */ 93 | - (NSString *)relativeDateForDate:(NSDate *)date; 94 | 95 | @end 96 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Factories/JSQMessagesToolbarButtonFactory.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import 20 | #import 21 | 22 | /** 23 | * `JSQMessagesToolbarButtonFactory` is a factory that provides a means for creating the default 24 | * toolbar button items to be displayed in the content view of a `JSQMessagesInputToolbar`. 25 | */ 26 | @interface JSQMessagesToolbarButtonFactory : NSObject 27 | 28 | /** 29 | * Creates and returns a new button that is styled as the default accessory button. 30 | * The button has a paper clip icon image and no text. 31 | * 32 | * @return A newly created button. 33 | */ 34 | + (UIButton *)defaultAccessoryButtonItem; 35 | 36 | /** 37 | * Creates and returns a new button that is styled as the default send button. 38 | * The button has title text `@"Send"` and no image. 39 | * 40 | * @return A newly created button. 41 | */ 42 | + (UIButton *)defaultSendButtonItem; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Factories/JSQMessagesToolbarButtonFactory.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import "JSQMessagesToolbarButtonFactory.h" 20 | 21 | #import "UIColor+JSQMessages.h" 22 | #import "UIImage+JSQMessages.h" 23 | #import "NSBundle+JSQMessages.h" 24 | 25 | 26 | @implementation JSQMessagesToolbarButtonFactory 27 | 28 | + (UIButton *)defaultAccessoryButtonItem 29 | { 30 | UIImage *accessoryImage = [UIImage jsq_defaultAccessoryImage]; 31 | UIImage *normalImage = [accessoryImage jsq_imageMaskedWithColor:[UIColor lightGrayColor]]; 32 | UIImage *highlightedImage = [accessoryImage jsq_imageMaskedWithColor:[UIColor darkGrayColor]]; 33 | 34 | UIButton *accessoryButton = [[UIButton alloc] initWithFrame:CGRectMake(0.0f, 0.0f, accessoryImage.size.width, 32.0f)]; 35 | [accessoryButton setImage:normalImage forState:UIControlStateNormal]; 36 | [accessoryButton setImage:highlightedImage forState:UIControlStateHighlighted]; 37 | 38 | accessoryButton.contentMode = UIViewContentModeScaleAspectFit; 39 | accessoryButton.backgroundColor = [UIColor clearColor]; 40 | accessoryButton.tintColor = [UIColor lightGrayColor]; 41 | 42 | accessoryButton.accessibilityLabel = [NSBundle jsq_localizedStringForKey:@"accessory_button_accessibility_label"]; 43 | 44 | return accessoryButton; 45 | } 46 | 47 | + (UIButton *)defaultSendButtonItem 48 | { 49 | NSString *sendTitle = [NSBundle jsq_localizedStringForKey:@"send"]; 50 | 51 | UIButton *sendButton = [[UIButton alloc] initWithFrame:CGRectZero]; 52 | [sendButton setTitle:sendTitle forState:UIControlStateNormal]; 53 | [sendButton setTitleColor:[UIColor jsq_messageBubbleBlueColor] forState:UIControlStateNormal]; 54 | [sendButton setTitleColor:[[UIColor jsq_messageBubbleBlueColor] jsq_colorByDarkeningColorWithValue:0.1f] forState:UIControlStateHighlighted]; 55 | [sendButton setTitleColor:[UIColor lightGrayColor] forState:UIControlStateDisabled]; 56 | 57 | sendButton.titleLabel.font = [UIFont boldSystemFontOfSize:17.0f]; 58 | sendButton.titleLabel.adjustsFontSizeToFitWidth = YES; 59 | sendButton.titleLabel.minimumScaleFactor = 0.85f; 60 | sendButton.contentMode = UIViewContentModeCenter; 61 | sendButton.backgroundColor = [UIColor clearColor]; 62 | sendButton.tintColor = [UIColor jsq_messageBubbleBlueColor]; 63 | 64 | CGFloat maxHeight = 32.0f; 65 | 66 | CGRect sendTitleRect = [sendTitle boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, maxHeight) 67 | options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading 68 | attributes:@{ NSFontAttributeName : sendButton.titleLabel.font } 69 | context:nil]; 70 | 71 | sendButton.frame = CGRectMake(0.0f, 72 | 0.0f, 73 | CGRectGetWidth(CGRectIntegral(sendTitleRect)), 74 | maxHeight); 75 | 76 | return sendButton; 77 | } 78 | 79 | @end 80 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/JSQMessages.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #ifndef JSQMessages_JSQMessages_h 20 | #define JSQMessages_JSQMessages_h 21 | 22 | #import "JSQMessagesViewController.h" 23 | 24 | // Views 25 | #import "JSQMessagesCollectionView.h" 26 | #import "JSQMessagesCollectionViewCellIncoming.h" 27 | #import "JSQMessagesCollectionViewCellOutgoing.h" 28 | #import "JSQMessagesTypingIndicatorFooterView.h" 29 | #import "JSQMessagesLoadEarlierHeaderView.h" 30 | 31 | // Layout 32 | #import "JSQMessagesBubbleSizeCalculating.h" 33 | #import "JSQMessagesBubblesSizeCalculator.h" 34 | #import "JSQMessagesCollectionViewFlowLayout.h" 35 | #import "JSQMessagesCollectionViewLayoutAttributes.h" 36 | #import "JSQMessagesCollectionViewFlowLayoutInvalidationContext.h" 37 | #import "JSQAudioMediaViewAttributes.h" 38 | 39 | // Toolbar 40 | #import "JSQMessagesComposerTextView.h" 41 | #import "JSQMessagesInputToolbar.h" 42 | #import "JSQMessagesToolbarContentView.h" 43 | 44 | // Model 45 | #import "JSQMessage.h" 46 | 47 | #import "JSQMediaItem.h" 48 | #import "JSQAudioMediaItem.h" 49 | #import "JSQPhotoMediaItem.h" 50 | #import "JSQLocationMediaItem.h" 51 | #import "JSQVideoMediaItem.h" 52 | 53 | #import "JSQMessagesBubbleImage.h" 54 | #import "JSQMessagesAvatarImage.h" 55 | 56 | #import "JSQAudioMediaViewAttributes.h" 57 | 58 | // Protocols 59 | #import "JSQMessageData.h" 60 | #import "JSQMessageMediaData.h" 61 | #import "JSQMessageAvatarImageDataSource.h" 62 | #import "JSQMessageBubbleImageDataSource.h" 63 | #import "JSQMessagesCollectionViewDataSource.h" 64 | #import "JSQMessagesCollectionViewDelegateFlowLayout.h" 65 | 66 | // Factories 67 | #import "JSQMessagesAvatarImageFactory.h" 68 | #import "JSQMessagesBubbleImageFactory.h" 69 | #import "JSQMessagesMediaViewBubbleImageMasker.h" 70 | #import "JSQMessagesTimestampFormatter.h" 71 | #import "JSQMessagesToolbarButtonFactory.h" 72 | 73 | // Categories 74 | #import "JSQSystemSoundPlayer+JSQMessages.h" 75 | #import "NSString+JSQMessages.h" 76 | #import "UIColor+JSQMessages.h" 77 | #import "UIImage+JSQMessages.h" 78 | #import "UIView+JSQMessages.h" 79 | #import "NSBundle+JSQMessages.h" 80 | 81 | #endif 82 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Layout/JSQMessagesBubbleSizeCalculating.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import 20 | #import 21 | 22 | @class JSQMessagesCollectionViewFlowLayout; 23 | @protocol JSQMessageData; 24 | 25 | /** 26 | * The `JSQMessagesBubbleSizeCalculating` protocol defines the common interface through which 27 | * an object provides layout information to an instance of `JSQMessagesCollectionViewFlowLayout`. 28 | * 29 | * A concrete class that conforms to this protocol is provided in the library. 30 | * See `JSQMessagesBubbleSizeCalculator`. 31 | */ 32 | @protocol JSQMessagesBubbleSizeCalculating 33 | 34 | /** 35 | * Computes and returns the size of the `messageBubbleImageView` property 36 | * of a `JSQMessagesCollectionViewCell` for the specified messageData at indexPath. 37 | * 38 | * @param messageData A message data object. 39 | * @param indexPath The index path at which messageData is located. 40 | * @param layout The layout object asking for this information. 41 | * 42 | * @return A sizes that specifies the required dimensions to display the entire message contents. 43 | * Note, this is *not* the entire cell, but only its message bubble. 44 | */ 45 | - (CGSize)messageBubbleSizeForMessageData:(id)messageData 46 | atIndexPath:(NSIndexPath *)indexPath 47 | withLayout:(JSQMessagesCollectionViewFlowLayout *)layout; 48 | 49 | /** 50 | * Notifies the receiver that the layout will be reset. 51 | * Use this method to clear any cached layout information, if necessary. 52 | * 53 | * @param layout The layout object notifying the receiver. 54 | */ 55 | - (void)prepareForResettingLayout:(JSQMessagesCollectionViewFlowLayout *)layout; 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Layout/JSQMessagesBubblesSizeCalculator.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import 20 | 21 | #import "JSQMessagesBubbleSizeCalculating.h" 22 | 23 | /** 24 | * An instance of `JSQMessagesBubblesSizeCalculator` is responsible for calculating 25 | * message bubble sizes for an instance of `JSQMessagesCollectionViewFlowLayout`. 26 | */ 27 | @interface JSQMessagesBubblesSizeCalculator : NSObject 28 | 29 | /** 30 | * Initializes and returns a bubble size calculator with the given cache and minimumBubbleWidth. 31 | * 32 | * @param cache A cache object used to store layout information. 33 | * @param minimumBubbleWidth The minimum width for any given message bubble. 34 | * @param usesFixedWidthBubbles Specifies whether or not to use fixed-width bubbles. 35 | * If `NO` (the default), then bubbles will resize when rotating to landscape. 36 | * 37 | * @return An initialized `JSQMessagesBubblesSizeCalculator` object if successful, `nil` otherwise. 38 | */ 39 | - (instancetype)initWithCache:(NSCache *)cache 40 | minimumBubbleWidth:(NSUInteger)minimumBubbleWidth 41 | usesFixedWidthBubbles:(BOOL)usesFixedWidthBubbles NS_DESIGNATED_INITIALIZER; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Layout/JSQMessagesCollectionViewFlowLayoutInvalidationContext.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import 20 | 21 | /** 22 | * A `JSQMessagesCollectionViewFlowLayoutInvalidationContext` object specifies properties for 23 | * determining whether to recompute the size of items or their position in the layout. 24 | * The flow layout object creates instances of this class when it needs to invalidate its contents 25 | * in response to changes. You can also create instances when invalidating the flow layout manually. 26 | * 27 | */ 28 | @interface JSQMessagesCollectionViewFlowLayoutInvalidationContext : UICollectionViewFlowLayoutInvalidationContext 29 | 30 | /** 31 | * A boolean indicating whether to empty the messages layout information cache for items and views in the layout. 32 | * The default value is `NO`. 33 | */ 34 | @property (nonatomic, assign) BOOL invalidateFlowLayoutMessagesCache; 35 | 36 | /** 37 | * Creates and returns a new `JSQMessagesCollectionViewFlowLayoutInvalidationContext` object. 38 | * 39 | * @discussion When you need to invalidate the `JSQMessagesCollectionViewFlowLayout` object for your 40 | * `JSQMessagesViewController` subclass, you should use this method to instantiate a new invalidation 41 | * context and pass this object to `invalidateLayoutWithContext:`. 42 | * 43 | * @return An initialized invalidation context object if successful, otherwise `nil`. 44 | */ 45 | + (instancetype)context; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Layout/JSQMessagesCollectionViewFlowLayoutInvalidationContext.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import "JSQMessagesCollectionViewFlowLayoutInvalidationContext.h" 20 | 21 | @implementation JSQMessagesCollectionViewFlowLayoutInvalidationContext 22 | 23 | #pragma mark - Initialization 24 | 25 | - (instancetype)init 26 | { 27 | self = [super init]; 28 | if (self) { 29 | self.invalidateFlowLayoutDelegateMetrics = NO; 30 | self.invalidateFlowLayoutAttributes = NO; 31 | _invalidateFlowLayoutMessagesCache = NO; 32 | } 33 | return self; 34 | } 35 | 36 | + (instancetype)context 37 | { 38 | JSQMessagesCollectionViewFlowLayoutInvalidationContext *context = [[JSQMessagesCollectionViewFlowLayoutInvalidationContext alloc] init]; 39 | context.invalidateFlowLayoutDelegateMetrics = YES; 40 | context.invalidateFlowLayoutAttributes = YES; 41 | return context; 42 | } 43 | 44 | #pragma mark - NSObject 45 | 46 | - (NSString *)description 47 | { 48 | return [NSString stringWithFormat:@"<%@: invalidateFlowLayoutDelegateMetrics=%@, invalidateFlowLayoutAttributes=%@, invalidateDataSourceCounts=%@, invalidateFlowLayoutMessagesCache=%@>", 49 | [self class], @(self.invalidateFlowLayoutDelegateMetrics), @(self.invalidateFlowLayoutAttributes), @(self.invalidateDataSourceCounts), @(self.invalidateFlowLayoutMessagesCache)]; 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Model/JSQLocationMediaItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import 20 | #import 21 | 22 | /** 23 | * A completion handler block for a `JSQLocationMediaItem`. See `setLocation: withCompletionHandler:`. 24 | */ 25 | typedef void (^JSQLocationMediaItemCompletionBlock)(void); 26 | 27 | 28 | #import "JSQMediaItem.h" 29 | 30 | /** 31 | * The `JSQLocationMediaItem` class is a concrete `JSQMediaItem` subclass that implements the `JSQMessageMediaData` protocol 32 | * and represents a location media message. An initialized `JSQLocationMediaItem` object can be passed 33 | * to a `JSQMediaMessage` object during its initialization to construct a valid media message object. 34 | * You may wish to subclass `JSQLocationMediaItem` to provide additional functionality or behavior. 35 | */ 36 | @interface JSQLocationMediaItem : JSQMediaItem 37 | 38 | /** 39 | * The location for the media item. The default value is `nil`. 40 | */ 41 | @property (copy, nonatomic) CLLocation *location; 42 | 43 | /** 44 | * The coordinate of the location property. 45 | */ 46 | @property (readonly, nonatomic) CLLocationCoordinate2D coordinate; 47 | 48 | /** 49 | * Initializes and returns a location media item object having the given location. 50 | * 51 | * @param location The location for the media item. This value may be `nil`. 52 | * 53 | * @return An initialized `JSQLocationMediaItem` if successful, `nil` otherwise. 54 | * 55 | * @discussion If the location data must be dowloaded from the network, 56 | * you may initialize a `JSQLocationMediaItem` object with a `nil` location. 57 | * Once the location data has been retrieved, you can then set the location property 58 | * using `setLocation: withCompletionHandler:` 59 | */ 60 | - (instancetype)initWithLocation:(CLLocation *)location; 61 | 62 | /** 63 | * Sets the specified location for the location media item and immediately begins creating 64 | * a map view snapshot image on a background thread. The map view zooms to a default region whose center point 65 | * is the location coordinate and whose span is 500 meters for both the latitudinal and longitudinal meters. 66 | * 67 | * The specified block is executed upon completion of creating the snapshot image and is executed on the app’s main thread. 68 | * 69 | * @param location The location for the media item. 70 | * @param completion The block to call after the map view snapshot for the given location has been created. 71 | */ 72 | - (void)setLocation:(CLLocation *)location withCompletionHandler:(JSQLocationMediaItemCompletionBlock)completion; 73 | 74 | /** 75 | * Sets the specified location for the location media item and immediately begins creating 76 | * a map view snapshot image on a background thread. 77 | * 78 | * The specified block is executed upon completion of creating the snapshot image and is executed on the app’s main thread. 79 | * 80 | * @param location The location for the media item. 81 | * @param region The map region that you want to capture. 82 | * @param completion The block to call after the map view snapshot for the given location has been created. 83 | */ 84 | - (void)setLocation:(CLLocation *)location 85 | region:(MKCoordinateRegion)region withCompletionHandler:(JSQLocationMediaItemCompletionBlock)completion; 86 | @end 87 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Model/JSQMediaItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import "JSQMessageMediaData.h" 20 | 21 | /** 22 | * The `JSQMediaItem` class is an abstract base class for media item model objects that represents 23 | * a single media attachment for a user message. It provides some default behavior for media items, 24 | * including a default mediaViewDisplaySize, a default mediaPlaceholderView, and view masking as 25 | * specified by appliesMediaViewMaskAsOutgoing. 26 | * 27 | * @warning This class is intended to be subclassed. You should not use it directly. 28 | * 29 | * @see JSQLocationMediaItem. 30 | * @see JSQPhotoMediaItem. 31 | * @see JSQVideoMediaItem. 32 | */ 33 | @interface JSQMediaItem : NSObject 34 | 35 | /** 36 | * A boolean value indicating whether this media item should apply 37 | * an outgoing or incoming bubble image mask to its media views. 38 | * Specify `YES` for an outgoing mask, and `NO` for an incoming mask. 39 | * The default value is `YES`. 40 | */ 41 | @property (assign, nonatomic) BOOL appliesMediaViewMaskAsOutgoing; 42 | 43 | /** 44 | * Initializes and returns a media item with the specified value for maskAsOutgoing. 45 | * 46 | * @param maskAsOutgoing A boolean value indicating whether this media item should apply 47 | * an outgoing or incoming bubble image mask to its media views. 48 | * 49 | * @return An initialized `JSQMediaItem` object if successful, `nil` otherwise. 50 | */ 51 | - (instancetype)initWithMaskAsOutgoing:(BOOL)maskAsOutgoing; 52 | 53 | /** 54 | * Clears any media view or media placeholder view that the item has cached. 55 | */ 56 | - (void)clearCachedMediaViews; 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Model/JSQMessageAvatarImageDataSource.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import 20 | #import 21 | 22 | /** 23 | * The `JSQMessageAvatarImageDataSource` protocol defines the common interface through which 24 | * a `JSQMessagesViewController` and `JSQMessagesCollectionView` interact with avatar image model objects. 25 | * 26 | * It declares the required and optional methods that a class must implement so that instances 27 | * of that class can be display properly within a `JSQMessagesCollectionViewCell`. 28 | * 29 | * A concrete class that conforms to this protocol is provided in the library. See `JSQMessagesAvatarImage`. 30 | * 31 | * @see JSQMessagesAvatarImage. 32 | */ 33 | @protocol JSQMessageAvatarImageDataSource 34 | 35 | @required 36 | 37 | /** 38 | * @return The avatar image for a regular display state. 39 | * 40 | * @discussion You may return `nil` from this method while the image is being downloaded. 41 | */ 42 | - (UIImage *)avatarImage; 43 | 44 | /** 45 | * @return The avatar image for a highlighted display state. 46 | * 47 | * @discussion You may return `nil` from this method if this does not apply. 48 | */ 49 | - (UIImage *)avatarHighlightedImage; 50 | 51 | /** 52 | * @return A placeholder avatar image to be displayed if avatarImage is not yet available, or `nil`. 53 | * For example, if avatarImage needs to be downloaded, this placeholder image 54 | * will be used until avatarImage is not `nil`. 55 | * 56 | * @discussion If you do not need support for a placeholder image, that is, your images 57 | * are stored locally on the device, then you may simply return the same value as avatarImage here. 58 | * 59 | * @warning You must not return `nil` from this method. 60 | */ 61 | - (UIImage *)avatarPlaceholderImage; 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Model/JSQMessageBubbleImageDataSource.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import 20 | #import 21 | 22 | /** 23 | * The `JSQMessageBubbleImageDataSource` protocol defines the common interface through which 24 | * a `JSQMessagesViewController` and `JSQMessagesCollectionView` interact with 25 | * message bubble image model objects. 26 | * 27 | * It declares the required and optional methods that a class must implement so that instances 28 | * of that class can be display properly within a `JSQMessagesCollectionViewCell`. 29 | * 30 | * A concrete class that conforms to this protocol is provided in the library. See `JSQMessagesBubbleImage`. 31 | * 32 | * @see JSQMessagesBubbleImage. 33 | */ 34 | @protocol JSQMessageBubbleImageDataSource 35 | 36 | @required 37 | 38 | /** 39 | * @return The message bubble image for a regular display state. 40 | * 41 | * @warning You must not return `nil` from this method. 42 | */ 43 | - (UIImage *)messageBubbleImage; 44 | 45 | /** 46 | * @return The message bubble image for a highlighted display state. 47 | * 48 | * @warning You must not return `nil` from this method. 49 | */ 50 | - (UIImage *)messageBubbleHighlightedImage; 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Model/JSQMessageData.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import 20 | 21 | #import "JSQMessageMediaData.h" 22 | 23 | /** 24 | * The `JSQMessageData` protocol defines the common interface through which 25 | * a `JSQMessagesViewController` and `JSQMessagesCollectionView` interact with message model objects. 26 | * 27 | * It declares the required and optional methods that a class must implement so that instances of that class 28 | * can be displayed properly within a `JSQMessagesCollectionViewCell`. 29 | * 30 | * The class that conforms to this protocol is provided in the library. See `JSQMessage`. 31 | * 32 | * @see JSQMessage. 33 | */ 34 | @protocol JSQMessageData 35 | 36 | @required 37 | 38 | /** 39 | * @return A string identifier that uniquely identifies the user who sent the message. 40 | * 41 | * @discussion If you need to generate a unique identifier, consider using 42 | * `[[NSProcessInfo processInfo] globallyUniqueString]` 43 | * 44 | * @warning You must not return `nil` from this method. This value must be unique. 45 | */ 46 | - (NSString *)senderId; 47 | 48 | /** 49 | * @return The display name for the user who sent the message. 50 | * 51 | * @warning You must not return `nil` from this method. 52 | */ 53 | - (NSString *)senderDisplayName; 54 | 55 | /** 56 | * @return The date that the message was sent. 57 | * 58 | * @warning You must not return `nil` from this method. 59 | */ 60 | - (NSDate *)date; 61 | 62 | /** 63 | * This method is used to determine if the message data item contains text or media. 64 | * If this method returns `YES`, an instance of `JSQMessagesViewController` will ignore 65 | * the `text` method of this protocol when dequeuing a `JSQMessagesCollectionViewCell` 66 | * and only call the `media` method. 67 | * 68 | * Similarly, if this method returns `NO` then the `media` method will be ignored and 69 | * and only the `text` method will be called. 70 | * 71 | * @return A boolean value specifying whether or not this is a media message or a text message. 72 | * Return `YES` if this item is a media message, and `NO` if it is a text message. 73 | */ 74 | - (BOOL)isMediaMessage; 75 | 76 | /** 77 | * @return An integer that can be used as a table address in a hash table structure. 78 | * 79 | * @discussion This value must be unique for each message with distinct contents. 80 | * This value is used to cache layout information in the collection view. 81 | */ 82 | - (NSUInteger)messageHash; 83 | 84 | @optional 85 | 86 | /** 87 | * @return The body text of the message. 88 | * 89 | * @warning You must not return `nil` from this method. 90 | */ 91 | - (NSString *)text; 92 | 93 | /** 94 | * @return The media item of the message. 95 | * 96 | * @warning You must not return `nil` from this method. 97 | */ 98 | - (id)media; 99 | 100 | @end 101 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Model/JSQMessageMediaData.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import 20 | #import 21 | 22 | /** 23 | * The `JSQMessageMediaData` protocol defines the common interface through which 24 | * a `JSQMessagesViewController` and `JSQMessagesCollectionView` interact with media message model objects. 25 | * 26 | * It declares the required and optional methods that a class must implement so that instances of that class 27 | * can be displayed properly within a `JSQMessagesCollectionViewCell`. 28 | * 29 | * This library provides a few concrete classes that conform to this protocol. You may use them as-is, 30 | * but they will likely require some modifications or extensions to conform to your particular data models. 31 | * These concrete media items are: `JSQPhotoMediaItem`, `JSQLocationMediaItem`, `JSQVideoMediaItem`. 32 | * 33 | * @see JSQPhotoMediaItem. 34 | * @see JSQLocationMediaItem. 35 | * @see JSQVideoMediaItem. 36 | */ 37 | @protocol JSQMessageMediaData 38 | 39 | @required 40 | 41 | /** 42 | * @return An initialized `UIView` object that represents the data for this media object. 43 | * 44 | * @discussion You may return `nil` from this method while the media data is being downloaded. 45 | */ 46 | - (UIView *)mediaView; 47 | 48 | /** 49 | * @return The frame size for the mediaView when displayed in a `JSQMessagesCollectionViewCell`. 50 | * 51 | * @discussion You should return an appropriate size value to be set for the mediaView's frame 52 | * based on the contents of the view, and the frame and layout of the `JSQMessagesCollectionViewCell` 53 | * in which mediaView will be displayed. 54 | * 55 | * @warning You must return a size with non-zero, positive width and height values. 56 | */ 57 | - (CGSize)mediaViewDisplaySize; 58 | 59 | /** 60 | * @return A placeholder media view to be displayed if mediaView is not yet available, or `nil`. 61 | * For example, if mediaView will be constructed based on media data that must be downloaded, 62 | * this placeholder view will be used until mediaView is not `nil`. 63 | * 64 | * @discussion If you do not need support for a placeholder view, then you may simply return the 65 | * same value here as mediaView. Otherwise, consider using `JSQMessagesMediaPlaceholderView`. 66 | * 67 | * @warning You must not return `nil` from this method. 68 | * 69 | * @see JSQMessagesMediaPlaceholderView. 70 | */ 71 | - (UIView *)mediaPlaceholderView; 72 | 73 | /** 74 | * @return An integer that can be used as a table address in a hash table structure. 75 | * 76 | * @discussion This value must be unique for each media item with distinct contents. 77 | * This value is used to cache layout information in the collection view. 78 | */ 79 | - (NSUInteger)mediaHash; 80 | 81 | @end 82 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Model/JSQMessagesAvatarImage.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import 20 | #import 21 | 22 | #import "JSQMessageAvatarImageDataSource.h" 23 | 24 | /** 25 | * A `JSQMessagesAvatarImage` model object represents an avatar image. 26 | * This is a concrete class that implements the `JSQMessageAvatarImageDataSource` protocol. 27 | * It contains a regular avatar image, a highlighted avatar image, and a placeholder avatar image. 28 | * 29 | * @see JSQMessagesAvatarImageFactory. 30 | */ 31 | @interface JSQMessagesAvatarImage : NSObject 32 | 33 | /** 34 | * The avatar image for a regular display state. 35 | */ 36 | @property (nonatomic, strong) UIImage *avatarImage; 37 | 38 | /** 39 | * The avatar image for a highlighted display state. 40 | */ 41 | @property (nonatomic, strong) UIImage *avatarHighlightedImage; 42 | 43 | /** 44 | * Returns the placeholder image for an avatar to display if avatarImage is `nil`. 45 | */ 46 | @property (nonatomic, strong, readonly) UIImage *avatarPlaceholderImage; 47 | 48 | /** 49 | * Initializes and returns an avatar image object having the specified image. 50 | * 51 | * @param image The image for this avatar image. This image will be used for the all of the following 52 | * properties: avatarImage, avatarHighlightedImage, avatarPlaceholderImage; 53 | * This value must not be `nil`. 54 | * 55 | * @return An initialized `JSQMessagesAvatarImage` object if successful, `nil` otherwise. 56 | */ 57 | + (instancetype)avatarWithImage:(UIImage *)image; 58 | 59 | /** 60 | * Initializes and returns an avatar image object having the specified placeholder image. 61 | * 62 | * @param placeholderImage The placeholder image for this avatar image. This value must not be `nil`. 63 | * 64 | * @return An initialized `JSQMessagesAvatarImage` object if successful, `nil` otherwise. 65 | */ 66 | + (instancetype)avatarImageWithPlaceholder:(UIImage *)placeholderImage; 67 | 68 | /** 69 | * Initializes and returns an avatar image object having the specified regular, highlighed, and placeholder images. 70 | * 71 | * @param avatarImage The avatar image for a regular display state. 72 | * @param highlightedImage The avatar image for a highlighted display state. 73 | * @param placeholderImage The placeholder image for this avatar image. This value must not be `nil`. 74 | * 75 | * @return An initialized `JSQMessagesAvatarImage` object if successful, `nil` otherwise. 76 | */ 77 | - (instancetype)initWithAvatarImage:(UIImage *)avatarImage 78 | highlightedImage:(UIImage *)highlightedImage 79 | placeholderImage:(UIImage *)placeholderImage NS_DESIGNATED_INITIALIZER; 80 | 81 | /** 82 | * Not a valid initializer. 83 | */ 84 | - (id)init NS_UNAVAILABLE; 85 | 86 | @end 87 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Model/JSQMessagesAvatarImage.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import "JSQMessagesAvatarImage.h" 20 | 21 | @implementation JSQMessagesAvatarImage 22 | 23 | #pragma mark - Initialization 24 | 25 | + (instancetype)avatarWithImage:(UIImage *)image 26 | { 27 | NSParameterAssert(image != nil); 28 | 29 | return [[JSQMessagesAvatarImage alloc] initWithAvatarImage:image 30 | highlightedImage:image 31 | placeholderImage:image]; 32 | } 33 | 34 | + (instancetype)avatarImageWithPlaceholder:(UIImage *)placeholderImage 35 | { 36 | return [[JSQMessagesAvatarImage alloc] initWithAvatarImage:nil 37 | highlightedImage:nil 38 | placeholderImage:placeholderImage]; 39 | } 40 | 41 | - (instancetype)initWithAvatarImage:(UIImage *)avatarImage 42 | highlightedImage:(UIImage *)highlightedImage 43 | placeholderImage:(UIImage *)placeholderImage 44 | { 45 | NSParameterAssert(placeholderImage != nil); 46 | 47 | self = [super init]; 48 | if (self) { 49 | _avatarImage = avatarImage; 50 | _avatarHighlightedImage = highlightedImage; 51 | _avatarPlaceholderImage = placeholderImage; 52 | } 53 | return self; 54 | } 55 | 56 | #pragma mark - NSObject 57 | 58 | - (NSString *)description 59 | { 60 | return [NSString stringWithFormat:@"<%@: avatarImage=%@, avatarHighlightedImage=%@, avatarPlaceholderImage=%@>", 61 | [self class], self.avatarImage, self.avatarHighlightedImage, self.avatarPlaceholderImage]; 62 | } 63 | 64 | - (id)debugQuickLookObject 65 | { 66 | return [[UIImageView alloc] initWithImage:self.avatarImage ?: self.avatarPlaceholderImage]; 67 | } 68 | 69 | #pragma mark - NSCopying 70 | 71 | - (instancetype)copyWithZone:(NSZone *)zone 72 | { 73 | return [[[self class] allocWithZone:zone] initWithAvatarImage:[UIImage imageWithCGImage:self.avatarImage.CGImage] 74 | highlightedImage:[UIImage imageWithCGImage:self.avatarHighlightedImage.CGImage] 75 | placeholderImage:[UIImage imageWithCGImage:self.avatarPlaceholderImage.CGImage]]; 76 | } 77 | 78 | @end 79 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Model/JSQMessagesBubbleImage.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import 20 | #import 21 | 22 | #import "JSQMessageBubbleImageDataSource.h" 23 | 24 | /** 25 | * A `JSQMessagesBubbleImage` model object represents a message bubble image, and is immutable. 26 | * This is a concrete class that implements the `JSQMessageBubbleImageDataSource` protocol. 27 | * It contains a regular message bubble image and a highlighted message bubble image. 28 | * 29 | * @see JSQMessagesBubbleImageFactory. 30 | */ 31 | @interface JSQMessagesBubbleImage : NSObject 32 | 33 | /** 34 | * Returns the message bubble image for a regular display state. 35 | */ 36 | @property (strong, nonatomic, readonly) UIImage *messageBubbleImage; 37 | 38 | /** 39 | * Returns the message bubble image for a highlighted display state. 40 | */ 41 | @property (strong, nonatomic, readonly) UIImage *messageBubbleHighlightedImage; 42 | 43 | /** 44 | * Initializes and returns a message bubble image object having the specified regular image and highlighted image. 45 | * 46 | * @param image The regular message bubble image. This value must not be `nil`. 47 | * @param highlightedImage The highlighted message bubble image. This value must not be `nil`. 48 | * 49 | * @return An initialized `JSQMessagesBubbleImage` object if successful, `nil` otherwise. 50 | * 51 | * @see JSQMessagesBubbleImageFactory. 52 | */ 53 | - (instancetype)initWithMessageBubbleImage:(UIImage *)image highlightedImage:(UIImage *)highlightedImage NS_DESIGNATED_INITIALIZER; 54 | 55 | /** 56 | * Not a valid initializer. 57 | */ 58 | - (id)init NS_UNAVAILABLE; 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Model/JSQMessagesBubbleImage.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import "JSQMessagesBubbleImage.h" 20 | 21 | @implementation JSQMessagesBubbleImage 22 | 23 | #pragma mark - Initialization 24 | 25 | - (instancetype)initWithMessageBubbleImage:(UIImage *)image highlightedImage:(UIImage *)highlightedImage 26 | { 27 | NSParameterAssert(image != nil); 28 | NSParameterAssert(highlightedImage != nil); 29 | 30 | self = [super init]; 31 | if (self) { 32 | _messageBubbleImage = image; 33 | _messageBubbleHighlightedImage = highlightedImage; 34 | } 35 | return self; 36 | } 37 | 38 | #pragma mark - NSObject 39 | 40 | - (NSString *)description 41 | { 42 | return [NSString stringWithFormat:@"<%@: messageBubbleImage=%@, messageBubbleHighlightedImage=%@>", 43 | [self class], self.messageBubbleImage, self.messageBubbleHighlightedImage]; 44 | } 45 | 46 | - (id)debugQuickLookObject 47 | { 48 | return [[UIImageView alloc] initWithImage:self.messageBubbleImage highlightedImage:self.messageBubbleHighlightedImage]; 49 | } 50 | 51 | #pragma mark - NSCopying 52 | 53 | - (instancetype)copyWithZone:(NSZone *)zone 54 | { 55 | return [[[self class] allocWithZone:zone] initWithMessageBubbleImage:[UIImage imageWithCGImage:self.messageBubbleImage.CGImage] 56 | highlightedImage:[UIImage imageWithCGImage:self.messageBubbleHighlightedImage.CGImage]]; 57 | } 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Model/JSQPhotoMediaItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import "JSQMediaItem.h" 20 | 21 | /** 22 | * The `JSQPhotoMediaItem` class is a concrete `JSQMediaItem` subclass that implements the `JSQMessageMediaData` protocol 23 | * and represents a photo media message. An initialized `JSQPhotoMediaItem` object can be passed 24 | * to a `JSQMediaMessage` object during its initialization to construct a valid media message object. 25 | * You may wish to subclass `JSQPhotoMediaItem` to provide additional functionality or behavior. 26 | */ 27 | @interface JSQPhotoMediaItem : JSQMediaItem 28 | 29 | /** 30 | * The image for the photo media item. The default value is `nil`. 31 | */ 32 | @property (copy, nonatomic) UIImage *image; 33 | 34 | /** 35 | * Initializes and returns a photo media item object having the given image. 36 | * 37 | * @param image The image for the photo media item. This value may be `nil`. 38 | * 39 | * @return An initialized `JSQPhotoMediaItem` if successful, `nil` otherwise. 40 | * 41 | * @discussion If the image must be dowloaded from the network, 42 | * you may initialize a `JSQPhotoMediaItem` object with a `nil` image. 43 | * Once the image has been retrieved, you can then set the image property. 44 | */ 45 | - (instancetype)initWithImage:(UIImage *)image; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Model/JSQPhotoMediaItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import "JSQPhotoMediaItem.h" 20 | 21 | #import "JSQMessagesMediaPlaceholderView.h" 22 | #import "JSQMessagesMediaViewBubbleImageMasker.h" 23 | 24 | 25 | @interface JSQPhotoMediaItem () 26 | 27 | @property (strong, nonatomic) UIImageView *cachedImageView; 28 | 29 | @end 30 | 31 | 32 | @implementation JSQPhotoMediaItem 33 | 34 | #pragma mark - Initialization 35 | 36 | - (instancetype)initWithImage:(UIImage *)image 37 | { 38 | self = [super init]; 39 | if (self) { 40 | _image = [image copy]; 41 | _cachedImageView = nil; 42 | } 43 | return self; 44 | } 45 | 46 | - (void)clearCachedMediaViews 47 | { 48 | [super clearCachedMediaViews]; 49 | _cachedImageView = nil; 50 | } 51 | 52 | #pragma mark - Setters 53 | 54 | - (void)setImage:(UIImage *)image 55 | { 56 | _image = [image copy]; 57 | _cachedImageView = nil; 58 | } 59 | 60 | - (void)setAppliesMediaViewMaskAsOutgoing:(BOOL)appliesMediaViewMaskAsOutgoing 61 | { 62 | [super setAppliesMediaViewMaskAsOutgoing:appliesMediaViewMaskAsOutgoing]; 63 | _cachedImageView = nil; 64 | } 65 | 66 | #pragma mark - JSQMessageMediaData protocol 67 | 68 | - (UIView *)mediaView 69 | { 70 | if (self.image == nil) { 71 | return nil; 72 | } 73 | 74 | if (self.cachedImageView == nil) { 75 | CGSize size = [self mediaViewDisplaySize]; 76 | UIImageView *imageView = [[UIImageView alloc] initWithImage:self.image]; 77 | imageView.frame = CGRectMake(0.0f, 0.0f, size.width, size.height); 78 | imageView.contentMode = UIViewContentModeScaleAspectFill; 79 | imageView.clipsToBounds = YES; 80 | [JSQMessagesMediaViewBubbleImageMasker applyBubbleImageMaskToMediaView:imageView isOutgoing:self.appliesMediaViewMaskAsOutgoing]; 81 | self.cachedImageView = imageView; 82 | } 83 | 84 | return self.cachedImageView; 85 | } 86 | 87 | - (NSUInteger)mediaHash 88 | { 89 | return self.hash; 90 | } 91 | 92 | #pragma mark - NSObject 93 | 94 | - (NSUInteger)hash 95 | { 96 | return super.hash ^ self.image.hash; 97 | } 98 | 99 | - (NSString *)description 100 | { 101 | return [NSString stringWithFormat:@"<%@: image=%@, appliesMediaViewMaskAsOutgoing=%@>", 102 | [self class], self.image, @(self.appliesMediaViewMaskAsOutgoing)]; 103 | } 104 | 105 | #pragma mark - NSCoding 106 | 107 | - (instancetype)initWithCoder:(NSCoder *)aDecoder 108 | { 109 | self = [super initWithCoder:aDecoder]; 110 | if (self) { 111 | _image = [aDecoder decodeObjectForKey:NSStringFromSelector(@selector(image))]; 112 | } 113 | return self; 114 | } 115 | 116 | - (void)encodeWithCoder:(NSCoder *)aCoder 117 | { 118 | [super encodeWithCoder:aCoder]; 119 | [aCoder encodeObject:self.image forKey:NSStringFromSelector(@selector(image))]; 120 | } 121 | 122 | #pragma mark - NSCopying 123 | 124 | - (instancetype)copyWithZone:(NSZone *)zone 125 | { 126 | JSQPhotoMediaItem *copy = [[JSQPhotoMediaItem allocWithZone:zone] initWithImage:self.image]; 127 | copy.appliesMediaViewMaskAsOutgoing = self.appliesMediaViewMaskAsOutgoing; 128 | return copy; 129 | } 130 | 131 | @end 132 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Model/JSQVideoMediaItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import "JSQMediaItem.h" 20 | 21 | /** 22 | * The `JSQVideoMediaItem` class is a concrete `JSQMediaItem` subclass that implements the `JSQMessageMediaData` protocol 23 | * and represents a video media message. An initialized `JSQVideoMediaItem` object can be passed 24 | * to a `JSQMediaMessage` object during its initialization to construct a valid media message object. 25 | * You may wish to subclass `JSQVideoMediaItem` to provide additional functionality or behavior. 26 | */ 27 | @interface JSQVideoMediaItem : JSQMediaItem 28 | 29 | /** 30 | * The URL that identifies a video resource. 31 | */ 32 | @property (nonatomic, strong) NSURL *fileURL; 33 | 34 | /** 35 | * A boolean value that specifies whether or not the video is ready to be played. 36 | * 37 | * @discussion When set to `YES`, the video is ready. When set to `NO` it is not ready. 38 | */ 39 | @property (nonatomic, assign) BOOL isReadyToPlay; 40 | 41 | /** 42 | * Initializes and returns a video media item having the given fileURL. 43 | * 44 | * @param fileURL The URL that identifies the video resource. 45 | * @param isReadyToPlay A boolean value that specifies if the video is ready to play. 46 | * 47 | * @return An initialized `JSQVideoMediaItem` if successful, `nil` otherwise. 48 | * 49 | * @discussion If the video must be downloaded from the network, 50 | * you may initialize a `JSQVideoMediaItem` with a `nil` fileURL or specify `NO` for 51 | * isReadyToPlay. Once the video has been saved to disk, or is ready to stream, you can 52 | * set the fileURL property or isReadyToPlay property, respectively. 53 | */ 54 | - (instancetype)initWithFileURL:(NSURL *)fileURL isReadyToPlay:(BOOL)isReadyToPlay; 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Views/JSQMessagesCellTextView.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import 20 | 21 | /** 22 | * `JSQMessagesCellTextView` is a subclass of `UITextView` that is used to display text 23 | * in a `JSQMessagesCollectionViewCell`. 24 | */ 25 | @interface JSQMessagesCellTextView : UITextView 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Views/JSQMessagesCellTextView.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import "JSQMessagesCellTextView.h" 20 | 21 | @implementation JSQMessagesCellTextView 22 | 23 | - (void)awakeFromNib 24 | { 25 | [super awakeFromNib]; 26 | 27 | self.textColor = [UIColor whiteColor]; 28 | self.editable = NO; 29 | self.selectable = YES; 30 | self.userInteractionEnabled = YES; 31 | self.dataDetectorTypes = UIDataDetectorTypeNone; 32 | self.showsHorizontalScrollIndicator = NO; 33 | self.showsVerticalScrollIndicator = NO; 34 | self.scrollEnabled = NO; 35 | self.backgroundColor = [UIColor clearColor]; 36 | self.contentInset = UIEdgeInsetsZero; 37 | self.scrollIndicatorInsets = UIEdgeInsetsZero; 38 | self.contentOffset = CGPointZero; 39 | self.textContainerInset = UIEdgeInsetsZero; 40 | self.textContainer.lineFragmentPadding = 0; 41 | self.linkTextAttributes = @{ NSForegroundColorAttributeName : [UIColor whiteColor], 42 | NSUnderlineStyleAttributeName : @(NSUnderlineStyleSingle | NSUnderlinePatternSolid) }; 43 | } 44 | 45 | - (void)setSelectedRange:(NSRange)selectedRange 46 | { 47 | // attempt to prevent selecting text 48 | [super setSelectedRange:NSMakeRange(NSNotFound, 0)]; 49 | } 50 | 51 | - (NSRange)selectedRange 52 | { 53 | // attempt to prevent selecting text 54 | return NSMakeRange(NSNotFound, NSNotFound); 55 | } 56 | 57 | - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer 58 | { 59 | // ignore double-tap to prevent copy/define/etc. menu from showing 60 | if ([gestureRecognizer isKindOfClass:[UITapGestureRecognizer class]]) { 61 | UITapGestureRecognizer *tap = (UITapGestureRecognizer *)gestureRecognizer; 62 | if (tap.numberOfTapsRequired == 2) { 63 | return NO; 64 | } 65 | } 66 | 67 | return YES; 68 | } 69 | 70 | - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch 71 | { 72 | // ignore double-tap to prevent copy/define/etc. menu from showing 73 | if ([gestureRecognizer isKindOfClass:[UITapGestureRecognizer class]]) { 74 | UITapGestureRecognizer *tap = (UITapGestureRecognizer *)gestureRecognizer; 75 | if (tap.numberOfTapsRequired == 2) { 76 | return NO; 77 | } 78 | } 79 | 80 | return YES; 81 | } 82 | 83 | @end 84 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Views/JSQMessagesCollectionViewCellIncoming.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import "JSQMessagesCollectionViewCell.h" 20 | 21 | /** 22 | * A `JSQMessagesCollectionViewCellIncoming` object is a concrete instance 23 | * of `JSQMessagesCollectionViewCell` that represents an incoming message data item. 24 | */ 25 | @interface JSQMessagesCollectionViewCellIncoming : JSQMessagesCollectionViewCell 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Views/JSQMessagesCollectionViewCellIncoming.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import "JSQMessagesCollectionViewCellIncoming.h" 20 | 21 | @implementation JSQMessagesCollectionViewCellIncoming 22 | 23 | #pragma mark - Overrides 24 | 25 | - (void)awakeFromNib 26 | { 27 | [super awakeFromNib]; 28 | self.messageBubbleTopLabel.textAlignment = NSTextAlignmentLeft; 29 | self.cellBottomLabel.textAlignment = NSTextAlignmentLeft; 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Views/JSQMessagesCollectionViewCellOutgoing.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import "JSQMessagesCollectionViewCell.h" 20 | 21 | /** 22 | * A `JSQMessagesCollectionViewCellOutgoing` object is a concrete instance 23 | * of `JSQMessagesCollectionViewCell` that represents an outgoing message data item. 24 | */ 25 | @interface JSQMessagesCollectionViewCellOutgoing : JSQMessagesCollectionViewCell 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Views/JSQMessagesCollectionViewCellOutgoing.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import "JSQMessagesCollectionViewCellOutgoing.h" 20 | 21 | @implementation JSQMessagesCollectionViewCellOutgoing 22 | 23 | #pragma mark - Overrides 24 | 25 | - (void)awakeFromNib 26 | { 27 | [super awakeFromNib]; 28 | self.messageBubbleTopLabel.textAlignment = NSTextAlignmentRight; 29 | self.cellBottomLabel.textAlignment = NSTextAlignmentRight; 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Views/JSQMessagesComposerTextView.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import 20 | 21 | @class JSQMessagesComposerTextView; 22 | 23 | /** 24 | * A delegate object used to notify the receiver of paste events from a `JSQMessagesComposerTextView`. 25 | */ 26 | @protocol JSQMessagesComposerTextViewPasteDelegate 27 | 28 | /** 29 | * Asks the delegate whether or not the `textView` should use the original implementation of `-[UITextView paste]`. 30 | * 31 | * @discussion Use this delegate method to implement custom pasting behavior. 32 | * You should return `NO` when you want to handle pasting. 33 | * Return `YES` to defer functionality to the `textView`. 34 | */ 35 | - (BOOL)composerTextView:(JSQMessagesComposerTextView *)textView shouldPasteWithSender:(id)sender; 36 | 37 | @end 38 | 39 | /** 40 | * An instance of `JSQMessagesComposerTextView` is a subclass of `UITextView` that is styled and used 41 | * for composing messages in a `JSQMessagesViewController`. It is a subview of a `JSQMessagesToolbarContentView`. 42 | */ 43 | @interface JSQMessagesComposerTextView : UITextView 44 | 45 | /** 46 | * The text to be displayed when the text view is empty. The default value is `nil`. 47 | */ 48 | @property (copy, nonatomic) NSString *placeHolder; 49 | 50 | /** 51 | * The color of the place holder text. The default value is `[UIColor lightGrayColor]`. 52 | */ 53 | @property (strong, nonatomic) UIColor *placeHolderTextColor; 54 | 55 | /** 56 | * The object that acts as the paste delegate of the text view. 57 | */ 58 | @property (weak, nonatomic) id pasteDelegate; 59 | 60 | /** 61 | * Determines whether or not the text view contains text after trimming white space 62 | * from the front and back of its string. 63 | * 64 | * @return `YES` if the text view contains text, `NO` otherwise. 65 | */ 66 | - (BOOL)hasText; 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Views/JSQMessagesLabel.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import 20 | 21 | /** 22 | * `JSQMessagesLabel` is a subclass of `UILabel` that adds support for a `textInsets` property, 23 | * which is similar to the `textContainerInset` property of `UITextView`. 24 | */ 25 | @interface JSQMessagesLabel : UILabel 26 | 27 | /** 28 | * The inset of the text layout area within the label's content area. The default value is `UIEdgeInsetsZero`. 29 | * 30 | * @discussion This property provides text margins for the text laid out in the label. 31 | * The inset values provided must be greater than or equal to `0.0f`. 32 | */ 33 | @property (assign, nonatomic) UIEdgeInsets textInsets; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Views/JSQMessagesLabel.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import "JSQMessagesLabel.h" 20 | 21 | @implementation JSQMessagesLabel 22 | 23 | #pragma mark - Initialization 24 | 25 | - (void)jsq_configureLabel 26 | { 27 | [self setTranslatesAutoresizingMaskIntoConstraints:NO]; 28 | self.textInsets = UIEdgeInsetsZero; 29 | } 30 | 31 | - (instancetype)initWithFrame:(CGRect)frame 32 | { 33 | self = [super initWithFrame:frame]; 34 | if (self) { 35 | [self jsq_configureLabel]; 36 | } 37 | return self; 38 | } 39 | 40 | - (void)awakeFromNib 41 | { 42 | [super awakeFromNib]; 43 | [self jsq_configureLabel]; 44 | } 45 | 46 | #pragma mark - Setters 47 | 48 | - (void)setTextInsets:(UIEdgeInsets)textInsets 49 | { 50 | if (UIEdgeInsetsEqualToEdgeInsets(_textInsets, textInsets)) { 51 | return; 52 | } 53 | 54 | _textInsets = textInsets; 55 | [self setNeedsDisplay]; 56 | } 57 | 58 | #pragma mark - Drawing 59 | 60 | - (void)drawTextInRect:(CGRect)rect 61 | { 62 | [super drawTextInRect:CGRectMake(CGRectGetMinX(rect) + self.textInsets.left, 63 | CGRectGetMinY(rect) + self.textInsets.top, 64 | CGRectGetWidth(rect) - self.textInsets.right, 65 | CGRectGetHeight(rect) - self.textInsets.bottom)]; 66 | } 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Views/JSQMessagesLoadEarlierHeaderView.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import 20 | 21 | @class JSQMessagesLoadEarlierHeaderView; 22 | 23 | /** 24 | * A constant defining the default height of a `JSQMessagesLoadEarlierHeaderView`. 25 | */ 26 | FOUNDATION_EXPORT const CGFloat kJSQMessagesLoadEarlierHeaderViewHeight; 27 | 28 | /** 29 | * The `JSQMessagesLoadEarlierHeaderViewDelegate` defines methods that allow you to 30 | * respond to interactions within the header view. 31 | */ 32 | @protocol JSQMessagesLoadEarlierHeaderViewDelegate 33 | 34 | @required 35 | 36 | /** 37 | * Tells the delegate that the loadButton has received a touch event. 38 | * 39 | * @param headerView The header view that contains the sender. 40 | * @param sender The button that received the touch. 41 | */ 42 | - (void)headerView:(JSQMessagesLoadEarlierHeaderView *)headerView didPressLoadButton:(UIButton *)sender; 43 | 44 | @end 45 | 46 | 47 | /** 48 | * The `JSQMessagesLoadEarlierHeaderView` class implements a reusable view that can be placed 49 | * at the top of a `JSQMessagesCollectionView`. This view contains a "load earlier messages" button 50 | * and can be used as a way for the user to load previously sent messages. 51 | */ 52 | @interface JSQMessagesLoadEarlierHeaderView : UICollectionReusableView 53 | 54 | /** 55 | * The object that acts as the delegate of the header view. 56 | */ 57 | @property (weak, nonatomic) id delegate; 58 | 59 | /** 60 | * Returns the load button of the header view. 61 | */ 62 | @property (weak, nonatomic, readonly) UIButton *loadButton; 63 | 64 | #pragma mark - Class methods 65 | 66 | /** 67 | * Returns the `UINib` object initialized for the collection reusable view. 68 | * 69 | * @return The initialized `UINib` object or `nil` if there were errors during 70 | * initialization or the nib file could not be located. 71 | */ 72 | + (UINib *)nib; 73 | 74 | /** 75 | * Returns the default string used to identify the reusable header view. 76 | * 77 | * @return The string used to identify the reusable header view. 78 | */ 79 | + (NSString *)headerReuseIdentifier; 80 | 81 | @end 82 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Views/JSQMessagesLoadEarlierHeaderView.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | 20 | #import "JSQMessagesLoadEarlierHeaderView.h" 21 | 22 | #import "NSBundle+JSQMessages.h" 23 | 24 | 25 | const CGFloat kJSQMessagesLoadEarlierHeaderViewHeight = 32.0f; 26 | 27 | 28 | @interface JSQMessagesLoadEarlierHeaderView () 29 | 30 | @property (weak, nonatomic) IBOutlet UIButton *loadButton; 31 | 32 | @end 33 | 34 | 35 | 36 | @implementation JSQMessagesLoadEarlierHeaderView 37 | 38 | #pragma mark - Class methods 39 | 40 | + (UINib *)nib 41 | { 42 | return [UINib nibWithNibName:NSStringFromClass([JSQMessagesLoadEarlierHeaderView class]) 43 | bundle:[NSBundle bundleForClass:[JSQMessagesLoadEarlierHeaderView class]]]; 44 | } 45 | 46 | + (NSString *)headerReuseIdentifier 47 | { 48 | return NSStringFromClass([JSQMessagesLoadEarlierHeaderView class]); 49 | } 50 | 51 | #pragma mark - Initialization 52 | 53 | - (void)awakeFromNib 54 | { 55 | [super awakeFromNib]; 56 | [self setTranslatesAutoresizingMaskIntoConstraints:NO]; 57 | 58 | self.backgroundColor = [UIColor clearColor]; 59 | 60 | [self.loadButton setTitle:[NSBundle jsq_localizedStringForKey:@"load_earlier_messages"] forState:UIControlStateNormal]; 61 | self.loadButton.titleLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody]; 62 | } 63 | 64 | - (void)dealloc 65 | { 66 | _loadButton = nil; 67 | _delegate = nil; 68 | } 69 | 70 | #pragma mark - Reusable view 71 | 72 | - (void)setBackgroundColor:(UIColor *)backgroundColor 73 | { 74 | [super setBackgroundColor:backgroundColor]; 75 | self.loadButton.backgroundColor = backgroundColor; 76 | } 77 | 78 | #pragma mark - Actions 79 | 80 | - (IBAction)loadButtonPressed:(UIButton *)sender 81 | { 82 | [self.delegate headerView:self didPressLoadButton:sender]; 83 | } 84 | 85 | @end 86 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Views/JSQMessagesLoadEarlierHeaderView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Views/JSQMessagesTypingIndicatorFooterView.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSQMessagesViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQMessagesViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2014 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import 20 | #import 21 | 22 | /** 23 | * A constant defining the default height of a `JSQMessagesTypingIndicatorFooterView`. 24 | */ 25 | FOUNDATION_EXPORT const CGFloat kJSQMessagesTypingIndicatorFooterViewHeight; 26 | 27 | /** 28 | * The `JSQMessagesTypingIndicatorFooterView` class implements a reusable view that can be placed 29 | * at the bottom of a `JSQMessagesCollectionView`. This view represents a typing indicator 30 | * for incoming messages. 31 | */ 32 | @interface JSQMessagesTypingIndicatorFooterView : UICollectionReusableView 33 | 34 | #pragma mark - Class methods 35 | 36 | /** 37 | * Returns the `UINib` object initialized for the collection reusable view. 38 | * 39 | * @return The initialized `UINib` object or `nil` if there were errors during 40 | * initialization or the nib file could not be located. 41 | */ 42 | + (UINib *)nib; 43 | 44 | /** 45 | * Returns the default string used to identify the reusable footer view. 46 | * 47 | * @return The string used to identify the reusable footer view. 48 | */ 49 | + (NSString *)footerReuseIdentifier; 50 | 51 | #pragma mark - Typing indicator 52 | 53 | /** 54 | * Configures the receiver with the specified attributes for the given collection view. 55 | * Call this method after dequeuing the footer view. 56 | * 57 | * @param ellipsisColor The color of the typing indicator ellipsis. This value must not be `nil`. 58 | * @param messageBubbleColor The color of the typing indicator message bubble. This value must not be `nil`. 59 | * @param shouldDisplayOnLeft Specifies whether the typing indicator displays on the left or right side of the collection view when displayed. 60 | * @param collectionView The collection view in which the footer view will appear. This value must not be `nil`. 61 | */ 62 | - (void)configureWithEllipsisColor:(UIColor *)ellipsisColor 63 | messageBubbleColor:(UIColor *)messageBubbleColor 64 | shouldDisplayOnLeft:(BOOL)shouldDisplayOnLeft 65 | forCollectionView:(UICollectionView *)collectionView; 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /Vendor/JSQMessagesViewController/Views/JSQMessagesTypingIndicatorFooterView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | --------------------------------------------------------------------------------