mirror of
https://github.com/wahyd4/Yep.git
synced 2026-08-18 17:25:59 +10:00
Merge branch 'feature/app_group' into develop
This commit is contained in:
@@ -461,6 +461,7 @@
|
||||
845E1A651B788EF3001E0789 /* EditSkillsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = EditSkillsViewController.swift; path = ViewControllers/EditSkills/EditSkillsViewController.swift; sourceTree = "<group>"; };
|
||||
848806AE1B789A2D000C5424 /* EditSkillCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = EditSkillCell.swift; path = Views/Cells/EditSkill/EditSkillCell.swift; sourceTree = "<group>"; };
|
||||
848806AF1B789A2D000C5424 /* EditSkillCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = EditSkillCell.xib; path = Views/Cells/EditSkill/EditSkillCell.xib; sourceTree = "<group>"; };
|
||||
848806B21B7B0230000C5424 /* Yep.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = Yep.entitlements; sourceTree = "<group>"; };
|
||||
84C959881B731FD20017D3ED /* ChatBaseCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ChatBaseCell.swift; path = Views/Cells/ChatBaseCell/ChatBaseCell.swift; sourceTree = "<group>"; };
|
||||
88C96122C478C4D134F634F6 /* Pods-Yep.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Yep.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Yep/Pods-Yep.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
C3146F0F60F2A38BC6E0FA66 /* Pods_Yep.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Yep.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
@@ -563,6 +564,7 @@
|
||||
0A8F54AD1AB67D11004AD60E /* Yep */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
848806B21B7B0230000C5424 /* Yep.entitlements */,
|
||||
0A8F54B01AB67D11004AD60E /* AppDelegate.swift */,
|
||||
0AD7EA581AC3EAF300617758 /* Yep-Bridging-Header.h */,
|
||||
50E114F51ABBF9D100F13000 /* Realm */,
|
||||
@@ -1644,6 +1646,9 @@
|
||||
CreatedOnToolsVersion = 6.3;
|
||||
DevelopmentTeam = TKRALRXCKN;
|
||||
SystemCapabilities = {
|
||||
com.apple.ApplicationGroups.iOS = {
|
||||
enabled = 1;
|
||||
};
|
||||
com.apple.BackgroundModes = {
|
||||
enabled = 1;
|
||||
};
|
||||
@@ -2094,7 +2099,9 @@
|
||||
baseConfigurationReference = 88C96122C478C4D134F634F6 /* Pods-Yep.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_ENTITLEMENTS = Yep/Yep.entitlements;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
@@ -2112,6 +2119,7 @@
|
||||
"$(PROJECT_DIR)/Yep/JPush",
|
||||
);
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE = "";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Yep/Yep-Bridging-Header.h";
|
||||
};
|
||||
name = Debug;
|
||||
@@ -2121,7 +2129,9 @@
|
||||
baseConfigurationReference = 4EEAF88E6C6D61E595249DF5 /* Pods-Yep.release.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_ENTITLEMENTS = Yep/Yep.entitlements;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
@@ -2139,6 +2149,7 @@
|
||||
"$(PROJECT_DIR)/Yep/JPush",
|
||||
);
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE = "";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Yep/Yep-Bridging-Header.h";
|
||||
};
|
||||
name = Release;
|
||||
|
||||
@@ -23,6 +23,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
|
||||
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
|
||||
|
||||
// 默认将 Realm 放在 App Group 里
|
||||
|
||||
let directory: NSURL = NSFileManager.defaultManager().containerURLForSecurityApplicationGroupIdentifier(YepConfig.appGroupID)!
|
||||
let realmPath = directory.path!.stringByAppendingPathComponent("db.realm")
|
||||
Realm.defaultPath = realmPath
|
||||
|
||||
// Realm 版本迁移
|
||||
|
||||
setSchemaVersion(15, Realm.defaultPath, { migration, oldSchemaVersion in
|
||||
// We haven’t migrated anything yet, so oldSchemaVersion == 0
|
||||
if oldSchemaVersion < 1 {
|
||||
|
||||
@@ -10,6 +10,8 @@ import UIKit
|
||||
import Ruler
|
||||
|
||||
class YepConfig {
|
||||
|
||||
static let appGroupID: String = "group.Catch-Inc.Yep"
|
||||
|
||||
static let minMessageTextLabelWidth: CGFloat = 20.0
|
||||
|
||||
|
||||
@@ -80,10 +80,11 @@ class Listenable<T> {
|
||||
|
||||
class YepUserDefaults {
|
||||
|
||||
static let defaults = NSUserDefaults(suiteName: YepConfig.appGroupID)!
|
||||
|
||||
// MARK: ReLogin
|
||||
|
||||
class func cleanAllUserDefaults() {
|
||||
let defaults = NSUserDefaults.standardUserDefaults()
|
||||
|
||||
defaults.removeObjectForKey(v1AccessTokenKey)
|
||||
defaults.removeObjectForKey(userIDKey)
|
||||
@@ -117,7 +118,6 @@ class YepUserDefaults {
|
||||
}
|
||||
|
||||
static var v1AccessToken: Listenable<String?> = {
|
||||
let defaults = NSUserDefaults.standardUserDefaults()
|
||||
let v1AccessToken = defaults.stringForKey(v1AccessTokenKey)
|
||||
|
||||
return Listenable<String?>(v1AccessToken) { v1AccessToken in
|
||||
@@ -134,7 +134,6 @@ class YepUserDefaults {
|
||||
}()
|
||||
|
||||
static var userID: Listenable<String?> = {
|
||||
let defaults = NSUserDefaults.standardUserDefaults()
|
||||
let userID = defaults.stringForKey(userIDKey)
|
||||
|
||||
return Listenable<String?>(userID) { userID in
|
||||
@@ -143,7 +142,6 @@ class YepUserDefaults {
|
||||
}()
|
||||
|
||||
static var nickname: Listenable<String?> = {
|
||||
let defaults = NSUserDefaults.standardUserDefaults()
|
||||
let nickname = defaults.stringForKey(nicknameKey)
|
||||
|
||||
return Listenable<String?>(nickname) { nickname in
|
||||
@@ -163,7 +161,6 @@ class YepUserDefaults {
|
||||
}()
|
||||
|
||||
static var introduction: Listenable<String?> = {
|
||||
let defaults = NSUserDefaults.standardUserDefaults()
|
||||
let introduction = defaults.stringForKey(introductionKey)
|
||||
|
||||
return Listenable<String?>(introduction) { introduction in
|
||||
@@ -183,7 +180,6 @@ class YepUserDefaults {
|
||||
}()
|
||||
|
||||
static var avatarURLString: Listenable<String?> = {
|
||||
let defaults = NSUserDefaults.standardUserDefaults()
|
||||
let avatarURLString = defaults.stringForKey(avatarURLStringKey)
|
||||
|
||||
return Listenable<String?>(avatarURLString) { avatarURLString in
|
||||
@@ -204,7 +200,6 @@ class YepUserDefaults {
|
||||
}()
|
||||
|
||||
static var badge: Listenable<String?> = {
|
||||
let defaults = NSUserDefaults.standardUserDefaults()
|
||||
let badge = defaults.stringForKey(badgeKey)
|
||||
|
||||
return Listenable<String?>(badge) { badge in
|
||||
@@ -224,7 +219,6 @@ class YepUserDefaults {
|
||||
}()
|
||||
|
||||
static var pusherID: Listenable<String?> = {
|
||||
let defaults = NSUserDefaults.standardUserDefaults()
|
||||
let pusherID = defaults.stringForKey(pusherIDKey)
|
||||
|
||||
return Listenable<String?>(pusherID) { pusherID in
|
||||
@@ -246,7 +240,6 @@ class YepUserDefaults {
|
||||
}()
|
||||
|
||||
static var areaCode: Listenable<String?> = {
|
||||
let defaults = NSUserDefaults.standardUserDefaults()
|
||||
let areaCode = defaults.stringForKey(areaCodeKey)
|
||||
|
||||
return Listenable<String?>(areaCode) { areaCode in
|
||||
@@ -255,7 +248,6 @@ class YepUserDefaults {
|
||||
}()
|
||||
|
||||
static var mobile: Listenable<String?> = {
|
||||
let defaults = NSUserDefaults.standardUserDefaults()
|
||||
let mobile = defaults.stringForKey(mobileKey)
|
||||
|
||||
return Listenable<String?>(mobile) { mobile in
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.application-groups</key>
|
||||
<array>
|
||||
<string>group.Catch-Inc.Yep</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
Reference in New Issue
Block a user