AppwiseCore 0.4.0

AppwiseCore 0.4.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Oct 2017
SwiftSwift Version 4.0
SPMSupports SPM

Maintained by David Jennes.


Downloads

Total438
Week51
Month144

Installs

Apps16
Apps WeekApps This Week 6
Pod Tries1
Pod Tries WeekPod Tries This Week 1
powered by Segment

GitHub

Stars1
Watchers1
Forks0
Issues0
Contributors1
Pull Requests0

Code

Files15
LOCLines of Code 618


  • By
  • David Jennes





Screenshot

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Usage

Create an implementation of the Config protocol, and a subclass of the generic AppDelegate class (referencing your config type). If you use networking functionality, it's recommended to use the Router and Client types.

If you need database functionality, additionally add the "AppwiseCore/CoreData" dependency. It will automatically be initialised as long as you've implemented the AppDelegate & Config types.

Fabric integration

When using, you'll want to add Crashlytics logging to your project. To do so, add the following logger to your project:

import Crashlytics
import CrashlyticsRecorder

extension Crashlytics: CrashlyticsProtocol {
	public func log(_ format: String, args: CVaListPointer) {
		#if DEBUG
			CLSNSLogv(format, args)
		#else
			CLSLogv(format, args)
		#endif
	}
}

extension Answers: AnswersProtocol {
}

And then create the needed recorders in your app delegate:

@UIApplicationMain
final class AppDelegate: AppwiseCore.AppDelegate<Config> {
	override func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
		guard super.application(application, willFinishLaunchingWithOptions: launchOptions) else { return false }

		// initialize fabric
		Fabric.with([Crashlytics()])
		_ = CrashlyticsRecorder.createSharedInstance(crashlytics: Crashlytics.sharedInstance())
		_ = AnswersRecorder.createSharedInstance(answers: Answers.self)
		
		return true
	}
}

Author

David Jennes

License

AppwiseCore is available under the MIT license. See the LICENSE file for more info.