Reputation: 827
I have 3 schemas (dev, hom and prod) and for each schema I'd like to set a background image.
I know how to do programmatically, I'd like to know if have some way more elegant?
Upvotes: 0
Views: 259
Reputation: 21
One option to configure background assert using scheme, is to use 'Environment Variables'.
Scheme Settings:
For each scheme in your project create a environmental variable 'BackgroundImage' and have assert name as value.
To configure your UIImageView you can try using ProcessInfo class.
var backgroundAssert = ProcessInfo.processInfo.environment["BackgroundImage"] // Get Assert Name
UIImage(named:backgroundAssert) // Get UIImage from assert name
Upvotes: 2
Reputation: 6067
yes you can create plist file Called it schemas have three main category
dev, home and prod
or you can use Enum for that without plist
then create Class , SchemasManager that can manage all this process here is an example for ThemeManager.swift
https://gist.github.com/durul/16ed8ab13b2179f0bc1d87c4ca9880d1
Upvotes: 0