Skip to content

Commit

Permalink
Merge pull request #5 from SerhanAksut/improvement/example-project
Browse files Browse the repository at this point in the history
Resolve-SampleProject-Issues
  • Loading branch information
SerhanAksut authored May 26, 2024
2 parents 720fd2c + 6d0cac3 commit 9f6c85c
Show file tree
Hide file tree
Showing 15 changed files with 87 additions and 253 deletions.
41 changes: 25 additions & 16 deletions ExampleProject/ExampleProject.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
BE1ED37C2ACB1FEA000B9DDA /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BE1ED37B2ACB1FEA000B9DDA /* Assets.xcassets */; };
BE1ED3802ACB1FEA000B9DDA /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BE1ED37F2ACB1FEA000B9DDA /* Preview Assets.xcassets */; };
BE1ED3882ACB2011000B9DDA /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE1ED3862ACB2011000B9DDA /* AppDelegate.swift */; };
BE1ED3892ACB2011000B9DDA /* FeatureBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE1ED3872ACB2011000B9DDA /* FeatureBuilder.swift */; };
BE1ED38E2ACB203D000B9DDA /* FirstFeature in Frameworks */ = {isa = PBXBuildFile; productRef = BE1ED38D2ACB203D000B9DDA /* FirstFeature */; };
BE1ED3902ACB203D000B9DDA /* SecondFeature in Frameworks */ = {isa = PBXBuildFile; productRef = BE1ED38F2ACB203D000B9DDA /* SecondFeature */; };
BE1ED3892ACB2011000B9DDA /* FeatureStore+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE1ED3872ACB2011000B9DDA /* FeatureStore+Extensions.swift */; };
BE677C852C03569B004706BD /* FirstFeature in Frameworks */ = {isa = PBXBuildFile; productRef = BE677C842C03569B004706BD /* FirstFeature */; };
BE677C872C03569B004706BD /* SecondFeature in Frameworks */ = {isa = PBXBuildFile; productRef = BE677C862C03569B004706BD /* SecondFeature */; };
BE677C892C03569B004706BD /* FeatureInterface in Frameworks */ = {isa = PBXBuildFile; productRef = BE677C882C03569B004706BD /* FeatureInterface */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -21,18 +22,19 @@
BE1ED37D2ACB1FEA000B9DDA /* ExampleProject.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = ExampleProject.entitlements; sourceTree = "<group>"; };
BE1ED37F2ACB1FEA000B9DDA /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
BE1ED3862ACB2011000B9DDA /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
BE1ED3872ACB2011000B9DDA /* FeatureBuilder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FeatureBuilder.swift; sourceTree = "<group>"; };
BE1ED38A2ACB2027000B9DDA /* Features */ = {isa = PBXFileReference; lastKnownFileType = text; path = Features; sourceTree = SOURCE_ROOT; };
BE1ED38B2ACB2027000B9DDA /* Packages */ = {isa = PBXFileReference; lastKnownFileType = text; path = Packages; sourceTree = SOURCE_ROOT; };
BE1ED3872ACB2011000B9DDA /* FeatureStore+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "FeatureStore+Extensions.swift"; sourceTree = "<group>"; };
BE677C802C0351F0004706BD /* Packages */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = Packages; sourceTree = "<group>"; };
BE677C812C035452004706BD /* Features */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = Features; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
BE1ED3712ACB1FE9000B9DDA /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
BE1ED38E2ACB203D000B9DDA /* FirstFeature in Frameworks */,
BE1ED3902ACB203D000B9DDA /* SecondFeature in Frameworks */,
BE677C892C03569B004706BD /* FeatureInterface in Frameworks */,
BE677C852C03569B004706BD /* FirstFeature in Frameworks */,
BE677C872C03569B004706BD /* SecondFeature in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -42,6 +44,8 @@
BE1ED36B2ACB1FE9000B9DDA = {
isa = PBXGroup;
children = (
BE677C812C035452004706BD /* Features */,
BE677C802C0351F0004706BD /* Packages */,
BE1ED3762ACB1FE9000B9DDA /* ExampleProject */,
BE1ED3752ACB1FE9000B9DDA /* Products */,
BE1ED38C2ACB203D000B9DDA /* Frameworks */,
Expand All @@ -59,10 +63,8 @@
BE1ED3762ACB1FE9000B9DDA /* ExampleProject */ = {
isa = PBXGroup;
children = (
BE1ED38A2ACB2027000B9DDA /* Features */,
BE1ED38B2ACB2027000B9DDA /* Packages */,
BE1ED3862ACB2011000B9DDA /* AppDelegate.swift */,
BE1ED3872ACB2011000B9DDA /* FeatureBuilder.swift */,
BE1ED3872ACB2011000B9DDA /* FeatureStore+Extensions.swift */,
BE1ED37B2ACB1FEA000B9DDA /* Assets.xcassets */,
BE1ED37D2ACB1FEA000B9DDA /* ExampleProject.entitlements */,
BE1ED37E2ACB1FEA000B9DDA /* Preview Content */,
Expand Down Expand Up @@ -102,8 +104,9 @@
);
name = ExampleProject;
packageProductDependencies = (
BE1ED38D2ACB203D000B9DDA /* FirstFeature */,
BE1ED38F2ACB203D000B9DDA /* SecondFeature */,
BE677C842C03569B004706BD /* FirstFeature */,
BE677C862C03569B004706BD /* SecondFeature */,
BE677C882C03569B004706BD /* FeatureInterface */,
);
productName = ExampleProject;
productReference = BE1ED3742ACB1FE9000B9DDA /* ExampleProject.app */;
Expand Down Expand Up @@ -134,6 +137,8 @@
Base,
);
mainGroup = BE1ED36B2ACB1FE9000B9DDA;
packageReferences = (
);
productRefGroup = BE1ED3752ACB1FE9000B9DDA /* Products */;
projectDirPath = "";
projectRoot = "";
Expand All @@ -160,7 +165,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
BE1ED3892ACB2011000B9DDA /* FeatureBuilder.swift in Sources */,
BE1ED3892ACB2011000B9DDA /* FeatureStore+Extensions.swift in Sources */,
BE1ED3882ACB2011000B9DDA /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -383,14 +388,18 @@
/* End XCConfigurationList section */

