• This repository has been archived on 12/Apr/2018
  • Stars
    star
    122
  • Rank 292,031 (Top 6 %)
  • Language
    Objective-C
  • Created about 12 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

SCPagingGridView is a collection of iOS viewcontroller containers, views, & helpers.

SCPagingGridView

SCPagingGridView is a collection of iOS UIViewController containers, views, & helpers. The project is comprised of the following components:

SCPageViewController

A custom page view controller that supports both horizontal & vertical paging.

SCGridView

A UIView sublcass that lays out its children according to a given schema.

Screen shot:

iPhone example

Sample Code:

@implementation SCExampleGridViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor scrollViewTexturedBackgroundColor];
    
    CGFloat height = floorf(self.view.bounds.size.height * .8f);
    CGFloat width = floorf(self.view.bounds.size.width * .8f);
    
    SCGridView *grid = [[SCGridView alloc] initWithFrame:CGRectMake(floorf((self.view.bounds.size.width - width)/2.0f), floorf((self.view.bounds.size.height - height)/2.0f), width, height)];
    grid.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
    grid.layer.cornerRadius = 6.0f;
    grid.clipsToBounds = YES;
    grid.backgroundColor = [UIColor clearColor];
    grid.schema = @[ @(1), @(1), @(2) ];
    grid.rowSpacing = 5.0f;
    grid.colSpacing = 5.0f;
    [self.view addSubview:grid];
    
    NSMutableArray *cells = [[NSMutableArray alloc] initWithCapacity:grid.size];

    UILabel *label = [[UILabel alloc] init];
    label.textAlignment = UITextAlignmentCenter;
    label.text = @"1st cell";
    [cells addObject:label];
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    [button setTitle:@"2nd cell" forState:UIControlStateNormal];
    [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [button setTitleColor:[UIColor blueColor] forState:UIControlStateHighlighted];
    button.backgroundColor = [UIColor whiteColor];
    [cells addObject:button];
    
    label = [[UILabel alloc] init];
    label.numberOfLines = 0;
    label.textAlignment = UITextAlignmentCenter;
    label.text = @"3rd cell";
    [cells addObject:label];
    
    label = [[UILabel alloc] init];
    label.numberOfLines = 0;
    label.textAlignment = UITextAlignmentCenter;
    label.text = @"4th cell";
    [cells addObject:label];
    
    grid.cells = cells;
}

@end

SCPagingGridViewController

A view controller container that supports laying out a series of cells in pageable grid views.

Screen shot:

iPhone example

SCViewRecycler

A class that recycles views. It is similar to UITableView's reusable cells system, but can be used for any view type.

Usage

To use SCPagingGridView, add the source/ files into your XCode Project. The preferred method is to setup a git submodule and reference the files in your Xcode project. git submodule add https://github.com/scribd/SCPagingGridView.git SCPagingGridView

Requirements

SCPagingGridView requires iOS 5.0+ and Xcode 4.3+ The projects uses ARC, but it may be used with non-ARC projects by setting the: -fobjc-arc compiler flag on the *.m files. You can set this flag under Target -> Build Phases -> Compile Sources

Apps

SCPagingGridView is used in the following apps:

License


 Permission is hereby granted, free of charge, to any person obtaining a copy of
 this software and associated documentation files (the "Software"), to deal in
 the Software without restriction, including without limitation the rights to
 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
 of the Software, and to permit persons to whom the Software is furnished to do
 so, subject to the following conditions:
 
 The above copyright notice and this permission notice shall be included in all
 copies or substantial portions of the Software.
 
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
 

More Repositories

1

Weaver

Dependency Injection framework for Swift (iOS/macOS/Linux)
Swift
735
star
2

LiveCollections

Automatically perform UITableView and UICollectionView animations between two sets of immutable data. It supports generic data types and is fully thread-safe.
Swift
340
star
3

robot-fruit-hunt

A fun little game that doubles as a JavaScript programming exercise.
JavaScript
142
star
4

advancecomp

Fork of the AdvanceCOMP re-compression utilities
C++
103
star
5

objinsync

Continuously synchronize directories from remote object store to local filesystem
Go
93
star
6

Xcode-OptimizePNG

A modification for Xcodes 'Compress PNG Files' Build Setting
Shell
59
star
7

flash_heed

