SectionIndexTitle in TableView
up vote
-2
down vote
favorite
I am creating list in TableView according to this tutorial. However I would like to have all leters in IndexTitle. It is OK, if I only add all leters to carSectionTitles
array? I think it doesn't work correctly in simulator. Could someone help me?
swift tableview
add a comment |
up vote
-2
down vote
favorite
I am creating list in TableView according to this tutorial. However I would like to have all leters in IndexTitle. It is OK, if I only add all leters to carSectionTitles
array? I think it doesn't work correctly in simulator. Could someone help me?
swift tableview
add a comment |
up vote
-2
down vote
favorite
up vote
-2
down vote
favorite
I am creating list in TableView according to this tutorial. However I would like to have all leters in IndexTitle. It is OK, if I only add all leters to carSectionTitles
array? I think it doesn't work correctly in simulator. Could someone help me?
swift tableview
I am creating list in TableView according to this tutorial. However I would like to have all leters in IndexTitle. It is OK, if I only add all leters to carSectionTitles
array? I think it doesn't work correctly in simulator. Could someone help me?
swift tableview
swift tableview
asked Nov 7 at 19:16
Max
12
12
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
-1
down vote
This is by no means an elegant solution, but in your view did load, replace:
// 2
carSectionTitles = [String](carsDictionary.keys)
carSectionTitles = carSectionTitles.sorted(by: { $0 < $1 })
with the following:
// 2
carSectionTitles = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "U", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]
With everything else the same I think this will do what you want.
How can I do that more elegantly? I would like to learn it. btw, as I mentioned, I tried this, but I think it doesn't work correctly.
– Max
Nov 7 at 20:34
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
-1
down vote
This is by no means an elegant solution, but in your view did load, replace:
// 2
carSectionTitles = [String](carsDictionary.keys)
carSectionTitles = carSectionTitles.sorted(by: { $0 < $1 })
with the following:
// 2
carSectionTitles = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "U", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]
With everything else the same I think this will do what you want.
How can I do that more elegantly? I would like to learn it. btw, as I mentioned, I tried this, but I think it doesn't work correctly.
– Max
Nov 7 at 20:34
add a comment |
up vote
-1
down vote
This is by no means an elegant solution, but in your view did load, replace:
// 2
carSectionTitles = [String](carsDictionary.keys)
carSectionTitles = carSectionTitles.sorted(by: { $0 < $1 })
with the following:
// 2
carSectionTitles = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "U", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]
With everything else the same I think this will do what you want.
How can I do that more elegantly? I would like to learn it. btw, as I mentioned, I tried this, but I think it doesn't work correctly.
– Max
Nov 7 at 20:34
add a comment |
up vote
-1
down vote
up vote
-1
down vote
This is by no means an elegant solution, but in your view did load, replace:
// 2
carSectionTitles = [String](carsDictionary.keys)
carSectionTitles = carSectionTitles.sorted(by: { $0 < $1 })
with the following:
// 2
carSectionTitles = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "U", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]
With everything else the same I think this will do what you want.
This is by no means an elegant solution, but in your view did load, replace:
// 2
carSectionTitles = [String](carsDictionary.keys)
carSectionTitles = carSectionTitles.sorted(by: { $0 < $1 })
with the following:
// 2
carSectionTitles = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "U", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]
With everything else the same I think this will do what you want.
answered Nov 7 at 20:20
grbcp5
262
262
How can I do that more elegantly? I would like to learn it. btw, as I mentioned, I tried this, but I think it doesn't work correctly.
– Max
Nov 7 at 20:34
add a comment |
How can I do that more elegantly? I would like to learn it. btw, as I mentioned, I tried this, but I think it doesn't work correctly.
– Max
Nov 7 at 20:34
How can I do that more elegantly? I would like to learn it. btw, as I mentioned, I tried this, but I think it doesn't work correctly.
– Max
Nov 7 at 20:34
How can I do that more elegantly? I would like to learn it. btw, as I mentioned, I tried this, but I think it doesn't work correctly.
– Max
Nov 7 at 20:34
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53196298%2fsectionindextitle-in-tableview%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown