Coverflow is free, third-party software. Tap on the partially hidden animals.
Each album cover is an
AFItemView
object.
The
AFItemView
s
are subviews of one big
AFOpenFlowView
.
The
AFOpenFlowView
is under a
CoverFlowViewController
.
There are no view controllers under this view controller.
AF stands for the author,
Alex Fajkowski.
main.m
FlowAppDelegate
:
window background is
lightGrayColor
.CoverFlowViewController
AFOpenFlowConstants.h
AFOpenFlowView
AFItemView
contains one image.AFUIImageReflection
Flow-Info.plist
cover_0.jpg
kittencover_1.jpg
cowcover_2.jpg
dogcover_3.jpg
duckcover_4.jpg
horsecover_5.jpg
frogcover_6.jpg
pigcover_7.jpg
chicken
cover_8.jpg
sheepcover_9.jpg
howling wolf profile, black on white
Follow
these instructions.
Download the following seven source files from
GitHub
by pressing the “Download ZIP” button on the lower right.
The seven files are in the
OpenFlow
folder of the
OpenFlow-master
folder you downloaded from GitHub.
Drag the files to the Flow folder of the project.
Choose options for adding these files.
Destination ☑ Copy items into destionation group’s folder
(if required).
For iOS 7 with
Automatic Reference Counting,
we have to remove every call to the methods
retain
,
release
,
autorelease
,
and
dealloc
in the seven files.
See how I removed them or commented them out in the above project.
AFOpenFlowConstants.h
AFOpenFlowView.h
AFOpenFlowView.m
AFItemView.h
AFItemView.m
AFUIImageReflection.h
AFUIImageReflection.m
Drag the following ten
.jpg
files into the Supporting Files folder of the project.
Choose options for adding these files.
Destination ☑ Copy items into destionation group’s folder
(if required).
cover_0.jpg
kittencover_1.jpg
cowcover_2.jpg
dogcover_3.jpg
duckcover_4.jpg
horsecover_5.jpg
frogcover_6.jpg
pigcover_7.jpg
chickencover_8.jpg
sheepcover_9.jpg
howling wolf profile, back on white
The
CoverFlowViewController
and the
AFOpenFlowView
contain pointers to each other.
The
dataSource
and
viewDelegate
instance variables and properties of the
AFOpenFlowView
must therefore be
weak
pointers.
See the
View Controller
project,
where this problem first came up.
The
numberOfImages
property in class
AFOpenFlowView
has a setter method
(setNumberOfImages:
)
but no getter.
Add the following getter.
- (int) numberOfImages { return numberOfImages; }
Do the same for the
number
property of class
AFItemView
.
- (int) number { return number; }
In the method
setUpInitialState
in
AFOpenFlowView.m
,
change
scrollView = [[UIScrollView alloc] initWithFrame: self.frame];to
scrollView = [[UIScrollView alloc] initWithFrame: self.bounds];This will allow the
AFOpenFlowView
to extend into the rightmost 20 pairs of pixels of the window.
Add Initial Interface Orientation Landscape (left home button)
to
Flow-Info.plist
.
Select the project Flow in the Project Navigator.
In the center panel of Xcode,
Deployment Info →
Device Orientation
Uncheck Portrait.
In
AFUIImageReflection.m
,
cast the
CGImageAlphaInfo
enumeration
kCGImageAlphaNone
to
(CGBitmapInfo)kCGImageAlphaNone
.
The last step in the instructions involves the
CoverflowViewController.xib
loadView
method in my class
CoverFlowViewController
.
I also had to add the following statement
to the
application:didFinishLaunchingWithOptions:
self.window.backgroundColor = [UIColor lightGrayColor];
beginAnimations:context:
AFOpenFlowView.m
.
See
“Animation in iOS 3”
here.
[UIView setAnimationDuration: 3.0]; //3 seconds