Skip to content

Commit

Permalink
Swift Package (#47)
Browse files Browse the repository at this point in the history
Swift Package
  • Loading branch information
cesarferreira authored Oct 5, 2019
2 parents 7cc44cd + b0cce49 commit e34a15d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
16 changes: 16 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// swift-tools-version:5.0

import PackageDescription

let package = Package(name: "SwiftEventBus",
platforms: [.macOS(.v10_10),
.iOS(.v8)],

products: [.library(name: "SwiftEventBus",
targets: ["SwiftEventBus"])],

targets: [.target(name: "SwiftEventBus",
path: "SwiftEventBus")],

swiftLanguageVersions: [.v5]
)
4 changes: 2 additions & 2 deletions Sample/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
// Override point for customization after application launch.
self.subscribeToServices()

return true
}

func subscribeToServices() {
LoginService.init()
let _ = LoginService.init()
// todo - rest of the services
}

Expand Down
2 changes: 1 addition & 1 deletion Sample/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ViewController: UIViewController {

SwiftEventBus.onMainThread(self, name: "login") { result in

let p : Person = result.object as! Person
let p : Person = result?.object as! Person

self.welcomeLabel.text = "Welcome \(p.name)"

Expand Down
9 changes: 3 additions & 6 deletions SwiftEventBus.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,9 @@
};
buildConfigurationList = DBCE8D441D8DD5160012B477 /* Build configuration list for PBXProject "SwiftEventBus" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -306,6 +305,7 @@
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down Expand Up @@ -361,6 +361,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand All @@ -386,7 +387,6 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -407,7 +407,6 @@
PRODUCT_BUNDLE_IDENTIFIER = cesarferreira.SwiftEventBus;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -420,7 +419,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = cesarferreira.Sample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
Expand All @@ -433,7 +431,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = cesarferreira.Sample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Release;
};
Expand Down

0 comments on commit e34a15d

Please sign in to comment.