@H_403_37@
import
UIKit
@H_403_37@
import
UIKit
ViewController
:
UIViewController
,
UIScrollViewDelegate
{
//界面设计元素引用
@IBOutlet
var
pageControl:
UIPageControl
!
UIScrollView
!
[
"name"
:
"Swift"
"pic"
"swift.png"
],
"oc.jpg"
"Java"
"java.png"
]
func
viewDidLoad() {
.viewDidLoad()
CGSizeMake
(
CGFloat
(
CGRectGetWidth
(
self
.view.bounds)) *
.courses.count),
.view.bounds)
false
false
false
self
true
size = scrollView.bounds.size
for
(seq,course)
in
courses.enumerate() {
UIView
()
UIImageView
(image:
UIImage
(named:course[
]!))
UIColor
.greenColor()
UILabel
(frame:
CGRect
(x: 0,y: 20,width: 100,height: 20))
]
(x:
(seq) * size.width,y: 0,
.clearColor()
"pageChanged:"
UIControlEvents
.
ValueChanged
)
!) {
Int
(scrollView.contentOffset.x / scrollView.frame.size.width)
) {
(sender.currentPage)
true
)
}