Skip to content
Open
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
16 changes: 8 additions & 8 deletions Dependencies modularization.xcodeproj/project.pbxproj
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
objects = {

/* Begin PBXBuildFile section */
B1C0320022690FAB0020FB95 /* PaymentServiceProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1C031FF22690FAB0020FB95 /* PaymentServiceProtocol.swift */; };
B1C0320222690FF10020FB95 /* HomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1C0320122690FF10020FB95 /* HomeViewController.swift */; };
D17DE002225E008F00B19F86 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D17DE001225E008F00B19F86 /* AppDelegate.swift */; };
D17DE004225E008F00B19F86 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D17DE003225E008F00B19F86 /* ViewController.swift */; };
D17DE007225E008F00B19F86 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D17DE005225E008F00B19F86 /* Main.storyboard */; };
D17DE009225E009100B19F86 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D17DE008225E009100B19F86 /* Assets.xcassets */; };
D17DE00C225E009100B19F86 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D17DE00A225E009100B19F86 /* LaunchScreen.storyboard */; };
D17DE022225E00A500B19F86 /* PaymentService.swift in Sources */ = {isa = PBXBuildFile; fileRef = D17DE021225E00A500B19F86 /* PaymentService.swift */; };
D17DE03A225E05AC00B19F86 /* Payment.h in Headers */ = {isa = PBXBuildFile; fileRef = D17DE02A225E05AC00B19F86 /* Payment.h */; settings = {ATTRIBUTES = (Public, ); }; };
D17DE03D225E05AC00B19F86 /* Payment.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D17DE028225E05AC00B19F86 /* Payment.framework */; };
D17DE03E225E05AC00B19F86 /* Payment.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D17DE028225E05AC00B19F86 /* Payment.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
D17DE047225E05C100B19F86 /* PaymentProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = D17DE046225E05C100B19F86 /* PaymentProtocol.swift */; };
D17DE049225E062A00B19F86 /* PaymentViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D17DE048225E062A00B19F86 /* PaymentViewController.swift */; };
D17DE04B225E081A00B19F86 /* PaymentViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D17DE04A225E081A00B19F86 /* PaymentViewController.xib */; };
D17DE04D225E091D00B19F86 /* Bundle+Payment.swift in Sources */ = {isa = PBXBuildFile; fileRef = D17DE04C225E091D00B19F86 /* Bundle+Payment.swift */; };
Expand Down Expand Up @@ -47,9 +47,10 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
B1C031FF22690FAB0020FB95 /* PaymentServiceProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PaymentServiceProtocol.swift; sourceTree = "<group>"; };
B1C0320122690FF10020FB95 /* HomeViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HomeViewController.swift; sourceTree = "<group>"; };
D17DDFFE225E008F00B19F86 /* Dependencies modularization.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Dependencies modularization.app"; sourceTree = BUILT_PRODUCTS_DIR; };
D17DE001225E008F00B19F86 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
D17DE003225E008F00B19F86 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
D17DE006225E008F00B19F86 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
D17DE008225E009100B19F86 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
D17DE00B225E009100B19F86 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
Expand All @@ -58,7 +59,6 @@
D17DE028225E05AC00B19F86 /* Payment.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Payment.framework; sourceTree = BUILT_PRODUCTS_DIR; };
D17DE02A225E05AC00B19F86 /* Payment.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Payment.h; sourceTree = "<group>"; };
D17DE02B225E05AC00B19F86 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
D17DE046225E05C100B19F86 /* PaymentProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaymentProtocol.swift; sourceTree = "<group>"; };
D17DE048225E062A00B19F86 /* PaymentViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaymentViewController.swift; sourceTree = "<group>"; };
D17DE04A225E081A00B19F86 /* PaymentViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PaymentViewController.xib; sourceTree = "<group>"; };
D17DE04C225E091D00B19F86 /* Bundle+Payment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Bundle+Payment.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -104,8 +104,8 @@
D17DE000225E008F00B19F86 /* Dependencies modularization */ = {
isa = PBXGroup;
children = (
B1C0320122690FF10020FB95 /* HomeViewController.swift */,
D17DE001225E008F00B19F86 /* AppDelegate.swift */,
D17DE003225E008F00B19F86 /* ViewController.swift */,
D17DE021225E00A500B19F86 /* PaymentService.swift */,
D17DE005225E008F00B19F86 /* Main.storyboard */,
D17DE008225E009100B19F86 /* Assets.xcassets */,
Expand All @@ -118,8 +118,8 @@
D17DE029225E05AC00B19F86 /* Payment */ = {
isa = PBXGroup;
children = (
B1C031FF22690FAB0020FB95 /* PaymentServiceProtocol.swift */,
D17DE02A225E05AC00B19F86 /* Payment.h */,
D17DE046225E05C100B19F86 /* PaymentProtocol.swift */,
D17DE048225E062A00B19F86 /* PaymentViewController.swift */,
D17DE04A225E081A00B19F86 /* PaymentViewController.xib */,
D17DE04C225E091D00B19F86 /* Bundle+Payment.swift */,
Expand Down Expand Up @@ -243,17 +243,17 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D17DE004225E008F00B19F86 /* ViewController.swift in Sources */,
D17DE002225E008F00B19F86 /* AppDelegate.swift in Sources */,
D17DE022225E00A500B19F86 /* PaymentService.swift in Sources */,
B1C0320222690FF10020FB95 /* HomeViewController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
D17DE024225E05AC00B19F86 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D17DE047225E05C100B19F86 /* PaymentProtocol.swift in Sources */,
B1C0320022690FAB0020FB95 /* PaymentServiceProtocol.swift in Sources */,
D17DE049225E062A00B19F86 /* PaymentViewController.swift in Sources */,
D17DE04D225E091D00B19F86 /* Bundle+Payment.swift in Sources */,
);
Expand Down
Empty file.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
scope = "0"
stopOnStyle = "0">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Dependencies modularization/HomeViewController.swift"
timestampString = "577311126.591285"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "23"
endingLineNumber = "23"
landmarkName = "didTapPaymentNavigationButton(_:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?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>Dependencies modularization.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
<key>Payment.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
</dict>
</dict>
</plist>
Empty file modified Dependencies modularization/AppDelegate.swift
100644 → 100755
Empty file.
Empty file.
Empty file modified Dependencies modularization/Assets.xcassets/Contents.json
100644 → 100755
Empty file.
Empty file modified Dependencies modularization/Base.lproj/LaunchScreen.storyboard
100644 → 100755
Empty file.
10 changes: 5 additions & 5 deletions Dependencies modularization/Base.lproj/Main.storyboard
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<?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" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="6yp-9m-47L">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="6yp-9m-47L">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
<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-->
<!--Home View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="Dependencies_modularization" customModuleProvider="target" sceneMemberID="viewController">
<viewController id="BYZ-38-t0r" customClass="HomeViewController" customModule="Dependencies_modularization" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
Expand All @@ -31,7 +31,7 @@
<rect key="frame" x="43" y="20.5" width="139" height="30"/>
<state key="normal" title="Go to payment page"/>
<connections>
<action selector="didTapPaymentNavigationButton:" destination="BYZ-38-t0r" eventType="touchUpInside" id="OOT-hO-EK9"/>
<action selector="didTapPaymentNavigationButton:" destination="BYZ-38-t0r" eventType="touchUpInside" id="Jpx-NE-PVy"/>
</connections>
</button>
</subviews>
Expand Down
Empty file modified Dependencies modularization/HomeViewController.swift
100644 → 100755
Empty file.
Empty file modified Dependencies modularization/Info.plist
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions Dependencies modularization/PaymentService.swift
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ class PaymentService {

/*
By making this class conform to the protocol, and passing a reference to this class when instanciating the PaymentViewController (in ViewController.swift),
you make sure the method pay(with cardnumber: String) (visible in the class above) will be called when the method pay(with card number: String) (called from the module, on the PaymentService reference which is of type PaymentProtocol.Type, just check the PaymentViewController.swift file
you make sure the method pay(with cardnumber: String) (visible in the class above) will be called when the method pay(with card number: String) (called from the module, on the PaymentService reference which is of type PaymentServiceProtocol.Type, just check the PaymentViewController.swift file

To conclude, this allows you to call the method in the class above (which is defined in the app) FROM your module ! This is the bridge

Note : This extension does not require to re-write the method contained in the protocol since its name (pay(with cardNumber: String)) is the same as the name in PaymentService class, so by default the system will use the method declared in PaymentService class
*/
extension PaymentService: PaymentProtocol {
extension PaymentService: PaymentServiceProtocol {

}
Empty file modified Payment/Bundle+Payment.swift
100644 → 100755
Empty file.
Empty file modified Payment/Info.plist
100644 → 100755
Empty file.
Empty file modified Payment/Payment.h
100644 → 100755
Empty file.
Empty file modified Payment/PaymentServiceProtocol.swift
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions Payment/PaymentViewController.swift
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ public class PaymentViewController: UIViewController {

@IBOutlet var cardNumberTextField: UITextField!
@IBOutlet var messageLabel: UILabel!
private let paymentService: PaymentProtocol.Type
private let paymentService: PaymentServiceProtocol.Type

public init(paymentService: PaymentProtocol.Type) {
public init(paymentService: PaymentServiceProtocol.Type) {
self.paymentService = paymentService
super.init(nibName: nil, bundle: Bundle.payment)
}
Expand Down
Empty file modified Payment/PaymentViewController.xib
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.