-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Afsar Haseeb
committed
May 13, 2018
0 parents
commit eaeea0c
Showing
26 changed files
with
1,448 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
ArchitectureSample.xcodeproj/project.xcworkspace/contents.xcworkspacedata
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file added
BIN
+93.7 KB
...codeproj/project.xcworkspace/xcuserdata/haseeb.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
23 changes: 23 additions & 0 deletions
23
...ectureSample.xcodeproj/xcuserdata/haseeb.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
14 changes: 14 additions & 0 deletions
14
...itectureSample.xcodeproj/xcuserdata/haseeb.xcuserdatad/xcschemes/xcschememanagement.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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:. | ||
} | ||
|
||
|
||
} | ||
|
68 changes: 68 additions & 0 deletions
68
ArchitectureSample/Assets.xcassets/AppIcon.appiconset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
} | ||
*/ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ) | ||
} | ||
|
||
|
||
} | ||
|
Oops, something went wrong.