SimpleChat
An Easy To Use Bubble Chat Interface
Install / Use
/learn @loganwright/SimpleChatREADME
#<center>Welcome To SimpleChat 2.0!</center>
##New Features
- Completely redesigned implementation in Swift
- Supports iOS 7.1+
- New Screen Size Support
#SimpleChat
An easy to use bubble chat UI as an alternative to the traditional iOS talk bubbles.
<p align="center"> <img src="https://raw.githubusercontent.com/LoganWright/SimpleChat/SwiftRedesign/PromoAssets/SimpleChatScreenShot.png"><img /> </p> <br>###Getting Started
####1. Add The LGSimpleChat Folder To Xcode
- Drag the folder into your Xcode project
- Make sure "Copy items into destination group's folder (if needed)" is selected
####2. ObjC
- Import
<#YourProductModule#>-Swift.h - Conform to
LGChatControllerDelegate - Call
[self launchChatController](specified below)
In <#YourViewController#>.m
#import "<#YourViewController#>.h"
#import "<#YourProductModule#>-Swift.h"
@interface <#YourViewController#> () <LGChatControllerDelegate>
@end
@implementation
#pragma mark - Launch Chat Controller
- (void)launchChatController
{
LGChatController *chatController = [LGChatController new];
chatController.opponentImage = [UIImage imageNamed:@"<#YourImageName#>"];
chatController.title = @"<#YourTitle#>";
LGChatMessage *helloWorld = [[LGChatMessage alloc] initWithContent:@"Hello World" sentByString:[LGChatMessage SentByUserString]];
chatController.messages = @[helloWorld]; // Pass your messages here.
chatController.delegate = self;
[self.navigationController pushViewController:chatController animated:YES];
}
#pragma mark - LGChatControllerDelegate
- (void)chatController:(LGChatController *)chatController didAddNewMessage:(LGChatMessage *)message
{
NSLog(@"Did Add Message: %@", message.content);
}
- (BOOL)shouldChatController:(LGChatController *)chatController addMessage:(LGChatMessage *)message
{
/*
Use this space to prevent sending a message, or to alter a message. For example, you might want to hold a message until its successfully uploaded to a server.
*/
return YES;
}
@end
Initializing a Message
LGChatMessage *helloWorld = [[LGChatMessage alloc] initWithContent:@"Hello World" sentByString:[LGChatMessage SentByUserString]];
or
LGChatMessage *helloWorld = [[LGChatMessage alloc] initWithContent:@"Hello World" sentByString:[LGChatMessage SentByOpponentString] timeStamp: someTimestamp];
Stylization Options
Chat Input
- (void)styleChatInput
{
[LGChatInput setAppearanceBackgroundColor:<#UIColor#>];
[LGChatInput setAppearanceIncludeBlur:<#Bool#>];
[LGChatInput setAppearanceTextViewFont:<#UIFont#>];
[LGChatInput setAppearanceTextViewTextColor:<#UIColor#>];
[LGChatInput setAppearanceTintColor:<#UIColor#>];
[LGChatInput setAppearanceTextViewBackgroundColor:<#UIColor#>];
}
Message Cell
- (void)styleMessageCell
{
[LGChatMessageCell setAppearanceFont:<#UIFont#>];
[LGChatMessageCell setAppearanceOpponentColor:[<#UIColor#>];
[LGChatMessageCell setAppearanceUserColor:<#UIColor#>];
}
####2. Swift
- Import
<#YourProductModule#>-Swift.h - Conform to
LGChatControllerDelegate - Call
[self launchChatController](specified below)
In <#YourViewController#>.swift
import UIKit
class SwiftExampleViewController: UIViewController, LGChatControllerDelegate {
override func viewDidLoad() {
super.viewDidLoad()
}
// MARK: Launch Chat Controller
func launchChatController() {
let chatController = LGChatController()
chatController.opponentImage = UIImage(named: "User")
chatController.title = "Simple Chat"
let helloWorld = LGChatMessage(content: "Hello World!", sentBy: .User)
chatController.messages = [helloWorld]
chatController.delegate = self
self.navigationController?.pushViewController(chatController, animated: true)
}
// MARK: LGChatControllerDelegate
func chatController(chatController: LGChatController, didAddNewMessage message: LGChatMessage) {
println("Did Add Message: \(message.content)")
}
func shouldChatController(chatController: LGChatController, addMessage message: LGChatMessage) -> Bool {
/*
Use this space to prevent sending a message, or to alter a message. For example, you might want to hold a message until its successfully uploaded to a server.
*/
return true
}
}
Initializing a Message
let message = LGChatMessage(content: "Hello World!", sentBy: .User)
-- or --
let message = LGChatMessage(content: "Hello World!", sentBy: .Opponent, timeStamp: someTimestamp)
Stylization Options
Chat Input
func stylizeChatInput() {
LGChatInput.Appearance.backgroundColor = <#UIColor#>
LGChatInput.Appearance.includeBlur = <#Bool#>
LGChatInput.Appearance.textViewFont = <#UIFont#>
LGChatInput.Appearance.textViewTextColor = <#UIColor#>
LGChatInput.Appearance.tintColor = <#UIColor#>
LGChatInput.Appearance.textViewBackgroundColor = <#UIColor#>
}
Message Cell
func stylizeMessageCell() {
LGChatMessageCell.Appearance.font = <#UIFont#>
LGChatMessageCell.Appearance.opponentColor = <#UIColor#>
LGChatMessageCell.Appearance.userColor = <#UIColor#>
}
##License
You may not claim this code as your own!
This product is licensed under <a href="https://tldrlegal.com/license/mozilla-public-license-2.0-(mpl-2)">MPL 2.0</a>.
Mozilla Public License
Version 2.0
1. Definitions
1.1. “Contributor”
means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software.
1.2. “Contributor Version”
means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor’s Contribution.
1.3. “Contribution”
means Covered Software of a particular Contributor.
1.4. “Covered Software”
means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof.
1.5. “Incompatible With Secondary Licenses”
means
that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or
that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License.
1.6. “Executable Form”
means any form of the work other than Source Code Form.
1.7. “Larger Work”
means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software.
1.8. “License”
means this document.
1.9. “Licensable”
means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License.
1.10. “Modifications”
means any of the following:
any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or
any new file in Source Code Form that contains any Covered Software.
1.11. “Patent Claims” of a Contributor
means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version.
1.12. “Secondary License”
means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses.
1.13. “Source Code Form”
means the form of the work preferred for making modifications.
1.14. “You” (or “Your”)
means an individual or a legal entity exercising rights under this License. For legal entities, “You” includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, “control” means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
2. License Grants and Conditions
2.1. Grants
Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license:
under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and
under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version.
2.2. Effective Date
The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution.
2.3. Limitations on Grant Scope
The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor:
for any code that a Contributor has removed from Covered Software; or
for infringements caused by: (i) Your and any other third party’s modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or
under Patent Claims infringed by Covered Software in the absence of its Contributions.
This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as ma
Related Skills
node-connect
344.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
99.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
