|
|
4 anos atrás | |
|---|---|---|
| IRCClient | 4 anos atrás | |
| IRCClient.xcodeproj | 4 anos atrás | |
| libircclient | 9 anos atrás | |
| .gitignore | 9 anos atrás | |
| IRCClient.h | 4 anos atrás | |
| LICENSE | 4 anos atrás | |
| README | 4 anos atrás | |
| README.md | 4 anos atrás | |
This is a modified version of the IRCClient framework by Nathan Ollerenshaw. It uses the libircclient library by Georgy Yunaev. (See LICENSE for more info.) I’ve rewritten it to allow robust support for arbitrary text encodings, and fixed various other problems. The original version of IRCClient, as well as libircclient, is available here: http://sourceforge.net/projects/libircclient/.
(using Xcode) (these instructions apply to Xcode 7.1.1, build 7B1005)
Place the entire IRCClient folder in your project folder
Using File -> Add Files…, add IRCClient.xcodeproj to your project
Build the IRCClient framework target
Make sure the Header Search Paths build setting of your project contains the following entry:
$(PROJECT_DIR)/
(non-recursive)
Configure the build phases for your application target thusly:
IRCClient.framework to Link Binary With LibrariesIRCClient.framework to Target DependenciesIRCClient.framework to the just-added Copy Files build phaseImport IRCClient’s API into your code using #import <IRCClient/IRCClient.h>
If you’re using Swift in your project, add IRCClient/IRCClient.h to the Objective-C Bridging Header build setting.
See the following header files for documentation:
IRCClientSession.hIRCClientSessionDelegate.hIRCClientChannel.hIRCClientChannelDelegate.hIRCClient stores and passes all strings (messages, nicks, channel names, mode strings, channel topics, etc.) as NSData objects. Values passed to framework methods (such as the IRC commands) should also be in this format1. This means that IRCClient is encoding-agnostic1; it is up to you to pass it properly encoded representations of your text strings, and it is also up to you to select an appropriate encoding for display or other handling of received strings, as necessary. The encoding property of IRCClientSession and IRCClientChannel may be useful in this regard (i.e. for the convenience of associating a server’s or channel’s preferred encoding with the relevant server or channel object), although note that this property is almost entirely epiphenomenal2.
To use this framework, you will need to write an IRCClientSessionDelegate to
handle all of the events generated by the server, and an IRCClientChannelDelegate
to handle all of the events generated by channels on that server.
You then create an IRCClientSession object in your code, assign the required
properties, and call -[connect:] to connect to the server and -[run:] to place
the connection on a new event queue and start receiving events. For example:
IRCClientSession *session = [IRCClientSession new];
MyIRCClientSessionDelegate *controller = [[MyIRCClientSessionDelegate alloc] init];
session.delegate = controller;
controller.session = session;
session.server = @"irc.libera.chat".dataAsUTF8;
session.port = 6667;
[session setNickname:@"test".dataAsUTF8
username:@"test".dataAsUTF8
realname:@"test".dataAsUTF8];
[session connect];
[session run]; // Activates the event queue
If you have questions, bug reports, or suggestions regarding IRCClient, find Obormot on the Libera.Chat IRC network.
If you have any questions, bug reports, suggestions regarding libircclient, please visit http://sourceforge.net/projects/libircclient/.
encoding property of IRCClientSession does have one effect: it controls the encoding used by replies to CTCP TIME requests.