Latest0.3.0
Homepagehttps://github.com/shams-ahmed/SAScrollTableViewCell
LicenseMIT
Platformsios 7.0, requires ARC
DependenciesSDWebImage
FrameworksMediaPlayer
Authors

Version
Platform

Purpose

An easy-to-use UITableViewCell subclass that implements a scrolling effect cell with media content such as images, video sound etc…

Let’s see example

Screenshot:

Usage

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

How to use

import class #import "SAScrollTableViewCell.h" and add its delegate SAScrollTableViewCellDelegate.

Register class inside init or viewDidLoad method [self.tableView registerClass:[SAScrollTableViewCell class] forCellReuseIdentifier:@"Cell"];. Set height of cell to 140 in heightForRowAtIndexPath.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *const cellIdentifier = @"Cell";
    SAScrollTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];

    if (!cell) {
        cell = [[SAScrollTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];

    }

    cell.delegate = self;

    [cell setMedia:@[
                     [SAScrollMedia mediaWithType:SAMediaTypeVideoAsset
                                            title:@"title"
                                           object:[[NSBundle mainBundle] URLForResource:@"sample1" withExtension:@"mov"]],
                     [SAScrollMedia mediaWithType:SAScrollMediaTypeImageName title:@"title" object:@"sample1.jpg"],
                     [SAScrollMedia mediaWithType:SAScrollMediaTypeImageName title:@"title" object:@"sample2.jpg"],
                     [SAScrollMedia mediaWithType:SAScrollMediaTypeImageName title:@"title" object:@"sample3.jpg"]
                     ]];

    return cell;
}

Adding media content:

SAScrollTableViewCell expects SAScrollMedia which holds each media content such as images, video and sound. Use factory method to create object mediaWithType:(SAScrollMediaType)type title:(NSString *)title object:(id)object;. At present only four media type are supported use the keys below:

typedef NS_ENUM(NSUInteger, SAScrollMediaType) {
    /**
     *  UIImage object
     */    SAScrollMediaTypeImageObject,
    /**
     *  name of a file within main bundle i.e sample1.png
     */    SAScrollMediaTypeImageName,
    /**
     *  NSData of a image
     */    SAScrollMediaTypeRawImage,
    /**
     *  NSURL of a link to a video file supported by iOS
     */    SAScrollMediaTypeVideoAsset,
    /**
     *  NSURL link of image on the web i.e http://lorempixel.com/250/250/
     */    SAScrollMediaTypeImageURL
    /**
     *  for subclassing
     */    SAScrollMediaTypeOther
};

Requirements

iOS 7,
Portait only supported

Installation

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

pod "SAScrollTableViewCell"

Author

shams ahmed, [email protected]

License

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

Bitdeli Badge

Latest podspec

{
    "name": "SAScrollTableViewCell",
    "version": "0.3.0",
    "summary": "UITableViewCell with scrolling media: images, videos, sound etc...",
    "homepage": "https://github.com/shams-ahmed/SAScrollTableViewCell",
    "screenshots": [
        "https://raw.githubusercontent.com/shams-ahmed/SAScrollTableViewCell/master/Assets/Screenshot1.png",
        "https://raw.githubusercontent.com/shams-ahmed/SAScrollTableViewCell/master/Assets/Screenshot2.png"
    ],
    "license": "MIT",
    "authors": {
        "shams ahmed": "[email protected]"
    },
    "source": {
        "git": "https://github.com/shams-ahmed/SAScrollTableViewCell.git",
        "tag": "0.3.0"
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Classes/**/*.{h,m}",
    "resources": "Classes/**/*.{png}",
    "dependencies": {
        "SDWebImage": []
    },
    "frameworks": "MediaPlayer"
}

Pin It on Pinterest

Share This