페이지 뷰
//
// ViewController.swift
// PageView2
//
// Created by MacBookPro on 2017. 12. 14..
// Copyright © 2017년 MacBookPro. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var imageView: UIImageView!
@IBOutlet weak var pageController: UIPageControl!
var images = ["aaa.jpg","bbb.jpg","ccc.jpg","ddd.jpg"]
override func viewDidLoad() {
super.viewDidLoad()
pageController.numberOfPages = images.count
pageController.currentPage = 0
pageController.pageIndicatorTintColor = UIColor.green
pageController.currentPageIndicatorTintColor = UIColor.red
imageView.image = UIImage(named:images[0])
}
@IBAction func pageChanged(_ sender: UIPageControl) {
imageView.image = UIImage(named: images[pageController.currentPage])
}
}
'ios 뽀개기 > ios 응용해보기' 카테고리의 다른 글
json parser (0) | 2017.12.18 |
---|---|
xml parser (0) | 2017.12.18 |
탭뷰 (0) | 2017.12.15 |
맵뷰 map view (0) | 2017.12.14 |
웹뷰 webview (0) | 2017.12.14 |
댓글