# ChatMessageTableViewController
A messages UI for iPhone. ChatMessageTableViewController is like iMessage app. support text && image .
![Messages Screenshot 1][img1]
![Messages Screenshot 2][img2]
This messages tableview controller is very similar to the one in the iOS Messages app. **Note, this is only a messaging UI, not a messaging app.** This is intended to be used in an existing app where you have (or are developing) a messaging system and need a user interface for it.
**See more [screenshots][link1] in the `Screenshots/` directory. (Surprise!)**
## About
This is based on work by [@soffes](http://github.com/soffes) [SSMessagingViewController][ss].
I developed this to use in [Hemoglobe](http://www.hemoglobe.com) for private messages between users.
[Square message bubbles]([img4]) designed by [@michaelschultz](http://www.twitter.com/michaelschultz).
## Features
* Up-to-date for iOS 6.0 and ARC (iOS 5.0+ required)
* Universal for iPhone
* Allows arbitrary message (and bubble) sizes
* Copy & paste text message && Save image message
* Timestamp options
* Swipe/pull down to hide keyboard
* Dynamically resizes input text view as you type
* Smooth hiding/showing keyboard animations with `NSNotification`
* Automatically enables/disables send button if text view is empty or not
* Smooth send animations
* Send/Receive sound effects
* Various bubble styles
### From source
* Drag the `JSMessagesTableViewController/` folder to your project.
* Add the `AudioToolbox.framework` to your project, if you want to use the sound effects
## How To Use
#####Subclass `JSMessagesViewController`
* In `- (void)viewDidLoad`
* Set your view controller as the `delegate` and `datasource`
* Set your view controller `title`
#####Implement the `JSMessagesViewDelegate` protocol
````objective-c
- (void)sendPressed:(UIButton *)sender withText:(NSString *)text
````
* Hook into your own backend here
* Call `[self finishSend]` at the end of this method to animate and reset the text input view
* Optionally play sound effects
* For outgoing messages `[JSMessageSoundEffect playMessageSentSound]`
* For incoming messages `[JSMessageSoundEffect playMessageReceivedSound]`
````objective-c
- (JSBubbleMessageType)messageTypeForRowAtIndexPath:(NSIndexPath *)indexPath
````
* The type of bubble for this row, options are:
* `JSBubbleMessageTypeIncoming`
* `JSBubbleMessageTypeOutgoing`
* The type of Message for this row, options are:
* `JSBubbleMediaTypeText`
* `JSBubbleMediaTypeImage`
````objective-c
- (JSBubbleMediaType)messageMediaTypeForRowAtIndexPath:(NSIndexPath *)indexPath
````
* The [style of the bubble][link1] for this row, options are:
* `JSBubbleMessageStyleDefault`
* `JSBubbleMessageStyleSquare`
* `JSBubbleMessageStyleDefaultGreen`
````objective-c
- (JSMessagesViewTimestampPolicy)timestampPolicy
````
* How/when to display timestamps for messages, options are:
* `JSMessagesViewTimestampPolicyAll`
* `JSMessagesViewTimestampPolicyAlternating`
* `JSMessagesViewTimestampPolicyEveryThree`
* `JSMessagesViewTimestampPolicyEveryFive`
* `JSMessagesViewTimestampPolicyCustom`
````objective-c
- (JSMessagesViewAvatarPolicy)avatarPolicy
````
* How/when to display avatars, options are:
* `JSMessagesViewAvatarPolicyIncomingOnly`
* `JSMessagesViewAvatarPolicyBoth`
* `JSMessagesViewAvatarPolicyNone`
````objective-c
- (JSAvatarStyle)avatarStyle
````
* The [style for the avatars][link1], options are:
* `JSAvatarStyleCircle`
* `JSAvatarStyleSquare`
* `JSAvatarStyleNone`
````objective-c
- (BOOL)hasTimestampForRowAtIndexPath:(NSIndexPath *)indexPath
````
* Returns if this row should display a timestamp or not
* Required only if using `JSMessagesViewTimestampPolicyCustom`
#####Implement the `JSMessagesViewDataSource` protocol
````objective-c
- (NSString *)textForRowAtIndexPath:(NSIndexPath *)indexPath
````
* The text to be displayed for this row
````objective-c
- (NSDate *)timestampForRowAtIndexPath:(NSIndexPath *)indexPath
````
* The timestamp to be displayed *above* this row
````objective-c
- (UIImage *)avatarImageForIncomingMessage
````
* The avatar image for incoming messages
````objective-c
- (UIImage *)avatarImageForOutgoingMessage
````
* The avatar image for outgoing messages
#####Implement the [table view data source][ref1] method that you should be familiar with
````objective-c
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
````
#####Customize
* For custom background color, use `- (void)setBackgroundColor:(UIColor *)color`
* For custom send button, override `- (UIButton *)sendButton`
##### Notes
* You may present view programmatically, or use Storyboards
* Your `JSMessagesViewController` subclass **must** be presented in a `UINavigationController`
##### Demo projects included
* `MessagesDemo.xcodeproj` for example of programmatic presentation
* `MessagesDemoStoryboards/MessagesDemoSB.xcodeproj` for example of use with Storyboards
## Apps Using This Control
[Hemoglobe](http://bit.ly/hemoglobeapp)
[FourChat](https://itunes.apple.com/us/app/fourchat/id650833730?mt=8)
[Libraries for developers](https://itunes.apple.com/us/app/libraries-for-developers/id653427112?mt=8)
[jessesquires 's MessagesTableViewController](https://github.com/jessesquires/MessagesTableViewController)
*[Contact me](mailto:[email protected]) to have your app listed here.*
## Related Projects
[SSMessagingViewController][ss]
[AcaniChat](https://github.com/acani/AcaniChat)
## [MIT License](http://opensource.org/licenses/MIT)
You are free to use this as you please. No attribution necessary. **If you use this, please tell me about it!**
Copyright © 2013 Robin
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
[ss]:https://github.com/soffes/ssmessagesviewcontroller
[ref1]:http://developer.apple.com/library/ios/#documentation/uikit/reference/UITableViewDataSource_Protocol/Reference/Reference.html#//apple_ref/occ/intf/UITableViewDataSource
[ref2]:http://developer.apple.com/library/ios/#documentation/cocoa/conceptual/ProgrammingWithObjectiveC/CustomizingExistingClasses/CustomizingExistingClasses.html
[img1]:https://github.com/EvoRobin/ChatMessageTableViewController/blob/master/ScreenShot/IMG_0452.PNG?raw=true
[img2]:https://github.com/EvoRobin/ChatMessageTableViewController/blob/master/ScreenShot/IMG_0453.PNG?raw=true
[img3]:https://github.com/EvoRobin/ChatMessageTableViewController/blob/master/ScreenShot/IMG_0454.PNG?raw=true
[img4]:https://github.com/EvoRobin/ChatMessageTableViewController/blob/master/ScreenShot/IMG_0455.PNG?raw=true
[link1]:https://github.com/EvoRobin/ChatMessageTableViewController/tree/master/ScreenShot
没有合适的资源?快使用搜索试试~ 我知道了~
ChatMessageTableViewController就像iMessage应用程序_Objective.zip
共110个文件
png:52个
m:18个
h:16个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 186 浏览量
2023-04-24
14:09:29
上传
评论
收藏 2.78MB ZIP 举报
温馨提示
ChatMessageTableViewController就像iMessage应用程序_Objective.zip
资源推荐
资源详情
资源评论
收起资源包目录
ChatMessageTableViewController就像iMessage应用程序_Objective.zip (110个子文件)
messageReceived.aiff 42KB
messageSent.aiff 40KB
JSMessagesViewController.h 4KB
JSBubbleView.h 3KB
JSBubbleMessageCell.h 3KB
UIImage+JSMessagesView.h 3KB
JSMessageInputView.h 2KB
JSDismissiveTextView.h 2KB
JSMessageSoundEffect.h 1KB
UIView+AnimationOptionsForCurve.h 1KB
UIColor+JSMessagesView.h 1KB
NSString+JSMessagesView.h 1KB
JSMessageTextView.h 1KB
MessageData.h 533B
AppDelegate.h 371B
UIButton+JSMessagesView.h 255B
ViewController.h 100B
MasterViewController.h 85B
demo1.jpg 364KB
Contents.json 442B
Contents.json 333B
JSMessagesViewController.m 20KB
JSBubbleMessageCell.m 13KB
JSBubbleView.m 13KB
JSDismissiveTextView.m 8KB
UIImage+JSMessagesView.m 8KB
JSMessageInputView.m 7KB
ViewController.m 6KB
JSMessageTextView.m 5KB
AppDelegate.m 2KB
UIButton+JSMessagesView.m 2KB
JSMessageSoundEffect.m 2KB
UIView+AnimationOptionsForCurve.m 2KB
UIColor+JSMessagesView.m 2KB
NSString+JSMessagesView.m 2KB
MasterViewController.m 1KB
ChatMessageTableViewControllerTests.m 723B
MessageData.m 446B
main.m 355B
README.md 7KB
project.pbxproj 55KB
ChatMessageTableViewController-Prefix.pch 548B
ChatMessageTableViewController-Info.plist 1KB
ChatMessageTableViewControllerTests-Info.plist 688B
xcschememanagement.plist 592B
xcschememanagement.plist 592B
IMG_0457.PNG 565KB
IMG_0455.PNG 563KB
IMG_0456.PNG 283KB
demo-avatar-woz.png 209KB
IMG_0453.PNG 157KB
IMG_0454.PNG 143KB
IMG_0452.PNG 127KB
demo-avatar-jobs.png 118KB
[email protected] 24KB
bubble-square-outgoing.png 8KB
bubble-default-incoming-selected.png 5KB
bubble-typing.png 4KB
bubble-default-incoming-green.png 4KB
bubble-default-outgoing-selected.png 4KB
bubble-default-outgoing.png 4KB
PhotoIcon.png 4KB
bubble-default-incoming.png 4KB
input-bar-flat.png 4KB
send.png 4KB
send-highlighted.png 4KB
bubble-square-incoming-selected.png 4KB
bubble-square-outgoing-selected.png 4KB
bubble-square-incoming.png 4KB
bubble-flat-outgoing-old.png 2KB
bubble-default-outgoing-green.png 2KB
bubble-flat-outgoing.png 1KB
bubble-flat-outgoing-selected.png 1KB
bubble-flat-incoming-selected.png 1KB
bubble-flat-incoming.png 1KB
input-field.png 1KB
[email protected] 456B
input-bar.png 336B
Main.storyboard 2KB
InfoPlist.strings 45B
共 110 条
- 1
- 2
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9154
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功