Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Fixed example app #36

Merged
merged 1 commit into from
Jan 26, 2017
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
1 change: 1 addition & 0 deletions Example/Example/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//

import UIKit
import Swifjection

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
Expand Down
5 changes: 5 additions & 0 deletions Example/Example/Classes/Bar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
//

import Foundation
import Swifjection

class Bar: Injectable {
var foo: Foo
var fie: Fie?
var fie2: Fie?
var singleton: ExampleSingleton?
var object: MyObject?

Expand All @@ -18,6 +21,8 @@ class Bar: Injectable {
return nil
}
self.init(foo: foo)
fie = injector.getObject(withType: Fie.self)
fie2 = injector.getObject(withType: Fie.self)
singleton = injector.getObject(withType: ExampleSingleton.self)
object = injector.getObject(withType: MyObject.self)
}
Expand Down
1 change: 1 addition & 0 deletions Example/Example/Classes/ExampleSingleton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//

import Foundation
import Swifjection

class ExampleSingleton: Injectable {
required init?(injector: Injecting) {
Expand Down
14 changes: 14 additions & 0 deletions Example/Example/Classes/Fee.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// Copyright © 2017 Applause Inc. All rights reserved.
//

import Foundation
import Swifjection

protocol Fie {}

class Fee: Fie, Injectable {
convenience required init?(injector: Injecting) {
self.init()
}
}
1 change: 1 addition & 0 deletions Example/Example/Classes/Foo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//

import Foundation
import Swifjection

class Foo: Injectable {
convenience required init?(injector: Injecting) {
Expand Down
1 change: 1 addition & 0 deletions Example/Example/Classes/MyObject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//

import Foundation
import Swifjection

class MyObject: NSObject {

Expand Down
3 changes: 3 additions & 0 deletions Example/Example/MyBindings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
//

import Foundation
import Swifjection

class MyBindings: Bindings {

override init() {
super.init()
bind(object: Foo(), toType: Foo.self)
bindSingleton(forType: ExampleSingleton.self)
bindSingleton(forType: Fee.self)
bind(type: Fee.self, toType:Fie.self)
}
}
1 change: 1 addition & 0 deletions Example/Example/UI/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//

import UIKit
import Swifjection

class ViewController: UIViewController, Injectable {

Expand Down
2 changes: 1 addition & 1 deletion Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
Nimble: 415e3aa3267e7bc2c96b05fa814ddea7bb686a29
Quick: 5d290df1c69d5ee2f0729956dcf0fd9a30447eaa
Swifjection: 5c5bb8d906557700450b27845018683178805322
Swifjection: 0614fc542a7009b1f99684031d4bf3b9ee2008aa

PODFILE CHECKSUM: 60d64b0fbabf954b03972ce4ed30ea4722d7aa72

Expand Down
4 changes: 4 additions & 0 deletions Example/Swifjection.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
944F76691DC35E3E004A2C63 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 944F76671DC35E3E004A2C63 /* LaunchScreen.storyboard */; };
945F5E751DD0770D00A90DC3 /* ExampleSingleton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 945F5E741DD0770D00A90DC3 /* ExampleSingleton.swift */; };
945F5E771DD077B400A90DC3 /* MyObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 945F5E761DD077B400A90DC3 /* MyObject.swift */; };
D87A35991E3A05A900CF2606 /* Fee.swift in Sources */ = {isa = PBXBuildFile; fileRef = D87A35981E3A05A900CF2606 /* Fee.swift */; };
D8BD010E1DC23E1A00122227 /* ExampleClasses.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8BD010D1DC23E1A00122227 /* ExampleClasses.swift */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -87,6 +88,7 @@
D7F3F747FB45DD40710AB145 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
D838D33F1DC33591002B091C /* Swifjection.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; name = Swifjection.podspec; path = ../Swifjection.podspec; sourceTree = "<group>"; };
D85568AD1DC3308B0081E014 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
D87A35981E3A05A900CF2606 /* Fee.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Fee.swift; sourceTree = "<group>"; };
D8BD00F41DC2358E00122227 /* Swifjection.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Swifjection.framework; sourceTree = BUILT_PRODUCTS_DIR; };
D8BD010D1DC23E1A00122227 /* ExampleClasses.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExampleClasses.swift; sourceTree = "<group>"; };
EA602F772D38427EA5280725 /* Pods-Swiftjection_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Swiftjection_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Swiftjection_Tests/Pods-Swiftjection_Tests.debug.xcconfig"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -231,6 +233,7 @@
children = (
9405E3661DC365D3005327D4 /* Foo.swift */,
9405E3651DC365D3005327D4 /* Bar.swift */,
D87A35981E3A05A900CF2606 /* Fee.swift */,
945F5E741DD0770D00A90DC3 /* ExampleSingleton.swift */,
945F5E761DD077B400A90DC3 /* MyObject.swift */,
);
Expand Down Expand Up @@ -563,6 +566,7 @@
9405E36B1DC365D3005327D4 /* ViewController.swift in Sources */,
945F5E771DD077B400A90DC3 /* MyObject.swift in Sources */,
9405E3801DC36933005327D4 /* MyBindings.swift in Sources */,
D87A35991E3A05A900CF2606 /* Fee.swift in Sources */,
9405E36A1DC365D3005327D4 /* Foo.swift in Sources */,
9405E3691DC365D3005327D4 /* Bar.swift in Sources */,
944F765F1DC35E3E004A2C63 /* AppDelegate.swift in Sources */,
Expand Down