Newer Version Available

This content describes an older version of this product. View Latest

Customize the iOS SDK

After you build the Loyalty Management Mobile SDK for iOS, you can customize the colors and fonts to suit your requirements. You can also replace the existing images and logos included in the SDK for the sample app.
  1. Customize the colors.
    1. With your Sample Apps project open in Xcode, select MyNTORewards | MyNTORewards | Assets | Colors.
    2. To modify an existing colorset, click Any Appearance, and under Color, edit the Hex value.
    3. To add the dark color, click Dark, and from Content, select a color.
    4. To add a color theme, open the MyNTORewards | MyNTORewards | Misc | Color file, and add a color theme to the sample code.
      For example, to add blue color to the theme, use this code:
      1struct ColorTheme {let blue = Color("BlueColor")}
    5. To use a color in the app, use these sample codes as view or within view modifier:
      1ZStack {
      2       Color.theme.[color]
      3}
      Or background(Color.theme.[color])
      For example, to add Blue color to the theme, use this code as view or within view modifier:
      1ZStack {
      2       Color.theme.blue
      3}
      Or background(Color.theme.blue)
  2. Add your font to the iOS app.
    1. Add your font to the Xcode project.
    2. Add your font to the MyNTORewards | MyNTORewards | Info.plist file.
  3. Use the font that you added in the app.
    1. With your Sample Apps project open in Xcode, select MyNTORewards | MyNTORewards | UICompnents | FontStyles.swift file.
    2. Edit the file and add the location where you want to use the font. For example, to customize a footer text, use this sample code:
      1static var footerText: Font {
      2                            return Font.custom("SFPro-Regular", size: 16)
      3}
    3. In the Text view, call the font style as a new modifier with the sample code:
      1Text("Footer")
      2                            .font(.footerText)
    4. Save your changes.
  4. To replace an image, go to MyNTORewards | MyNTORewards | Assets | Images. For example, to replace a logo, go to theMyNTORewards | MyNTORewards | Assets | Iconsfolder, and modify the logo file.