{"__v":9,"_id":"5618eb1bf908460d00daf40e","category":{"__v":9,"_id":"56157b750f5ed00d00483dd8","pages":["56157bbcf2d81d0d006c895b","5618eb1bf908460d00daf40e","561949613217dd0d003ab868","561949fced64430d0063f0bb","56194d8088fdee0d00fb9c76","56cddce649abf10b0036a313","56cdded9e538330b0021ab24","56df63ef67ccff1700c99efa","56df659a723dd61700ea1481"],"project":"552829408962f339009a678d","version":"552829408962f339009a6790","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-10-07T20:07:17.140Z","from_sync":false,"order":5,"slug":"ios-sdk","title":"iOS SDK"},"parentDoc":null,"project":"552829408962f339009a678d","user":"55282916d9e1db2d00cd923c","version":{"__v":26,"_id":"552829408962f339009a6790","project":"552829408962f339009a678d","createdAt":"2015-04-10T19:49:20.516Z","releaseDate":"2015-04-10T19:49:20.516Z","categories":["552829418962f339009a6791","55284ed68962f339009a67e1","55286c73391a362500d9b3f4","552918f6b316811900149f59","5529b255d739240d00a3483e","553287590a578a0d008d4ff5","55329385e7d1fa0d003fc946","5550b55200420e0d00d1312f","55525fca953c9c0d00f507d7","559199695631432f002d358a","559d8d96980b801700d5ec7e","55c5e833cccdeb2d004e24b9","55d76504f662951900fc0e7d","55ea213cc62aa02f008229cd","56157b750f5ed00d00483dd8","561981fbac0924170069f4e8","561b8b1ea430930d0037ea67","563417428b86331700b488ca","56cd785bface161300dae0ec","56cdcc6e70db8a15006395f4","56cdf1b749abf10b0036a34a","56cedc8ce50c9c1b00830423","56e97ba8d825061900d1ac83","570d505228e6900e00477229","573614ca2ab52e1700c8e851","57d556a2496a3117004d70cf"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-10-10T10:40:27.249Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"You can easily customize appearance of your app when using our SDK.\nActor doesn't use UIAppearance protocol to provide much more flexibility and does not interact with other parts of app.\nIn minutes you can alter defaults of SDK and make your unique application.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Starting with customization\"\n}\n[/block]\nAll customization must be done by changing values in ```ActorSDK.sharedActor().style``` before starting any Actor UI. You can change parameters after, but result will be unexpected.\n\nSome of styles are by default depend on others. For example, cell text colors depends on ```vcTextColor``` by default, but you can override behaviour by setting new value to value.  Basic colors have prefixes ``vc`` that means View Controller. Next in the hierarchy are ```tab*```, ```navigation*``` and other values. Latest is colors specific to content like ```contacts*```, ```dialogs*``` etc.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Example: Change UINavigationBar\"\n}\n[/block]\nFor styling UINavigation bar there are some parameters:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"let style = ActorSDK.sharedActor().style \\n\\n// Navigation Bar color\\nstyle.navigationBgColor = UIColor(rgb: 0x272422)\\n// Navigation Bar colors\\nstyle.navigationTintColor = UIColor(rgb: 0xf3eadf)\\n// Navigation Bar title\\nstyle.navigationTitleColor = UIColor(rgb: 0xf3eadf)\\n// Navigation Bar subtitle\\nstyle.navigationSubtitleColor = UIColor(rgb: 0x7c7365)\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Reference\"\n}\n[/block]\nBest reference is source code. Just read ActorStyles.swift comments file for more details.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Replacing Resources\"\n}\n[/block]\nSDK is configured to take resources from main app bundle first and then try to use resources from framework bundle.\n\nFor now there are 4 resources that is considered as stable:\n* bg_1.jpg/bg_2.jpg/bg_3.jpg - Custom backgrounds. (you can customize default color for chat in ```ActorSDK.sharedActor().style```.\n* notification.caf - sound of in app notification.\n\nIf you want to customize this, just put files with this names to your app.\n\nYou can see other resources used in app by opening contents of ActorSDK.framework directory.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Altering localizations or adding new\"\n}\n[/block]\nLocalization is separated to two parts. Core localizations and App localization.\nCore localizations are .properties files and used by Actor Core. App localization is Localized.strings file and used by iOS implementation.\n\nMostly Core files is used for service messages, onlines and months. App Strings is used for other stuff.\n\nIf you want to alter strings of app, just add it to your Localized.strings file. All keys you can find in framework bundle. If you want to add new localization, add new localization to app and SDK will handle it. Just copy template from framework bundle and translate all strings to your language.\n\nFor translating core, create AppStrings_<two_letter_code>.properties and Months_<two_letter_core>.properties and place here translated lines. <two_letter_code> have first letter capitalized.","excerpt":"Change colors, images and strings of your app","slug":"ios-sdk-app","type":"basic","title":"Styling and Localization"}

Styling and Localization

Change colors, images and strings of your app

You can easily customize appearance of your app when using our SDK. Actor doesn't use UIAppearance protocol to provide much more flexibility and does not interact with other parts of app. In minutes you can alter defaults of SDK and make your unique application. [block:api-header] { "type": "basic", "title": "Starting with customization" } [/block] All customization must be done by changing values in ```ActorSDK.sharedActor().style``` before starting any Actor UI. You can change parameters after, but result will be unexpected. Some of styles are by default depend on others. For example, cell text colors depends on ```vcTextColor``` by default, but you can override behaviour by setting new value to value. Basic colors have prefixes ``vc`` that means View Controller. Next in the hierarchy are ```tab*```, ```navigation*``` and other values. Latest is colors specific to content like ```contacts*```, ```dialogs*``` etc. [block:api-header] { "type": "basic", "title": "Example: Change UINavigationBar" } [/block] For styling UINavigation bar there are some parameters: [block:code] { "codes": [ { "code": "let style = ActorSDK.sharedActor().style \n\n// Navigation Bar color\nstyle.navigationBgColor = UIColor(rgb: 0x272422)\n// Navigation Bar colors\nstyle.navigationTintColor = UIColor(rgb: 0xf3eadf)\n// Navigation Bar title\nstyle.navigationTitleColor = UIColor(rgb: 0xf3eadf)\n// Navigation Bar subtitle\nstyle.navigationSubtitleColor = UIColor(rgb: 0x7c7365)", "language": "swift" } ] } [/block] [block:api-header] { "type": "basic", "title": "Reference" } [/block] Best reference is source code. Just read ActorStyles.swift comments file for more details. [block:api-header] { "type": "basic", "title": "Replacing Resources" } [/block] SDK is configured to take resources from main app bundle first and then try to use resources from framework bundle. For now there are 4 resources that is considered as stable: * bg_1.jpg/bg_2.jpg/bg_3.jpg - Custom backgrounds. (you can customize default color for chat in ```ActorSDK.sharedActor().style```. * notification.caf - sound of in app notification. If you want to customize this, just put files with this names to your app. You can see other resources used in app by opening contents of ActorSDK.framework directory. [block:api-header] { "type": "basic", "title": "Altering localizations or adding new" } [/block] Localization is separated to two parts. Core localizations and App localization. Core localizations are .properties files and used by Actor Core. App localization is Localized.strings file and used by iOS implementation. Mostly Core files is used for service messages, onlines and months. App Strings is used for other stuff. If you want to alter strings of app, just add it to your Localized.strings file. All keys you can find in framework bundle. If you want to add new localization, add new localization to app and SDK will handle it. Just copy template from framework bundle and translate all strings to your language. For translating core, create AppStrings_<two_letter_code>.properties and Months_<two_letter_core>.properties and place here translated lines. <two_letter_code> have first letter capitalized.