/* Begin XCSwiftPackageProductDependency section */
BE1ED38D2ACB203D000B9DDA /* FirstFeature */ = {
BE677C842C03569B004706BD /* FirstFeature */ = {
isa = XCSwiftPackageProductDependency;
productName = FirstFeature;
};
BE1ED38F2ACB203D000B9DDA /* SecondFeature */ = {
BE677C862C03569B004706BD /* SecondFeature */ = {
isa = XCSwiftPackageProductDependency;
productName = SecondFeature;
};
BE677C882C03569B004706BD /* FeatureInterface */ = {
isa = XCSwiftPackageProductDependency;
productName = FeatureInterface;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = BE1ED36C2ACB1FE9000B9DDA /* Project object */;
Expand Down
2 changes: 1 addition & 1 deletion ExampleProject/ExampleProject/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ final class AppDelegate: UIResponder, UIApplicationDelegate {
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil
) -> Bool {
FeatureBuilder.shared.registerFeatures()
FeatureStore.shared.registerFeatures()
buildWindowRoot()
return true
}
Expand Down
23 changes: 0 additions & 23 deletions ExampleProject/ExampleProject/FeatureBuilder.swift

This file was deleted.

16 changes: 16 additions & 0 deletions ExampleProject/ExampleProject/FeatureStore+Extensions.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

import FeatureInterface
import FeatureStore
import FirstFeature
import SecondFeature

extension FeatureStore {
func registerFeatures() {
FeatureStore.shared.register(FirstFeatureBuilderProtocol.self) {
FirstFeatureBuilder()
}
FeatureStore.shared.register(SecondFeatureBuilderProtocol.self) {
SecondFeatureBuilder()
}
}
}

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions ExampleProject/Features/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ let package = Package(
],
targets: [
.target(name: "FirstFeature", dependencies: [
.product(name: "Dependencies", package: "Packages")
.product(name: "FeatureInterface", package: "Packages")
]),
.target(name: "SecondFeature", dependencies: [
.product(name: "Dependencies", package: "Packages")
.product(name: "FeatureInterface", package: "Packages")
])
]
)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import Dependencies
import FeatureInterface
import UIKit

public struct FirstFeatureBuilder: FirstFeatureBuilderProtocol {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

import FeatureStore
import Dependencies
import FeatureInterface
import UIKit

final class FirstFeatureViewController: UIViewController {
Expand Down Expand Up @@ -44,8 +44,8 @@ final class FirstFeatureViewController: UIViewController {
}
}

extension FirstFeatureViewController: CloseButtonDelegate {
func didTapCloseButton(controller: UIViewController) {
extension FirstFeatureViewController: SecondFeatureCloseButtonDelegate {
func didTapCloseButton(on controller: UIViewController) {
controller.dismiss(animated: true)
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

import Dependencies
import FeatureInterface
import UIKit

public struct SecondFeatureBuilder: SecondFeatureBuilderProtocol {

public init() {}

public func build(delegate: CloseButtonDelegate) -> UIViewController {
public func build(delegate: SecondFeatureCloseButtonDelegate) -> UIViewController {
let controller = SecondFeatureViewController(delegate: delegate)
return controller
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@

import Dependencies
import FeatureInterface
import FeatureStore
import UIKit

final class SecondFeatureViewController: UIViewController {

private weak var delegate: CloseButtonDelegate?
private weak var delegate: SecondFeatureCloseButtonDelegate?

init(delegate: CloseButtonDelegate) {
init(delegate: SecondFeatureCloseButtonDelegate) {
self.delegate = delegate

super.init(nibName: nil, bundle: nil)
Expand Down Expand Up @@ -43,6 +43,6 @@ final class SecondFeatureViewController: UIViewController {
}

@objc func didTapCloseButton() {
delegate?.didTapCloseButton(controller: self)
delegate?.didTapCloseButton(on: self)
}
}
Loading

0 comments on commit 9f6c85c

Please sign in to comment.