定義屬性 – 定時器
@property (nonatomic ,strong) NSTimer *timer; // 定時器
//設置定時器
self.timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(change:) userInfo:nil repeats:YES];
//定時器執行方法
- (void)change:(NSTimer *)time{
// 設置滾動視圖的偏移量,self.page.currentPage是設置當前的 page 頁數
[self.yyScrollView setContentOffset:CGPointMake((self.page.currentPage + 1) * self.view.frame.size.width, 0) animated:NO];
}