In app purchase: sorting array of product identifiers

I have the following non-consumable products en RageProducts.swift.

 

public struct RageProducts {

  // MARK: identifiers product no consumible
  private static let s1 = "comic1" // name in itunnesconnect: Comic Vol 01
  private static let s2 = "comic2" // name in itunnesconnect: Comic Vol 02
  private static let s3 = "comic3" // name in itunnesconnect; Comic Vol 03
  private static let s4 = "comic4"
  private static let s5 = "comic5"
  private static let s6 = "comic6"
  private static let s7 = "comic7"
  private static let s8 = "comic8"
  private static let s9 = "comic9"
  private static let s10 = "comic10" // name in itunnesconnect: Comic Vol 10
  private static let s11 = "comic11"
  private static let s12 = "comic12"
  private static let s13 = "comic13"

  // MARK .- Set identifiers

  private static let myproductsIdentifier: Set = [RageProducts.s1,
  RageProducts.s2,
  RageProducts.s3,
  RageProducts.s4,
  RageProducts.s5,
  RageProducts.s6,
  RageProducts.s7,
  RageProducts.s8,
  RageProducts.s9,
  RageProducts.s10,
  RageProducts.s11,
  RageProducts.s12,
  RageProducts.s13]
//MARK : Reference to IAPHelper 
  public static let store = IAPHelper(productIdentifiers: RageProducts.myproductosIdentifiers)

}

 

 

Everything works fine except in the order of when they are displayed in a UITableview, it does not respect the order entered in the SET

(Set )

This shows me:

 

Comic Vol 01
Comic Vol 10
Comic Vol 11
Comic Vol 12
Comic Vol 13
Comic Vol 02
Comic Vol 03
.
.
.
Comic Vol 09

 

The correct thing should be:

Comic Vol 01
Comic Vol 02
Comic Vol 03
Comic Vol 04
Comic Vol 05
.
.
.
Comic Vol 13

 

Is there a way to sort them according to the order entered or how could this problem be solved?

 

Screenshout: https://i.stack.imgur.com/zLvRe.jpg

Powered by WPeMatico

About

You may also like...

Comments are closed.