diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..a4704a2 --- /dev/null +++ b/Package.swift @@ -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] +) diff --git a/Sample/AppDelegate.swift b/Sample/AppDelegate.swift index ea2bbb2..4c67c28 100644 --- a/Sample/AppDelegate.swift +++ b/Sample/AppDelegate.swift @@ -14,7 +14,7 @@ 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() @@ -22,7 +22,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { } func subscribeToServices() { - LoginService.init() + let _ = LoginService.init() // todo - rest of the services } diff --git a/Sample/ViewController.swift b/Sample/ViewController.swift index 685528c..c43bf72 100644 --- a/Sample/ViewController.swift +++ b/Sample/ViewController.swift @@ -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)" diff --git a/SwiftEventBus.xcodeproj/project.pbxproj b/SwiftEventBus.xcodeproj/project.pbxproj index 370eb06..9519281 100644 --- a/SwiftEventBus.xcodeproj/project.pbxproj +++ b/SwiftEventBus.xcodeproj/project.pbxproj @@ -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, ); @@ -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 = ""; @@ -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"; @@ -386,7 +387,6 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -407,7 +407,6 @@ PRODUCT_BUNDLE_IDENTIFIER = cesarferreira.SwiftEventBus; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 5.0; }; name = Release; }; @@ -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; }; @@ -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; };