Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mvvm #14

Open
wants to merge 61 commits into
base: svastven
Choose a base branch
from
Open

Mvvm #14

Show file tree
Hide file tree
Changes from 54 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
15a19f1
pod init
vendulasvastal Feb 7, 2019
a2c314d
add pods to podfile
vendulasvastal Mar 14, 2019
5161cc2
add fonts
vendulasvastal Mar 14, 2019
534799a
add images
vendulasvastal Mar 14, 2019
82d6f79
delete main.storyboard
vendulasvastal Mar 14, 2019
23ce559
delete original view controller
vendulasvastal Mar 14, 2019
80feaff
setup info.plist for no storyboards
vendulasvastal Mar 14, 2019
7f15b86
pod install
vendulasvastal Mar 14, 2019
f271526
create base app flow controller
vendulasvastal Mar 14, 2019
cccb6b4
setup global appearance
vendulasvastal Mar 14, 2019
87bc569
setup for launching without storyboard
vendulasvastal Mar 14, 2019
3974c20
add view controller files to the project
vendulasvastal Mar 14, 2019
4770e47
create support text field component
vendulasvastal Mar 14, 2019
90385b4
create localizable.strings files
vendulasvastal Mar 14, 2019
27ce4a4
configure localizations
vendulasvastal Mar 14, 2019
8c44b16
add simple extension for string localization
vendulasvastal Mar 14, 2019
90cea65
add simple extension for string localization
vendulasvastal Mar 14, 2019
1eacf88
setup ui for login view controller
vendulasvastal Mar 14, 2019
995150c
setup ui for balance view controller
vendulasvastal Mar 14, 2019
89c4860
add fonts
vendulasvastal Mar 14, 2019
403e41d
create if else in flow controller to test UI
vendulasvastal Mar 14, 2019
abaa0aa
create result wrapper
vendulasvastal Mar 14, 2019
f7dcd0a
create WebScrapingService
vendulasvastal Mar 14, 2019
235da7e
edit condition for stale request
vendulasvastal Mar 14, 2019
5e57e1c
make constant of navigation controller and pass it where needed
vendulasvastal Mar 18, 2019
b3dd1cd
check if appcontroller is not nil instead of force unwrapping
vendulasvastal Mar 18, 2019
f6f52a2
refactor
vendulasvastal Mar 18, 2019
15e0802
change navController to let
vendulasvastal Mar 18, 2019
b624a1e
group view configurations in setupUI
vendulasvastal Mar 18, 2019
9e86b01
delete default init
vendulasvastal Mar 18, 2019
58b79f1
remove extraneous UITextFieldDelegate
vendulasvastal Mar 18, 2019
8676f37
create deactivate function
vendulasvastal Mar 18, 2019
5d397bc
UIView extension to set alpha
vendulasvastal Mar 18, 2019
02edd52
crete UIFont extension
vendulasvastal Mar 18, 2019
e7bfd66
add localizable strings
vendulasvastal Mar 22, 2019
17e23bc
move form field
vendulasvastal Mar 22, 2019
de4478b
add ui image extension
vendulasvastal Mar 22, 2019
0febaa3
create binding operators for view controller to view model binding
vendulasvastal Mar 22, 2019
0487d09
create reusable base classes
vendulasvastal Mar 22, 2019
4708e4a
add files
vendulasvastal Mar 22, 2019
7423b8f
add flow controller logic
vendulasvastal Mar 22, 2019
d5006ea
divide views and view controllers
vendulasvastal Mar 22, 2019
7bb6abc
setup Balance View Model
vendulasvastal Mar 22, 2019
08cdd93
setup Login View Model
vendulasvastal Mar 22, 2019
0e6a7b5
views in separate files
vendulasvastal Mar 22, 2019
48c31e3
rename request methd
vendulasvastal Mar 22, 2019
bd67e78
edit access control
vendulasvastal Mar 22, 2019
f73aaf1
edit podfile
vendulasvastal Mar 22, 2019
da313e8
edit podfile
vendulasvastal Mar 22, 2019
6885fd1
setup launch screen
vendulasvastal Mar 22, 2019
a70dea6
edit flow
vendulasvastal Mar 22, 2019
ab92d0f
edit localization
vendulasvastal Mar 22, 2019
e560a6b
move HUD from VM to VC
vendulasvastal Mar 25, 2019
b4c3c7c
fix animation
vendulasvastal Mar 25, 2019
4f82dba
Make app vc generic with custom view an view model
vendulasvastal Jul 10, 2019
cd983d4
Custom view computed property
vendulasvastal Jul 10, 2019
604d55a
Initialize controllers with view models
vendulasvastal Jul 10, 2019
f02dfa1
Refactor view controllers for the new structure
vendulasvastal Jul 10, 2019
64e848b
Refactor
vendulasvastal Jul 10, 2019
df50dae
Replace uiview with appview
vendulasvastal Jul 10, 2019
3ea8a68
Remove space
vendulasvastal Jul 10, 2019
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
291 changes: 277 additions & 14 deletions ISICkonto.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions ISICkonto.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions ISICkonto.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
</plist>
53 changes: 43 additions & 10 deletions ISICkonto/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,73 @@
//

import UIKit
import SVProgressHUD

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?


var appFlowController: AppFlowController?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.

setUpGlobalAppearance()

window = UIWindow(frame: UIScreen.main.bounds)

let navigationController = UINavigationController()
window?.rootViewController = navigationController
appFlowController = AppFlowController(with: navigationController)
appFlowController?.launch()
window?.makeKeyAndVisible()

return true
}

func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}

func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}

func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}



func setUpGlobalAppearance() {

// for UINavigationBar
UINavigationBar.appearance().setBackgroundImage(UIImage(), for: UIBarMetrics.default)
UINavigationBar.appearance().shadowImage = UIImage()
UINavigationBar.appearance().isTranslucent = true
UINavigationBar.appearance().backgroundColor = .clear
UINavigationBar.appearance().tintColor = .white
UINavigationBar.appearance().titleTextAttributes = [.foregroundColor: UIColor.white, .font: UIFont.cabinRegular(size: 20)]
UIBarButtonItem.appearance().setTitleTextAttributes([.foregroundColor: UIColor.white, .font: UIFont.cabinMedium(size: 17)], for: [.normal, .highlighted])

// for SVProgressHUD
SVProgressHUD.setFont(.cabinRegular(size: 15))
SVProgressHUD.setBackgroundColor(.white)
SVProgressHUD.setForegroundColor(UIColor(red: 55/255, green: 131/255, blue: 160/255, alpha: 1))
SVProgressHUD.setDefaultMaskType(SVProgressHUDMaskType.gradient)
SVProgressHUD.setMinimumSize(CGSize(width: 150, height: 150))
SVProgressHUD.setRingRadius(40)
SVProgressHUD.setRingThickness(5)
SVProgressHUD.setImageViewSize(CGSize(width: 80, height: 80))
}

}

21 changes: 21 additions & 0 deletions ISICkonto/Assets.xcassets/accountIcon.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ISICkonto/Assets.xcassets/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions ISICkonto/Assets.xcassets/logo.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "logo.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file added ISICkonto/Assets.xcassets/logo.imageset/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions ISICkonto/Assets.xcassets/reloadIcon.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 25 additions & 4 deletions ISICkonto/Base.lproj/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand All @@ -13,7 +17,21 @@
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="logo" translatesAutoresizingMaskIntoConstraints="NO" id="mMH-Hi-zxw">
<rect key="frame" x="50" y="196" width="275" height="275"/>
<constraints>
<constraint firstAttribute="width" secondItem="mMH-Hi-zxw" secondAttribute="height" multiplier="1:1" id="EwH-40-0Kr"/>
</constraints>
</imageView>
</subviews>
<color key="backgroundColor" red="0.36470588235294116" green="0.58431372549019611" blue="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="mMH-Hi-zxw" secondAttribute="trailing" constant="50" id="3Wh-rr-PAl"/>
<constraint firstItem="mMH-Hi-zxw" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="Meq-j0-bDF"/>
<constraint firstItem="mMH-Hi-zxw" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="Qr8-9Y-azt"/>
<constraint firstItem="mMH-Hi-zxw" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" constant="50" id="lHL-VX-48C"/>
</constraints>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
</viewController>
Expand All @@ -22,4 +40,7 @@
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
<resources>
<image name="logo" width="807" height="807"/>
</resources>
</document>
24 changes: 0 additions & 24 deletions ISICkonto/Base.lproj/Main.storyboard

This file was deleted.

48 changes: 48 additions & 0 deletions ISICkonto/Base/AppView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
//
// AppView.swift
// ISICkonto
//
// Created by Vendula Švastalová on 21/03/2019.
// Copyright © 2019 Vendula Švastalová. All rights reserved.
//

import UIKit
import SVProgressHUD

class AppView: UIView {

override init(frame: CGRect) {
super.init(frame: frame)
setupUI()
createConstraints()
}

required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
setupUI()
createConstraints()
}

func setupUI() {

}

func createConstraints() {

}

func showSuccess(with message: String) {
SVProgressHUD.showSuccess(withStatus: message)
SVProgressHUD.dismiss(withDelay: 1.0)
}

func showError(with message: String) {
SVProgressHUD.showError(withStatus: message)
SVProgressHUD.dismiss(withDelay: 1.0)
}

func showLoading(with message: String) {
SVProgressHUD.show(withStatus: message)
}

}
42 changes: 42 additions & 0 deletions ISICkonto/Base/AppViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//
// AppViewController.swift
// ISICkonto
//
// Created by Vendula Švastalová on 21/03/2019.
// Copyright © 2019 Vendula Švastalová. All rights reserved.
//

import Foundation
import UIKit
import RxSwift

class AppViewController: UIViewController {

var viewModel: AppViewModel!

var disposeBag = DisposeBag()

override func viewDidLoad() {
super.viewDidLoad()
setViewModel()
bindViewToViewModel(v: view, vm: viewModel)
}

override func loadView() {
setView()
}


func setView() {

}

func setViewModel() {

}

func bindViewToViewModel(v: UIView, vm: AppViewModel) {

}

}
13 changes: 13 additions & 0 deletions ISICkonto/Base/AppViewModel.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// AppViewModel.swift
// ISICkonto
//
// Created by Vendula Švastalová on 22/03/2019.
// Copyright © 2019 Vendula Švastalová. All rights reserved.
//

import Foundation

class AppViewModel {

}
Loading