Latest 1.0.5
License MIT
Platforms ios 9.0
Dependencies HTMLKit

CI Status

SUAI is a lightweight and very simple library for working with contents of Saint Petersburg State University of Aerospace Instrumentation.
Using this library you can:

  • Obtain schedule of groups, teachers and auditories referenced from scheduling site;
  • Obtain university news.

This library used in Official SUAI app "Спутник ГУАП".


To run the example project, clone the repo, and run pod install from the Example directory first.


SUAI is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'SUAI'



If you know name of entity and it’s type, use:

- (void)loadScheduleFor:(NSString *)entityName
                success:(void (^) (SUAISchedule *schedule))schedule
                   fail:(void (^) (__kindof SUAIError *error))error;

or if you have SUAIEntity object of entity, use:

- (void)loadScheduleFor:(SUAIEntity *)entity
                success:(void (^) (SUAISchedule *schedule))schedule
                   fail:(void (^) (__kindof SUAIError *error))error;

Above methods are similar, if schedule have been obtained without errors, success block will be called. In any cases fail block is to your service :).
Example how to load schedule of type: Group with name "1741":


[[[SUAI instance] schedule] loadScheduleFor:@"1741" ofType:EntityTypeGroup success:^(SUAISchedule *schedule) {
        NSLog(@"OK: %@", schedule);
} fail:^(__kindof SUAIError *error) {
        NSLog(@"error: %@", error.description)


SUAI.instance().schedule.loadSchedule(for: "1741", of: .group, success: { (schedule) in
    print("OK: (schedule)")
}) { (error) in
    print("error: (error.description)")


For load available news preview use this method:

- (void)loadAllNews:(void (^) (NSArray<SUAINews *>* news))success
               fail:(void (^) (SUAIError *err))error;

If you want to load concrete news use:

- (void)loadNews:(NSString *)newsID
         success:(void (^) (SUAINews *news))success
            fail:(void (^) (SUAIError *err))error;

Where newsID is a part of url stored in property publicationId of SUAINews object.


Library also contain notification constants. Subscribe on it if you need to react on it’s changing:

  • kSUAIReachabilityNotification
    If you subscribed on this notification constant, you will be able to handle internet reachability changes (e.g. device is offline or connected via Wi-fi or LTE). In notification object you will get NSNumber contains bool value with reachability status.
    Somewhere you subscribed on notification:
[[NSNotificationCenter defaultCenter] addObserver:self
                                             name:kSUAIReachabilityNotification object:nil];

And in method p_internetReachabilityChanged you can check reachability status:

- (void)p_internetReachabilityChanged:(NSNotification *)notification {
    BOOL isReachable = [(NSNumber *)[notification object] boolValue];
    NSLog(@"internet is reachable: %ld", isReachable);
  • kSUAIWeekTypeObtainedNotification
    Constant will notify when SUAI loaded current week type of week.
  • kSUAIEntityLoadedNotification
    Before you be able to load schedule, it’s necessary to load all available codes. This contant will notify when all codes are loaded and ready to work.


Don’t forget to allow arbitrary loads!

  1. Go to plist file;
  2. In information property list add new key "App Transport Security Settings";
  3. In added dictionary add key "Allow Arbitrary Loads" and set value to YES.


    • Xcode
    • Objective-C
    • iOS 9.0 or higher


Victor Volkov, [email protected]


SUAI is available under the MIT license. See the LICENSE file for more info.

Latest podspec

    "name": "SUAI",
    "version": "1.0.5",
    "summary": "Library for working with SUAI content",
    "description": "SUAISchedule is a lightweight and simple library for loading and parsing schedule for students and teachers studying in Saint Petersburg State Unversity of Aerospace Instrumentation. It includes both session and semester schedule.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Victor Volkov": "[email protected]"
    "source": {
        "git": "",
        "tag": "1.0.5"
    "platforms": {
        "ios": "9.0"
    "source_files": "SUAI/Classes/**/*",
    "private_header_files": [
    "dependencies": {
        "HTMLKit": []

Pin It on Pinterest

Share This