Skip to content

Commit

Permalink
Added project folder and files
Browse files Browse the repository at this point in the history
  • Loading branch information
Afsar Haseeb committed May 13, 2018
0 parents commit eaeea0c
Show file tree
Hide file tree
Showing 26 changed files with 1,448 additions and 0 deletions.
446 changes: 446 additions & 0 deletions ArchitectureSample.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

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

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "ArchitectureSample/VC1.swift"
timestampString = "547926411.238511"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "61"
endingLineNumber = "61"
landmarkName = "reload(model:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?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>SchemeUserState</key>
<dict>
<key>ArchitectureSample.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>
55 changes: 55 additions & 0 deletions ArchitectureSample/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
//
// AppDelegate.swift
// test
//
// Created by Haseeb on 1/4/18.
// Copyright © 2018 Haseeb. All rights reserved.
//

import UIKit

let exceptionLayer:ExceptionManager = ExceptionManager(logSystem: "Backend system url goes in here. Where we need to log exceptions")

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?
let exceptionManager:ExceptionManager = exceptionLayer

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

UIManager.flowController?.navigate(url: "myapp://VC1")
exceptionManager.setObserver { (error) in
//Handle exceptions propogating from different modules
print(error?.localizedDescription)
}


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:.
}


}

Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"images" : [
{
"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" : "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"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
31 changes: 31 additions & 0 deletions ArchitectureSample/Base.lproj/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12118" systemVersion="17B1003" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12086"/>
<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">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides>
<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"/>
</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>
43 changes: 43 additions & 0 deletions ArchitectureSample/BaseVC.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//
// BaseVC.swift
// test
//
// Created by Haseeb on 1/4/18.
// Copyright © 2018 Haseeb. All rights reserved.
//

import UIKit

class BaseVC: UIViewController {

var viewId:String = "SomeId"

override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Divarse of any resources that can be recreated.

}

func onClick(){

}

func reload( model: View ){
print("Control coming here \(self.viewId)")
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/

}
23 changes: 23 additions & 0 deletions ArchitectureSample/BusinessManager.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// BusinessManager.swift
// test
//
// Created by Haseeb on 1/4/18.
// Copyright © 2018 Haseeb. All rights reserved.
//

import Foundation
import UIKit

class BusinessManager{
static let sharedInstance = BusinessManager()
let networkManager:NetworkManager? = NetworkManager()
var router:Router? = nil
var moduleManager:ModuleManager? = nil

init(){
self.router = Router(businessLayer: self)
self.moduleManager = ModuleManager(businessLayer: self)
}

}
74 changes: 74 additions & 0 deletions ArchitectureSample/ExceptionManager.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
//
// RBExceptionManager.swift
// test
//
// Created by Haseeb on 1/4/18.
// Copyright © 2018 Haseeb. All rights reserved.
//

import Foundation

class ExceptionManager{
private var logs: Array<Error>
private let loggingSystemURL:String?
private var callback: (Error?) -> ()

/**
Initializer takes the remote logging system url. The initializer will be evolved in the next versions based on configurations
- Author:
Haseeb Afsar
- parameters:
* logSystem: String takes the remote system URL
- returns:
Returns [ExceptionManager] object
*/
init( logSystem: String? ) {
self.loggingSystemURL = logSystem
self.logs = [Error]()
self.callback = {_ in }
}


/**
Interface to observe error.
- Author:
Haseeb Afsar
- parameters:
* observer: Closure(Error) It takes a closure and passes the Error object which is published from any other modules
- returns:
Returns nothing
*/
func setObserver(observer: @escaping (Error?) -> ()) {
self.callback = observer
}


/**
Interface to publish error.
- Author:
Haseeb Afsar
- parameters:
* error: Error
- returns:
Returns nothing
*/
func publish(error: Error){
self.logs.append( error )
self.callback( error )
}


}

Loading

0 comments on commit eaeea0c

Please sign in to comment.