SkillAgentSearch skills...

SWScrollView

StarWars Opening Scroll View Sample

Install / Use

/learn @somtd/SWScrollView
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

SWScrollView

Scroll view like Star Wars opening crawl.

sample0  sample1  sample2

<img src="http://25.media.tumblr.com/84f59de6f9e5a97d0bdb154585d8813f/tumblr_mqdk19HCh41qgwcbqo1_400.gif" alt="SWScrollView" title="SWScrollView" style="display:block; margin: 10px auto 30px auto; align:center">

##Requirements

iOS5.1 or later

##Installing By using CocoaPods

pod 'SWScrollView', '~> 0.0.1'

##Usage

Import header

#import "SWScrollView.h"

Instantiate SWScrollView along with start point and add view on any other view that you want.

CGPoint scrollStartPoint = CGPointMake(0, -600);
SWScrollView *scrollView = [SWScrollView scrollViewWithStartPoint:scrollStartPoint];
[self.view addSubview:scrollView];

If you want start animating automatically, call following method.

[scrollView startAnimationWithDuration:12.f completion:^(BOOL finished) {
        // Write what you to do when finished this animation.
}];

##Customize

###Crawling message Of course You can change crawling message in SWScrollView.xib.

###Perspective of scroll view If you want to change perspective of scroll view. Edit -(void)setupScrollPerspective method in SWScrollView.m.

- (void)setupScrollPerspective
{
    CATransform3D transform = CATransform3DIdentity;
    //z distance
    float distance = [[UIScreen mainScreen] bounds].size.height;
    float ratio    = [[UIScreen mainScreen] bounds].size.height/[[UIScreen mainScreen] bounds].size.height;
    transform.m34 = - ratio / distance;
    transform = CATransform3DRotate(transform, 60.0f * M_PI / 180.0f, 1.f, 0.0f, 0.0f);
    self.layer.transform = transform;
    self.layer.zPosition = distance * ratio;
    self.layer.position = CGPointMake([[UIScreen mainScreen] bounds].size.width/2,
                                      [[UIScreen mainScreen] bounds].size.height/3);
}

Related Skills

View on GitHub
GitHub Stars77
CategoryDevelopment
Updated17d ago
Forks8

Languages

Objective-C

Security Score

95/100

Audited on Mar 12, 2026

No findings