Skip to content

Commit 81a2cbd

Browse files
authored
refactor(ios): clean up iOS8 or lower specific checks in codebase (NativeScript#5581)
1 parent 52c0448 commit 81a2cbd

File tree

4 files changed

+74
-303
lines changed

4 files changed

+74
-303
lines changed

tests/app/ui/list-view/list-view-tests.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,7 @@ export class ListViewTest extends testModule.UITest<listViewModule.ListView> {
188188
completed = args.index === (listView.items.length - 1);
189189
});
190190

191-
// iOS7 needs to know the size of the cell before it is generated so we first measure them using fake cell
192-
// then we generate the real cells. This cause itemLoading to be called twice per index.
193-
let expected = (platform.device.os === platform.platformNames.ios && utils.ios.MajorVersion === 7) ? 2 : 1;
191+
let expected = 1;
194192
TKUnit.waitUntilReady(() => completed);
195193
TKUnit.assertEqual(indexes[0], expected, "itemLoading called more than once");
196194
TKUnit.assertEqual(indexes[1], expected, "itemLoading called more than once");
@@ -557,12 +555,7 @@ export class ListViewTest extends testModule.UITest<listViewModule.ListView> {
557555

558556
this.waitUntilListViewReady();
559557

560-
if (utils.ios && utils.ios.MajorVersion < 8) {
561-
TKUnit.assertEqual(converterCalledCounter, listViewModel.get("items").length * 2, "Converter should be called once for every item.");
562-
}
563-
else {
564-
TKUnit.assertEqual(converterCalledCounter, listViewModel.get("items").length, "Converter should be called once for every item.");
565-
}
558+
TKUnit.assertEqual(converterCalledCounter, listViewModel.get("items").length, "Converter should be called once for every item.");
566559
}
567560

568561
public test_RemovingChildViewsBeforeListView() {

tns-core-modules/ui/core/view/view.ios.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -578,8 +578,6 @@ export class CustomLayoutView extends View {
578578
}
579579
}
580580

581-
const majorVersion = iosUtils.MajorVersion;
582-
583581
export namespace ios {
584582
export function isContentScrollable(controller: UIViewController, owner: View): boolean {
585583
let scrollableContent = (<any>owner).scrollableContent;

0 commit comments

Comments
 (0)