Skip to content

Commit

Permalink
Merge branch 'release/0.3.2'
Browse files Browse the repository at this point in the history
# Conflicts:
#	Adamant/Assets/ru.lproj/Localizable.strings
  • Loading branch information
RealBonus committed Mar 17, 2018
2 parents 2aec06e + 693c17e commit 6042f40
Show file tree
Hide file tree
Showing 68 changed files with 1,862 additions and 1,447 deletions.
200 changes: 85 additions & 115 deletions Adamant.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

48 changes: 32 additions & 16 deletions Adamant/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,20 @@

import UIKit
import Swinject
import SwinjectStoryboard

extension String.adamantLocalized {
struct tabItems {
static let account = NSLocalizedString("Tabs.Account", comment: "Main tab bar: Account page")
static let chats = NSLocalizedString("Tabs.Chats", comment: "Main tab bar: Chats page")
static let settings = NSLocalizedString("Tabs.Settings", comment: "Main tab bar: Settings page")
}
}

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?
var repeater: RepeaterService!
var container: Container!

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

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// MARK: 1. Initiating Swinject
let container = SwinjectStoryboard.defaultContainer
Container.loggingFunction = nil // Logging currently not supported with SwinjectStoryboards.
container = Container()
container.registerAdamantServices()
container.registerAdamantAccountStory()
container.registerAdamantLoginStory()
container.registerAdamantChatsStory()
container.registerAdamantSettingsStory()

accountService = container.resolve(AccountService.self)
notificationService = container.resolve(NotificationsService.self)

Expand All @@ -48,20 +49,33 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
}

if let tabbar = self.window!.rootViewController as? UITabBarController {
let account = router.get(story: .Account).instantiateInitialViewController()!
let chats = router.get(story: .Chats).instantiateInitialViewController()!
let settings = router.get(story: .Settings).instantiateInitialViewController()!

let accountRoot = router.get(scene: AdamantScene.Account.account)
let account = UINavigationController(rootViewController: accountRoot)
account.tabBarItem.title = String.adamantLocalized.tabItems.account
account.tabBarItem.image = #imageLiteral(resourceName: "wallet_tab")

let chatListRoot = router.get(scene: AdamantScene.Chats.chatList)
let chatList = UINavigationController(rootViewController: chatListRoot)
chatList.tabBarItem.title = String.adamantLocalized.tabItems.chats
chatList.tabBarItem.image = #imageLiteral(resourceName: "chats_tab")

let settingsRoot = router.get(scene: AdamantScene.Settings.settings)
let settings = UINavigationController(rootViewController: settingsRoot)
settings.tabBarItem.title = String.adamantLocalized.tabItems.settings
settings.tabBarItem.image = #imageLiteral(resourceName: "settings_tab")


account.tabBarItem.badgeColor = UIColor.adamantPrimary
chats.tabBarItem.badgeColor = UIColor.adamantPrimary
chatList.tabBarItem.badgeColor = UIColor.adamantPrimary
settings.tabBarItem.badgeColor = UIColor.adamantPrimary

tabbar.setViewControllers([account, chats, settings], animated: false)
tabbar.setViewControllers([account, chatList, settings], animated: false)
}


// MARK: 3. Initiate login
self.window!.rootViewController?.present(router.get(scene: .Login), animated: false, completion: nil)
let login = router.get(scene: AdamantScene.Login.login)
self.window!.rootViewController?.present(login, animated: false, completion: nil)


// MARK: 4 Autoupdate
Expand Down Expand Up @@ -180,4 +194,6 @@ extension AppDelegate {
return
}
}

completionHandler(.noData)
}}
15 changes: 15 additions & 0 deletions Adamant/Assets/l18n/en.lproj/InfoPlist.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* The user-visible name of the bundle; used by Siri and visible on the Home screen in iOS. */
"CFBundleDisplayName" = "Adamant";

/* 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. */
"CFBundleName" = "Adamant";

/* Camera authorization reason */
"NSCameraUsageDescription" = "The camera needed to scan QR codes for addresses and passphrases";

/* Readonly access to photolibrary reason */
"NSPhotoLibraryAddUsageDescription" = "Saving generated QR codes with passphrases and addresses";

/* ReadWrite access to photolibrary reason */
"NSPhotoLibraryUsageDescription" = "Reading QR codes with passphrases and addresses";

Loading

0 comments on commit 6042f40

Please sign in to comment.