IRC client framework (wrapper around libircclient library).
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
achmizs fa85b3a0c1 Deleted README 4 лет назад
IRCClient Updated info comments, README.md, and LICENSE 4 лет назад
IRCClient.xcodeproj Updated project layout 4 лет назад
libircclient Add libircclient to distribution, clean up ignored files 9 лет назад
.gitignore Add libircclient to distribution, clean up ignored files 9 лет назад
IRCClient.h Updated info comments, README.md, and LICENSE 4 лет назад
LICENSE Updated info comments, README.md, and LICENSE 4 лет назад
README.md Updated info comments, README.md, and LICENSE 4 лет назад

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)

  1. Place the entire IRCClient folder in your project folder

  2. Using File -> Add Files…, add IRCClient.xcodeproj to your project

  3. Build the IRCClient framework target

  4. Make sure the Header Search Paths build setting of your project contains the following entry:

    $(PROJECT_DIR)/
       (non-recursive)
    
  5. Configure the build phases for your application target thusly:

    • Add IRCClient.framework to Link Binary With Libraries
    • Add IRCClient.framework to Target Dependencies
    • Add a Copy Files build phase
    • Set destination for the just-added Copy Files build phase to Frameworks
    • Add IRCClient.framework to the just-added Copy Files build phase
  6. Import IRCClient’s API into your code using #import <IRCClient/IRCClient.h>

  7. If you’re using Swift in your project, add IRCClient/IRCClient.h to the Objective-C Bridging Header build setting.

Documentation

See the following header files for documentation:

  • IRCClientSession.h
  • IRCClientSessionDelegate.h
  • IRCClientChannel.h
  • IRCClientChannelDelegate.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 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/.


  1. Of course, IRCClient does not support UTF-16 nor any other non-8-bit encoding, as the IRC protocol does not support such encodings either.
  2. The encoding property of IRCClientSession does have one effect: it controls the encoding used by replies to CTCP TIME requests.