Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .codebeatignore

This file was deleted.

2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ StepicAdaptiveCourse/Content/**/Auth.plist filter=git-crypt diff=git-crypt
StepicAdaptiveCourse/Content/**/Tokens.plist filter=git-crypt diff=git-crypt
StepicAdaptiveCourse/Content/**/GoogleService-Info.plist filter=git-crypt diff=git-crypt

ExamEGERussian/SupportingFiles/Auth.plist filter=git-crypt diff=git-crypt

.gitattributes !filter !diff
2 changes: 0 additions & 2 deletions .github/pull_request_template.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
**Задача**: [#](https://vyahhi.myjetbrains.com/youtrack/issue/)

**Коротко для Release Notes, в формате «Сделали/Добавили/Исправили N»**:

**Описание**:
29 changes: 29 additions & 0 deletions ExamEGERussian/Base.lproj/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina4_0" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
6 changes: 6 additions & 0 deletions ExamEGERussian/Resources/Assets/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
//
// AppDelegate.swift
// ExamEGERussian
//
// Created by Ivan Magda on 03/07/2018.
// Copyright © 2018 Alex Karpov. All rights reserved.
//

import UIKit

// MARK: AppDelegate: UIResponder, UIApplicationDelegate

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

// MARK: - Instance Properties

var window: UIWindow?

private lazy var rootNavigationManager: RootNavigationManager = {
RootNavigationManager(serviceComponents: self.serviceComponents)
}()

private lazy var serviceComponents: ServiceComponents = {
ServiceComponentsAssembly(
authAPI: AuthAPI(),
stepicsAPI: StepicsAPI(),
profilesAPI: ProfilesAPI(),
defaultsStorageManager: DefaultsStorageManager(),
randomCredentialsGenerator: RandomCredentialsGeneratorImplementation()
)
}()

// MARK: - UIApplicationDelegate

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
window = UIWindow(frame: UIScreen.main.bounds)
guard let window = window else {
fatalError("Failed to instantiate window")
}

rootNavigationManager.setup(with: window)

return true
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// RootNavigationManager.swift
// ExamEGERussian
//
// Created by Ivan Magda on 04/07/2018.
// Copyright © 2018 Alex Karpov. All rights reserved.
//

import UIKit

// MARK: RootNavigationManager

final class RootNavigationManager {

// MARK: - Instance Variables

private unowned let serviceComponents: ServiceComponents

// MARK: Init

init(serviceComponents: ServiceComponents) {
self.serviceComponents = serviceComponents
}

// MARK: Public API

func setup(with window: UIWindow) {
let mainController = MainViewController()
mainController.userRegistrationService = serviceComponents.userRegistrationService
let navigationController = UINavigationController(rootViewController: mainController)

window.rootViewController = navigationController
window.makeKeyAndVisible()
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// ServiceComponents.swift
// ExamEGERussian
//
// Created by Ivan Magda on 04/07/2018.
// Copyright © 2018 Alex Karpov. All rights reserved.
//

import Foundation

protocol ServiceComponents: class {

var userRegistrationService: UserRegistrationService { get }

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//
// ServiceComponentsAssembly.swift
// ExamEGERussian
//
// Created by Ivan Magda on 04/07/2018.
// Copyright © 2018 Alex Karpov. All rights reserved.
//

import Foundation

final class ServiceComponentsAssembly: ServiceComponents {

let userRegistrationService: UserRegistrationService

init(authAPI: AuthAPI,
stepicsAPI: StepicsAPI,
profilesAPI: ProfilesAPI,
defaultsStorageManager: DefaultsStorageManager,
randomCredentialsGenerator: RandomCredentialsGenerator
) {
self.userRegistrationService = UserRegistrationServiceImplementation(
authAPI: authAPI,
stepicsAPI: stepicsAPI,
profilesAPI: profilesAPI,
defaultsStorageManager: defaultsStorageManager,
randomCredentialsGenerator: randomCredentialsGenerator
)
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//
// UserRegistrationService.swift
// ExamEGERussian
//
// Created by Ivan Magda on 03/07/2018.
// Copyright © 2018 Alex Karpov. All rights reserved.
//

import Foundation
import PromiseKit

// MARK: UserRegistrationServiceError: Error

enum UserRegistrationServiceError: Error {
case notRegistered
case notLoggedIn
case noProfileFound
case notUnregisteredFromEmails
}

// MARK: - UserRegistrationService -

protocol UserRegistrationService {

var defaultsStorageManager: DefaultsStorageManager { get }

var authAPI: AuthAPI { get }

var stepicsAPI: StepicsAPI { get }

var randomCredentialsGenerator: RandomCredentialsGenerator { get }

func registerNewUser() -> Promise<User>

func registerUser() -> Promise<(email: String, password: String)>

func logInUser(email: String, password: String) -> Promise<User>

func unregisterFromEmail(user: User) -> Promise<User>

}
Loading