| IRCClient | ||
| IRCClient.xcodeproj | ||
| libircclient | ||
| .gitignore | ||
| IRCClient.h | ||
| LICENSE | ||
| README.md | ||
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/.
Adding IRCClient to your application
(using Xcode) (these instructions apply to Xcode 7.1.1, build 7B1005)
-
Place the entire
IRCClientfolder in your project folder -
Using File -> Add Files…, add
IRCClient.xcodeprojto your project -
Build the
IRCClientframework 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:
- Add
IRCClient.frameworkto Link Binary With Libraries - Add
IRCClient.frameworkto Target Dependencies - Add a Copy Files build phase
- Set destination for the just-added Copy Files build phase to Frameworks
- Add
IRCClient.frameworkto the just-added Copy Files build phase
- Add
-
Import IRCClient’s API into your code using
#import <IRCClient/IRCClient.h> -
If you’re using Swift in your project, add
IRCClient/IRCClient.hto the Objective-C Bridging Header build setting.
Documentation
See the following header files for documentation:
IRCClientSession.hIRCClientSessionDelegate.hIRCClientChannel.hIRCClientChannelDelegate.h
NOTE on strings
IRCClient 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.
Usage
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 session];
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/.