create AppGroupsManager

This commit is contained in:
John Estropia
2021-05-06 08:28:44 +09:00
parent d19fd1b45c
commit 223707159c
17 changed files with 545 additions and 37 deletions

View File

@@ -29,11 +29,31 @@ import Foundation
@usableFromInline
internal enum Internals {
// MARK: Namespacing
@inline(__always)
internal static func libReverseDomain() -> String {
return "com.johnestropia.corestore"
}
@inline(__always)
internal static func libReverseDomain(_ suffix: String) -> String {
return "com.johnestropia.corestore.\(suffix)"
}
@inline(__always)
internal static func bundleTag() -> String {
return Bundle.main.bundleIdentifier ?? "com.CoreStore.DataStack"
}
// MARK: Associated Objects
@inline(__always)
/// type(of:) doesn't return the dynamic type anymore, use this to guarantee correct dispatch of class methods
@inline(__always)
internal static func dynamicObjectType<T: AnyObject>(of instance: T) -> T.Type {
return object_getClass(instance) as! T.Type