Skip to content

The Sticker Library is a sticker's collection view of multi-page for iOS.

License

Notifications You must be signed in to change notification settings

TechD-Robin/TDStickerLibrary

Repository files navigation

TechD-Robin/TDStickerLibrary

The Sticker Library is a sticker's collection view of multi-page for iOS.

The Sticker Library provide several functionality :

  • sticker's easy browse & preview.

  • update & download newer.

IMAGE ALT TEXT HERE

Requirements

  • iOS 8.0+
  • ARC

Install

Download

  1. Click Download ZIP or here : download
  2. Add both TDStickerLibrary/ and Libraries/ folder to your project.

add Podfile in project's root directory, content like below :

# For latest release in cocoapods
platform :ios, '8.0'
pod "TDStickerLibrary"
# Get the latest on develop
platform :ios, '8.0'
pod 'TDStickerLibrary',   :git => 'https://github.com/TechD-Robin/TDStickerLibrary.git',    :branch => 'develop'
# For version 0.1.1
platform :ios, '8.0'
pod 'TDStickerLibrary',   :git => 'https://github.com/TechD-Robin/TDStickerLibrary.git',    :tag => '0.1.1'

# or
#pod 'TDStickerLibrary', '~> 0.1.1'

Dependencies

Getting Started

  • Demo Project

    • A demo project in DemoStickerLibrary/ folder.

    NOTE: the demo project is include base mechanism:

    1. browse sticker library.

    2. get the sticker image from user touch.

    3. update sticker library data.

  • Quick Run

    #import "TDStickerLibrary.h"    // import main header file
    TDStickerLibraryViewController* controller;
    controller                      = [TDStickerLibraryViewController stickerLibaray];
    if ( nil == controller )
    {
        return;
    }
    [self                           presentViewController: controller animated: YES completion: nil];
    
    //  will get a empty sticker libery.

    NOTE: will get a empty sticker libery.

  • Easy Sample

    1. Download Resources/**/*.* these file.
    2. Create a Resources/ directory to your project.
    3. Drag the Configure/ (step 1's sub-directory) folder into Resources/ folder, and at 'Added folders :' choose Create folder references.
    4. Reference Quick Run
    5. Rebuild & run project.

    NOTE: these code is not yet include update mechanism.

Getting Advance

  • Customization customize your UI configure

    TDStickerLibraryViewController* controller;
    TDStickerLibraryCustomization * customization;
    
    customization                   = [TDStickerLibraryCustomization new];
    if ( nil == customization )
    {
        return;
    }
    
    [customization                  setSysStyleMasterVisionBGC:     [UIColor purpleColor]];
    [customization                  setSysStyleTitleTextColor:      [UIColor lightGrayColor]];
    [customization                  setBannerHeight:                0.0f];
    [customization                  setTableItemSizeUsingImageOriginalProportion: YES];
    //[customization ...];
    
    controller                      = [TDStickerLibraryViewController stickerLibarayWithCustomization: customization];
    if ( nil == controller )
    {
        return;
    }
    [self                           presentViewController: controller animated: YES completion: nil];

    NOTE:

    1. check these configure your can customize from TDStickerLibraryCustomization.h.

    2. you must customize these properties sysStyleXXX like sysStyleBundleName for system style by you self.

  • Get Sticker get the sticker image from user touch

    [controller                     setFinishedStickerLibraryCallbackBlock: ^(UIImage * stickerImage)
    {
        NSLog( @"sticker image : %@", stickerImage );
    }]; 
  • Update Data

    1. Setup your update file to server.
    2. Get the update file's URL.
    3. Use this URL to your update method.
    4. sample
    - ( void ) updateConfigure
    {
         NSArray                       * searchKeys;
         NSString                      * updateTabSearchKey;
         NSString                      * urlString;
         TDStickerLibraryUpdate        * updateProcedure;
         TDStickerLibraryCustomization * customization;
    
         updateTabSearchKey              = @"UpdateTab";
         urlString                       = @"https://docs.google.com/uc?authuser=0&id=0B1yHM9LysIXXX0JqNEdqcEZSTU0&export=download";
         customization                   = [TDStickerLibraryCustomization new];
         NSParameterAssert( nil != customization );
    
         [customization                  setSystemConfigureTabUpdateDefaultKey: updateTabSearchKey];
         [customization                  setSystemConfigureTabUpdateZpwiaopsrpsded: @"StickerLibrary"];
         updateProcedure                 = [TDStickerLibraryUpdate stickerLibraryUpdateWithCustomization: customization];
         NSParameterAssert( nil != updateProcedure );
    
         searchKeys                      = [NSArray arrayWithObjects: updateTabSearchKey, nil];
         [updateProcedure                startUpdateSystemConfigure: urlString forSearch: searchKeys];
    
         __weak __typeof(updateProcedure)    weakUpdateProcedure;
         weakUpdateProcedure                 = updateProcedure;
         [updateProcedure                    setUpdateCompletionBlock: ^(NSDictionary * updateResponses, NSError * error, BOOL finished)
         {
             NSLog( @"resopnses : %@", updateResponses );
             NSLog( @"error : %@", error );
             NSLog( @"finished : %d", finished );
    
             [weakUpdateProcedure            stopProcedure];
         }];
    }

    NOTE:

    after added the update procedure, about some of customize configure of TDStickerLibraryViewController, must same the update's configure;

    - (IBAction)startAction:(id)sender
    {
    
         TDStickerLibraryViewController* controller;
         TDStickerLibraryCustomization * customization;
    
         customization                   = [TDStickerLibraryCustomization new];
         NSParameterAssert( nil != customization );
    
         [customization                  setSystemConfigureTabUpdateDefaultKey:          @"UpdateTab"];          //  equal update's configure.
         [customization                  setSystemConfigureTabUpdateZpwiaopsrpsded:      @"StickerLibrary"];     //  maybe equal update's configure.
         [customization                  setSystemConfigureTabPageUpdateZpwiaopsrpsded:  @"StickerLibrary"];     //  maybe equal update's configure.
         [customization                  setStickerDownloadZpwiaopsrpsded:               @"StickerLibrary"];     //  maybe equal update's configure.
    
         controller                      = [TDStickerLibraryViewController stickerLibarayWithCustomization: customization];
         NSParameterAssert( nil != controller );
    
         [controller                     setFinishedStickerLibraryCallbackBlock: ^(UIImage * stickerImage)
         {
             NSLog( @"sticker image : %@", stickerImage );
         }];
    
         [self                           presentViewController: controller animated: YES completion: nil];
    }

Documents

  • Configure Files Schema

    • [Table Schema - StickerLibrary - en.ods](ReferenceFiles/Documents/Table Schema - StickerLibrary - en.ods)
    • [Table Schema - StickerLibrary - zh-Hant.ods](ReferenceFiles/Documents/Table Schema - StickerLibrary - zh-Hant.ods)

NOTE:

.ods file editor : OpenOffice

  • System Configure JSON Sample

    1. System default configure of the Tab Menu :
    • [StickerLibraryTabDefault.json](ReferenceFiles/Configure - sample/StickerLibraryTabDefault.json)
    1. The System Update configure :
    • [StickerLibrarySystemUpdate.json](ReferenceFiles/Configure - sample/StickerLibrarySystemUpdate.json)
    1. A Page configure :
    • [1001.page.face.json](ReferenceFiles/Configure - sample/1001page.face.json),
    • [1002page.weather.json](ReferenceFiles/Configure - sample/1002page.weather.json),
    • [1003page.emotion.json](ReferenceFiles/Configure - sample/1003page.emotion.json).
  • Preview Image Crop PList Sample

    • [warszawianka-weather.plist](ReferenceFiles/Configure - sample/warszawianka-weather.plist)

Special Thanks

Special Request

Sorry for my English, is very weak.

Also, please help me to fix these English syntax or error words, if you have free time and want to do.

** Thanks very much! **

Contribute

coming soon ~. ~

(You can support contributors of this project individually.)

Donate

Support the development of this library and author.

donateWithPayPal

** Bitcoin **

  • Bitcoin address 1GkUKb31JDwimpu2MJoQ1R7rjS8taX97aE
  • Bitcoin URI

*** Otherwise ~ ***

You can choose to donate these foundations, like below :

The list is reference, don't limit about this please.

Thanks for each donator.

License

TDStickerLibrary is released under the MIT License. See LICENSE for details.

Copyright © 2015-present Robin Hsu/Tech.D.Robin

Please provide attribution, it is greatly appreciated.


About

The Sticker Library is a sticker's collection view of multi-page for iOS.

Resources

License

Stars

Watchers

Forks

Packages

No packages published