Skip to content

Commit 6042f40

Browse files
committed
Merge branch 'release/0.3.2'
# Conflicts: # Adamant/Assets/ru.lproj/Localizable.strings
2 parents 2aec06e + 693c17e commit 6042f40

File tree

68 files changed

+1862
-1447
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1862
-1447
lines changed

Adamant.xcodeproj/project.pbxproj

Lines changed: 85 additions & 115 deletions
Large diffs are not rendered by default.

Adamant/AppDelegate.swift

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,20 @@
88

99
import UIKit
1010
import Swinject
11-
import SwinjectStoryboard
11+
12+
extension String.adamantLocalized {
13+
struct tabItems {
14+
static let account = NSLocalizedString("Tabs.Account", comment: "Main tab bar: Account page")
15+
static let chats = NSLocalizedString("Tabs.Chats", comment: "Main tab bar: Chats page")
16+
static let settings = NSLocalizedString("Tabs.Settings", comment: "Main tab bar: Settings page")
17+
}
18+
}
1219

1320
@UIApplicationMain
1421
class AppDelegate: UIResponder, UIApplicationDelegate {
15-
1622
var window: UIWindow?
1723
var repeater: RepeaterService!
24+
var container: Container!
1825

1926
weak var accountService: AccountService?
2027
weak var notificationService: NotificationsService?
@@ -23,14 +30,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
2330

2431
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
2532
// MARK: 1. Initiating Swinject
26-
let container = SwinjectStoryboard.defaultContainer
27-
Container.loggingFunction = nil // Logging currently not supported with SwinjectStoryboards.
33+
container = Container()
2834
container.registerAdamantServices()
29-
container.registerAdamantAccountStory()
30-
container.registerAdamantLoginStory()
31-
container.registerAdamantChatsStory()
32-
container.registerAdamantSettingsStory()
33-
3435
accountService = container.resolve(AccountService.self)
3536
notificationService = container.resolve(NotificationsService.self)
3637

@@ -48,20 +49,33 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
4849
}
4950

5051
if let tabbar = self.window!.rootViewController as? UITabBarController {
51-
let account = router.get(story: .Account).instantiateInitialViewController()!
52-
let chats = router.get(story: .Chats).instantiateInitialViewController()!
53-
let settings = router.get(story: .Settings).instantiateInitialViewController()!
54-
52+
let accountRoot = router.get(scene: AdamantScene.Account.account)
53+
let account = UINavigationController(rootViewController: accountRoot)
54+
account.tabBarItem.title = String.adamantLocalized.tabItems.account
55+
account.tabBarItem.image = #imageLiteral(resourceName: "wallet_tab")
56+
57+
let chatListRoot = router.get(scene: AdamantScene.Chats.chatList)
58+
let chatList = UINavigationController(rootViewController: chatListRoot)
59+
chatList.tabBarItem.title = String.adamantLocalized.tabItems.chats
60+
chatList.tabBarItem.image = #imageLiteral(resourceName: "chats_tab")
61+
62+
let settingsRoot = router.get(scene: AdamantScene.Settings.settings)
63+
let settings = UINavigationController(rootViewController: settingsRoot)
64+
settings.tabBarItem.title = String.adamantLocalized.tabItems.settings
65+
settings.tabBarItem.image = #imageLiteral(resourceName: "settings_tab")
66+
67+
5568
account.tabBarItem.badgeColor = UIColor.adamantPrimary
56-
chats.tabBarItem.badgeColor = UIColor.adamantPrimary
69+
chatList.tabBarItem.badgeColor = UIColor.adamantPrimary
5770
settings.tabBarItem.badgeColor = UIColor.adamantPrimary
5871

59-
tabbar.setViewControllers([account, chats, settings], animated: false)
72+
tabbar.setViewControllers([account, chatList, settings], animated: false)
6073
}
6174

6275

6376
// MARK: 3. Initiate login
64-
self.window!.rootViewController?.present(router.get(scene: .Login), animated: false, completion: nil)
77+
let login = router.get(scene: AdamantScene.Login.login)
78+
self.window!.rootViewController?.present(login, animated: false, completion: nil)
6579

6680

6781
// MARK: 4 Autoupdate
@@ -180,4 +194,6 @@ extension AppDelegate {
180194
return
181195
}
182196
}
197+
198+
completionHandler(.noData)
183199
}}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* The user-visible name of the bundle; used by Siri and visible on the Home screen in iOS. */
2+
"CFBundleDisplayName" = "Adamant";
3+
4+
/* The short name of the bundle, which may be displayed to users in situations such as the absence of a value for CFBundleDisplayName. This name should be less than 16 characters long. */
5+
"CFBundleName" = "Adamant";
6+
7+
/* Camera authorization reason */
8+
"NSCameraUsageDescription" = "The camera needed to scan QR codes for addresses and passphrases";
9+
10+
/* Readonly access to photolibrary reason */
11+
"NSPhotoLibraryAddUsageDescription" = "Saving generated QR codes with passphrases and addresses";
12+
13+
/* ReadWrite access to photolibrary reason */
14+
"NSPhotoLibraryUsageDescription" = "Reading QR codes with passphrases and addresses";
15+

0 commit comments

Comments
 (0)