Fixes all Flash elements on a page so that they heed DOM stacking order.
JavaScript
45
star
8

terraform-aws-datadog

Terraform module for setting up AWS Datadog integration
HCL
38
star
9

rscribd

Ruby client library for the Scribd API
Ruby
32
star
10

FLBugKit

A simple library that allows users and testers to email bugs from within an iOS application
Objective-C
31
star
11

datadog_backup

Backup your Datadog account.
Ruby
30
star
12

hive-udaf-maxrow

A simple aggregate function (UDAF) for Hive -- like max() but it allows you to refer to additional columns in the maximal row.
Java
25
star
13

github-action-datadog-reporting

Ruby
22
star
14

scribd.github.io

The Scribd technology site, where we share the challenges in building the world's largest library
HTML
17
star
15

pr-preview-example

Pull Request Previews with Github Actions, AWS App Mesh, and ECS
HCL
15
star
16

keynote

keynote
Python
14
star
17

find-slack-user-action

GitHub Action that retrieves a Slack username for the author of the most recent commit (or provided email).
JavaScript
10
star
18

armadillo

A delightful audio player for Android.
Kotlin
10
star
19

Lucid

Lucid is a Swift library for building robust data layers for applications.
Swift
9
star
20

terraform-aws-recycle-eks

Terraform module for automatically recycling EKS worker nodes
Python
7
star
21

Meta

Generate beautiful code with plain code.
Swift
6
star
22

GAProxy

A wrapper for Google Analytics in Actionscript
ActionScript
6
star
23

go-sdk

Go SDK
Go
5
star
24

kafka-player

A simple scala app that plays messages from a file onto a Kafka topic.
Scala
5
star
25

vaulttest

Integration test Vault code locally!
Go
3
star
26

elasticache-slowlog-to-datadog

Use AWS Lambda to collect Elasticache Redis slowlog entries and submit to Datadog
Ruby
3
star
27

amazon-ecs-service-action

Amazon ECS Service Action for GitHub Actions
JavaScript
3
star
28

JSCRIBD

A Java library for interacting with the Scribd API.
Java
3
star
29

scribd-uploader-osx

A fully native Cocoa Macintosh uploader app for the Scribd.com website.
R
3
star
30

fastly-waf-ece

Event Correlation Engine for Fastly WAF Events ('event correlation engine' sounds a lot cooler than 'log smoosher')
Go
3
star
31

megaport-datadog

Publishing Megaport metrics to Datadog
Python
2
star
32

terraform-s3-rbac

Terraform module to allow users to easily create buckets in their own account and then give access to said buckets via AWS IAM principals
HCL
2
star
33

rails-git-scripts

A simple collection of useful scripts for Ruby on Rails developers who use Git
2
star
34

terraform-elasticache-slowlog-to-datadog

Deploy Elasticache Slowlog to Datadog lambda function to AWS account
HCL
2
star
35

terraform-aws-app-secrets

A Terraform module to create application secrets stored in AWS Secrets Manager.
HCL
1
star
36

amazon-appmesh-virtual-service-action

Amazon App Mesh Virtual Service Action for GitHub Actions
JavaScript
1
star
37

amazon-appmesh-route-action

Amazon App Mesh Route Action for GitHub Actions
JavaScript
1
star
38

tail-action

Github Action to retrieve the last n lines of a file or string.
1
star
39

.github

Default files for repositories across the organization
1
star
40

Coffee-Time-OSX

The Mac OS X front-end for Coffee Time.
Objective-C
1
star
41

job-notification

A GitHub Action for sending job notifications
1
star
42

amazon-appmesh-virtual-node-action

Amazon App Mesh Virtual Node Action for GitHub Actions
JavaScript
1
star
43

Coffee-Time-Backend

The Heroku back-end for Coffee Time.
Ruby
1
star
44

amazon-appmesh-virtual-gateway-route-action

Amazon App Mesh Virtual Gateway Route Action for GitHub Actions
JavaScript
1
star
45

amazon-appmesh-virtual-router-action

Amazon App Mesh Virtual Router Action for GitHub Actions
JavaScript
1
star
46

amazon-servicediscovery-service-action

Amazon ServiceDiscovery Service Action for GitHub Actionss
JavaScript
1
star
47

delta-lambdas

Collection of useful Lambda utilities for interacting with Delta Lake tables
Rust
1
star