-
Notifications
You must be signed in to change notification settings - Fork 0
/
SectionInfo.swift
executable file
·51 lines (39 loc) · 1.41 KB
/
SectionInfo.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//
// SectionInfo.swift
// StarCard
//
// Created by Semper Idem on 14-10-22.
// Copyright (c) 2014年 星夜暮晨. All rights reserved.
//
import Foundation
// 定义了分节表头的一系列属性、方法
class SectionInfo: NSObject {
var open: Bool!
var play: Play!
var headerView: SectionHeaderView!
var rowHeights = NSMutableArray()
func countOfRowHeights() -> Int {
return self.rowHeights.count
}
func objectInRowHeightsAtIndex(_ idx: Int) -> AnyObject {
return self.rowHeights[idx] as AnyObject
}
func insertObject(_ anObject: AnyObject, inRowHeightsAtIndex: Int) {
self.rowHeights.insert(anObject, at: inRowHeightsAtIndex)
}
func insertRowHeights(_ rowHeightArray: NSArray, atIndexes: IndexSet) {
self.rowHeights.insert(rowHeightArray as [AnyObject], at: atIndexes)
}
func removeObjectFromRowHeightsAtIndex(_ idx: Int) {
self.rowHeights.removeObject(at: idx)
}
func removeRowHeightsAtIndexes(_ indexes: IndexSet) {
self.rowHeights.removeObjects(at: indexes)
}
func replaceObjectInRowHeightsAtIndex(_ idx: Int, withObject: AnyObject) {
self.rowHeights[idx] = withObject
}
func replaceRowHeightsAtIndexes(_ indexes: IndexSet, withRowHeight: NSArray) {
self.rowHeights.replaceObjects(at: indexes, with: withRowHeight as [AnyObject])
}
}