-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Swift3 conversion #48
base: master
Are you sure you want to change the base?
Conversation
Hi, |
Example/Example/CustomCell.swift
Outdated
@@ -18,10 +18,10 @@ class CustomCell: Cell, CellType { | |||
return | |||
} | |||
|
|||
titleLabel.text = cellmodel.title + "(\(cellmodel.indexPath.section),\(cellmodel.indexPath.row))" | |||
titleLabel.text = cellmodel.title + "(\((cellmodel.indexPath as NSIndexPath).section),\((cellmodel.indexPath as NSIndexPath).row))" | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unneeded casting
titleLabel.text = cellmodel.title + "(\(cellmodel.indexPath.section,\(cellmodel.indexPath.row))"
Hakuba/Hakuba.swift
Outdated
subscript(indexPath: NSIndexPath) -> CellModel? { | ||
return self[indexPath.section][indexPath.row] | ||
subscript(indexPath: IndexPath) -> CellModel? { | ||
return self[(indexPath as NSIndexPath).section][(indexPath as NSIndexPath).row] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unneeded casting
Hakuba/Hakuba.swift
Outdated
public func getCellmodel(indexPath: NSIndexPath) -> CellModel? { | ||
return sections.get(indexPath.section)?[indexPath.row] | ||
public func getCellmodel(_ indexPath: IndexPath) -> CellModel? { | ||
return sections.get((indexPath as NSIndexPath).section)?[(indexPath as NSIndexPath).row] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unneeded casting
Hakuba/Hakuba.swift
Outdated
return remove(indexes: [index]) | ||
} | ||
|
||
func remove(range: Range<Int>) -> Self { | ||
func remove(_ range: CountableClosedRange<Int>) -> Self { | ||
let indexes = range.map { $0 } | ||
return remove(indexes: indexes) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think better if you add
func remove(_ range: CountableRange<Int>) -> Self {...}
delegate?.scrollViewDidScroll?(scrollView) | ||
|
||
if let indexPath = tableView?.indexPathsForVisibleRows?.first { | ||
let topSection = indexPath.section | ||
let topSection = (indexPath as NSIndexPath).section | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unneeded casting
Hakuba/Hakuba.swift
Outdated
.filter { $0 >= 0 && $0 < self.sectionsCount } | ||
|
||
var remainSections: [Section] = [] | ||
var i = 0 | ||
|
||
for j in 0..<sectionsCount { | ||
if let k = sortedIndexes.get(i) where k == j { | ||
if let k = sortedIndexes.get(i) , k == j { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove a space previous to ,
Hakuba/Hakuba.swift
Outdated
public func tableView(tableView: UITableView, willDisplayHeaderView view: UIView, forSection section: Int) { | ||
guard let view = view as? HeaderFooterView where section == willFloatingSection else { | ||
public func tableView(_ tableView: UITableView, willDisplayHeaderView view: UIView, forSection section: Int) { | ||
guard let view = view as? HeaderFooterView , section == willFloatingSection else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove a space previous to ,
Hakuba/Section.swift
Outdated
.filter { $0 >= 0 && $0 < self.count } | ||
|
||
var remainCellmodels: [CellModel] = [] | ||
var i = 0 | ||
|
||
for j in 0..<count { | ||
if let k = sortedIndexes.get(i) where k == j { | ||
if let k = sortedIndexes.get(i) , k == j { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove a space previous to ,
Hakuba/Section.swift
Outdated
func remove(range: Range<Int>) -> Self { | ||
let indexes = range.map { $0 } | ||
func remove(_ range: CountableClosedRange<Int>) -> Self { | ||
let indexes = [Int](range) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think better if you add
func remove(_ range: CountableRange<Int>) -> Self {...}
I think you should add |
@ra1028 I updated the project according to your notes. Thanks for the review. |
@eskizyen |
Converted the code to Swift 3.0, example project runs without any problem.