Skip to content

Commit

Permalink
put return inside available to compatible with older versions
Browse files Browse the repository at this point in the history
  • Loading branch information
CalvinChangCC committed May 22, 2024
1 parent 3728b83 commit 525d04b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,18 @@ extension ListCollectionViewAdapter {
@inlinable
public func flowDelegate(at indexPath: IndexPath) -> SectionFlowDelegate? {
if #available(iOS 13.0, *) {
controller(at: indexPath)?.layoutProvider?.flowLayoutProvider
return controller(at: indexPath)?.layoutProvider?.flowLayoutProvider
} else {
controller(at: indexPath)?.flowDelegate
return controller(at: indexPath)?.flowDelegate
}
}

@inlinable
public func flowDelegate(at index: Int) -> SectionFlowDelegate? {
if #available(iOS 13.0, *) {
controller(at: index)?.layoutProvider?.flowLayoutProvider
return controller(at: index)?.layoutProvider?.flowLayoutProvider
} else {
controller(at: index)?.flowDelegate
return controller(at: index)?.flowDelegate
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,18 @@ extension SingleSectionCollectionViewAdapter {
@inlinable
public func flowDelegate(at indexPath: IndexPath) -> SectionFlowDelegate? {
if #available(iOS 13.0, *) {
controller(at: indexPath)?.layoutProvider?.flowLayoutProvider
return controller(at: indexPath)?.layoutProvider?.flowLayoutProvider
} else {
controller(at: indexPath)?.flowDelegate
return controller(at: indexPath)?.flowDelegate
}
}

@inlinable
public func flowDelegate(at index: Int) -> SectionFlowDelegate? {
if #available(iOS 13.0, *) {
controller(at: index)?.layoutProvider?.flowLayoutProvider
return controller(at: index)?.layoutProvider?.flowLayoutProvider
} else {
controller(at: index)?.flowDelegate
return controller(at: index)?.flowDelegate
}
}
}
Expand Down

0 comments on commit 525d04b

Please sign in to comment.