list">

0元购Android端

proguard-rules.pro 8.7KB

    # Add project specific ProGuard rules here. # You can control the set of applied configuration files using the # proguardFiles setting in build.gradle. # # For more details, see # http://developer.android.com/guide/developing/tools/proguard.html # If your project uses WebView with JS, uncomment the following # and specify the fully qualified class name to the JavaScript interface # class: #-keepclassmembers class fqcn.of.javascript.interface.for.webview { # public *; #} # Uncomment this to preserve the line number information for # debugging stack traces. #-keepattributes SourceFile,LineNumberTable # If you keep the line number information, uncomment this to # hide the original source file name. #-renamesourcefileattribute SourceFile # 指定代码的压缩级别 0 - 7(指定代码进行迭代优化的次数,在Android里面默认是5,这条指令也只有在可以优化时起作用。) -optimizationpasses 5 # 混淆时不会产生形形色色的类名(混淆时不使用大小写混合类名) -dontusemixedcaseclassnames # 指定不去忽略非公共的库类(不跳过library中的非public的类) -dontskipnonpubliclibraryclasses # 指定不去忽略包可见的库类的成员 -dontskipnonpubliclibraryclassmembers #不进行优化,建议使用此选项, -dontoptimize # 不进行预校验,Android不需要,可加快混淆速度。 -dontpreverify # 屏蔽警告 -ignorewarnings # 指定混淆是采用的算法,后面的参数是一个过滤器 # 这个过滤器是谷歌推荐的算法,一般不做更改 -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* # 保护代码中的Annotation不被混淆 -keepattributes *Annotation* # 避免混淆泛型, 这在JSON实体映射时非常重要 -keepattributes Signature # 抛出异常时保留代码行号 -keepattributes SourceFile,LineNumberTable #优化时允许访问并修改有修饰符的类和类的成员,这可以提高优化步骤的结果。 # 比如,当内联一个公共的getter方法时,这也可能需要外地公共访问。 # 虽然java二进制规范不需要这个,要不然有的虚拟机处理这些代码会有问题。当有优化和使用-repackageclasses时才适用。 #指示语:不能用这个指令处理库中的代码,因为有的类和类成员没有设计成public ,而在api中可能变成public -allowaccessmodification #当有优化和使用-repackageclasses时才适用。 -repackageclasses '' # 混淆时记录日志(打印混淆的详细信息) # 这句话能够使我们的项目混淆后产生映射文件 # 包含有类名->混淆后类名的映射关系 -verbose -keep public class * extends android.app.Activity -keep public class * extends android.app.Application -keep public class * extends android.support.multidex.MultiDexApplication -keep public class * extends android.app.Service -keep public class * extends android.content.BroadcastReceiver -keep public class * extends android.content.ContentProvider -keep public class * extends android.app.backup.BackupAgentHelper -keep public class * extends android.preference.Preference -keep public class * extends android.view.View -keep class android.support.** {*;}## 保留support下的所有类及其内部类 # 这指定了继承Serizalizable的类的如下成员不被移除混淆 -keepclassmembers class * implements java.io.Serializable { static final long serialVersionUID; private static final java.io.ObjectStreamField[] serialPersistentFields; private void writeObject(java.io.ObjectOutputStream); private void readObject(java.io.ObjectInputStream); java.lang.Object writeReplace(); java.lang.Object readResolve(); } # 保留我们自定义控件(继承自View)不被混淆 -keep public class * extends android.view.View{ *** get*(); void set*(***); public <init>(android.content.Context); public <init>(android.content.Context, android.util.AttributeSet); public <init>(android.content.Context, android.util.AttributeSet, int); } #webView需要进行特殊处理 -keepclassmembers class fqcn.of.javascript.interface.for.Webview { public *; } -keepclassmembers class * extends android.webkit.WebViewClient { public void *(android.webkit.WebView, java.lang.String, android.graphics.Bitmap); public boolean *(android.webkit.WebView, java.lang.String); } -keepclassmembers class * extends android.webkit.WebViewClient { public void *(android.webkit.WebView, jav.lang.String); } #在app中与HTML5的JavaScript的交互进行特殊处理 #我们需要确保这些js要调用的原生方法不能够被混淆,于是我们需要做如下处理: -keepclassmembers class com.ljd.example.JSInterface { <methods>; } #androidx -keep class com.google.android.material.** {*;} -keep class androidx.** {*;} -keep public class * extends androidx.** -keep interface androidx.** {*;} -dontwarn com.google.android.material.** -dontnote com.google.android.material.** -dontwarn androidx.** #=====友盟Start -keep class com.umeng.** {*;} -keep class com.uc.** {*;} -keepclassmembers class * { public <init> (org.json.JSONObject); } -keepclassmembers enum * { public static **[] values(); public static ** valueOf(java.lang.String); } -keep class com.zui.** {*;} -keep class com.miui.** {*;} -keep class com.heytap.** {*;} -keep class a.** {*;} -keep class com.vivo.** {*;} #=====友盟END #PictureSelector 2.0 -keep class com.luck.picture.lib.** { *; } #Ucrop -dontwarn com.yalantis.ucrop** -keep class com.yalantis.ucrop** { *; } -keep interface com.yalantis.ucrop** { *; } #Okio -dontwarn org.codehaus.mojo.animal_sniffer.* #rxjava -dontwarn sun.misc.** -keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* { long producerIndex; long consumerIndex; } #glide -keep public class * implements com.bumptech.glide.module.GlideModule #-keep public class * extends com.bumptech.glide.AppGlideModule -keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** { **[] $VALUES; public *; } #EventBus -keepattributes *Annotation* -keepclassmembers class * { @org.greenrobot.eventbus.Subscribe <methods>; } -keep enum org.greenrobot.eventbus.ThreadMode { *; } # And if you use AsyncExecutor: -keepclassmembers class * extends org.greenrobot.eventbus.util.ThrowableFailureEvent { <init>(java.lang.Throwable); } ##---------------Begin: proguard configuration for Gson ---------- # Gson uses generic type information stored in a class file when working with fields. Proguard # removes such information by default, so configure it to keep all of it. -keepattributes Signature # For using GSON @Expose annotation -keepattributes *Annotation* # Gson specific classes -dontwarn sun.misc.** #-keep class com.google.gson.stream.** { *; } # Application classes that will be serialized/deserialized over Gson -keep class com.junxin.zeropay.bean.** { *; } #-keep class com.junxin.zeropay.bean.IndexBean { <fields>; } #-keep class com.junxin.zeropay.bean.IndexDataBean { <fields>; } #-keep class com.junxin.zeropay.bean.IndexListBean { <fields>; } # Prevent proguard from stripping interface information from TypeAdapterFactory, # JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter) -keep class * implements com.google.gson.TypeAdapterFactory -keep class * implements com.google.gson.JsonSerializer -keep class * implements com.google.gson.JsonDeserializer # Prevent R8 from leaving Data object members always null -keepclassmembers,allowobfuscation class * { @com.google.gson.annotations.SerializedName <fields>; } ##---------------End: proguard configuration for Gson ---------- -keep class cn.sharesdk.**{*;} -keep class com.sina.**{*;} -keep class com.mob.**{*;} -keep class com.bytedance.**{*;} -dontwarn cn.sharesdk.** -dontwarn com.sina.** -dontwarn com.mob.** ## - - - - - - - - 微信 - - - - - - - - - - - - -keep class com.tencent.mm.opensdk.** { *; } -keep class com.tencent.wxop.** { *; } -keep class com.tencent.mm.sdk.** { *; } ## - - - - - - - - GSYPlayer - - - - - - - - - - - - -keep class com.shuyu.gsyvideoplayer.video.** { *; } -dontwarn com.shuyu.gsyvideoplayer.video.** -keep class com.shuyu.gsyvideoplayer.video.base.** { *; } -dontwarn com.shuyu.gsyvideoplayer.video.base.** -keep class com.shuyu.gsyvideoplayer.utils.** { *; } -dontwarn com.shuyu.gsyvideoplayer.utils.** -keep class tv.danmaku.ijk.** { *; } -dontwarn tv.danmaku.ijk.** -keep public class * extends android.view.View{ *** get*(); void set*(***); public <init>(android.content.Context); public <init>(android.content.Context, android.util.AttributeSet); public <init>(android.content.Context, android.util.AttributeSet, int); } ## 时间选择器 -keepattributes InnerClasses,Signature -keepattributes *Annotation* -keep class cn.qqtheme.framework.entity.** { *;}
m - Gogs: Go Git Service

m.hellocode.cn

ask.png 1.5KB

m - Gogs: Go Git Service

m.hellocode.cn

banner.jpg 342KB

m - Gogs: Go Git Service

m.hellocode.cn

freeBuyWeb - Gogs: Go Git Service

0元购的下载页面、隐私条款

sosoyi fbd96eb2f9 no message 3 years ago
..
privacy.81b17dee.css 7a786d699c 漫步今日益行 3 years ago
XinChuang/client_web - Gogs: Go Git Service

4 Commits (master)

Auteur SHA1 Bericht Datum
  yy 066d7b039c 头像上传(待定 3 jaren geleden
  yy 7d0a22ebe2 首页公告列表接口 3 jaren geleden
  yy db877136d4 init 3 jaren geleden
  yy 422ea9d470 init 3 jaren geleden
xiaomo_mobile_ios - Gogs: Go Git Service

小墨的iOS移动端APP代码

朱海文 3e28daaec5 init %!s(int64=3) %!d(string=hace) años
..
SharkORM 3e28daaec5 init %!s(int64=3) %!d(string=hace) años
LICENSE 3e28daaec5 init %!s(int64=3) %!d(string=hace) años
README.md 3e28daaec5 init %!s(int64=3) %!d(string=hace) años

README.md

Shark ORM

Shark allows you to create a model layer in your iOS, macOS or tvOS app naturally, using simple and clean syntax. Shark does as much of the heavy lifting for you, so you don't have to put unnecessary effort into dealing with your data objects.

Its mantra is simple, to be fast, simple and the first choice for any developer.

Getting started

Shark is designed to get your app working quickly, integrated as source code, or as a framework.

Requirements

| Shark Version | Minimum iOS Target | Notes | |:--------------------:|:---------------------------:|:----------------------------:|:-------------------------------------------------------------------------:| | 2.x.x | iOS 6 as source, iOS 8 as framework | Xcode 7 is required. | | 2.x.x | tvOS 9 as source and framework | Xcode 7 is required. | | 2.x.x | macOS 10.8 as source and framework | Xcode 7 is required. | | 2.x.x | watchOS 2 as source and framework | Xcode 7 is required. |

###Install From Cocoapods

####To install it, simply add the following line to your Podfile:

pod "SharkORM"

###Install as Framework Download the source code from GitHub and compile the SharkORM framework target, and then within your application, add the following:

// include the framework header within your app, for Swift add this to the bridging header
#include <SharkORM/SharkORM.h>

###Install as Source Download the source code from GitHub and add to your target the contents of Core and SQLite:

// include the header within your app, for Swift add this to the bridging header
#include “SharkORM.h”

##Getting help and support If you are having trouble with your implementation then simply ask a question on Stack Overflow, the team actively monitor SO and will answer your questions as quickly as possible.

If you have found a bug or want to suggest a feature, then feel free to use the issue tracker in GitHub to raise an issue.

Usage

Setting up your project

Once you have added the SharkORM framework into your application, you will need to start it as soon as possible in your application lifecycle. SRKDelegate needs to be set as well, we recommend this is added to your application delegate.

// Objective-C
@interface AppDelegate : UIResponder <UIApplicationDelegate, SRKDelegate>
// Swift
class AppDelegate: UIResponder, UIApplicationDelegate, SRKDelegate

Then you need to start SharkORM early on:

// Objective-C
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    [SharkORM setDelegate:self];
    [SharkORM openDatabaseNamed:@"myDatabase"];
    return YES;
}
// Swift
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
	
	SharkORM.setDelegate(self)
	SharkORM.openDatabaseNamed("myDatabase")
	
	return true
}

###Objects SharkORM objects are normal classes with properties defined on them, the ORM then inspects all these classes and mirrors their structure in a SQLite database automatically. If you add or remove columns, then the tables are updated to represent the current structure of the classes.

You can use these classes in much the same way as any other class in the system, and they can be extended with methods and sub classed, and passed around from thread to thread with no problem.

In Objective-C properties need to be implemented using @dynamic, this is to indicate to the ORM that it will control the fetching and setting of these values from the database, and in Swift the property is implemented as var dynamic

####Example Object Objective-C

//  Header File : Person.h
#import "SharkORM.h"

@interface Person : SRKObject

@property NSString*         name;
@property int               age;
@property int               payrollNumber;

// to create a relationship, you add a property as another SRKObject class
@property Department*       department;

@end

// Source File : Person.m
#import "Person.h"

@implementation Person

@dynamic name,age,payrollNumber, department;

@end

Swift


class Person: SRKObject {
	dynamic var name : String?
	dynamic var age : NSNumber?
	dynamic var payrollNumber : NSNumber?
	dynamic var department : Department?
}

##Supported Types

Shark supports the following types: BOOL, bool, int, int64, uint, uint64, float, double, long, long long, unsigned long long, NSString, NSDate, NSData, NSNumber.

##Relationships

SRKObjects can be linked to each other either by directly embedding them to create a one-to-one relationship (dynamic var department : Department?) or for a one-to-many relationship we employ the use of a method which returns either an NSArray or SRKResultSet object.

With the Person object already defined, and with a property department let’s look at the Department class.

Objective-C

// Department.h
@interface Department : SRKObject
@property NSString*   	name;
@property Location*		location;
@end

Swift

class Department : SRKObject { 
    dynamic var name: String?
    dynamic var location: Location?
}

###One-to-One Relationships

This has been created by adding the Department property into the SRKObject class, and once it has been set with a value it can be used as any other property making use of object dot notation.

Objective-C

Person* employee = [Person new];
Department* section = [Department new];
employee.department = section; 

Swift

let employee = Person()
let section = Department()
employee.department = section

Properties can then be accessed directly, and Shark will automatically retrieve any related objects and allow you to access their properties. For example employee.deparment.location.address will automatically retrieve the required objects to satisfy the statement by loading the related Department and Location objects.

###One-to-Many Relationships

You can define to-many relationships by adding methods to the inverse relationship. For example, to relate in a to-many relationship Department and Person we would add the following method to Department.

Objective-C

- (SRKResultSet*)people {
    return [[[Person query] whereWithFormat:@"department = %@", self] fetch];
}

Swift

func people() -> SRKResultSet {
	return Person.query()
            	 .whereWithFormat("department = %@", withParameters: [self])
                 .fetch()
}

You can then safely use these results anywhere, and because an SRKResultSet is an array object, these can be iterated inline. for (Person* employee in [department people]) {...}.

##Indexing Properties

Shark supports indexing by overriding the indexDefinitionForEntity method and returning an SRKIndexDefinition object which describes all of the indexes that need to be maintained on the object.

Objective-C

+ (SRKIndexDefinition *)indexDefinitionForEntity {
    SRKIndexDefinition* idx = [SRKIndexDefinition new];
    [idx addIndexForProperty:@"name" propertyOrder:SRKIndexSortOrderAscending];
    [idx addIndexForProperty:@"age" propertyOrder:SRKIndexSortOrderAscending];
    return idx;
}

Swift

override class func indexDefinitionForEntity() -> SRKIndexDefinition {
	let idx = SRKIndexDefinition()
	idx.addIndexForProperty("name", propertyOrder: SRKIndexSortOrderAscending)
	idx.addIndexForProperty("age", propertyOrder: SRKIndexSortOrderAscending)
	return idx
}

These will automatically be matched to the appropriate query to aid performance. All related object properties are automatically indexed as is required for caching. So there would be no need, for instance, to add in an index for Person.department as it will have already been created.

###Default Values You can specify a set of default values for whenever a new SRKObject is created, by overriding the method defaultValuesForEntity, and returning a dictionary of default values: Objective-C

+ (NSDictionary *)defaultValuesForEntity {
    return @{@"age": @(36), @"name" : @"Billy"};
}

Swift

override class func defaultValuesForEntity() -> [NSObject : AnyObject] {
    return ["name" : "Billy", "age" : 36]
}

##Triggers Shark objects all have the same methods available for them, to enforce constraints and check validity before or after writes have been made.

###entityWillInsert(), entityWillUpdate(), entityWillDelete() returning bool Objects receive this method before any action has been carried out. In here you can test to see if you wish the operation to continue. If true is returned then the operation is told to continue, but if false is retuned then the transaction is aborted, and the commit returns false. Objective-C

- (BOOL)entityWillDelete {
    return self.persons.count == 0;
}

Swift

override func entityWillDelete() -> Bool {
    return Department.people().count == 0;
}

###entityDidInsert(), entityDidUpdate(), entityDidDelete() Objects receive this message after an event has happened and after the transaction is complete.

###Printing objects using print(), NSLog or po We have provided a printable dictionary styled output which, when called, produces output like below.

{
    entity = Person;
    joins =     {
    };
    "pk column" = Id;
    "pk value" = 36664;
    properties =     (
                {
            name = Id;
            type = number;
            value = 36664;
        },
                {
            name = payrollNumber;
            type = number;
            value = 0;
        },
                {
            name = age;
            type = number;
            value = 36;
        },
                {
            name = Name;
            type = unset;
            value = "<null>";
        },
                {
            name = location;
            type = unset;
            value = "<null>";
        },
                {
            name = department;
            type = unset;
            value = "<null>";
        },
                {
            name = seq;
            type = number;
            value = 0;
        }
    );
    relationships =     (
                {
            property = department;
            status = unloaded;
            target = Department;
        },
                {
            property = location;
            status = unloaded;
            target = Location;
        }
    );
}

##Writing Objects Shark looks to simplify the persistence of objects down to a simple method commit. This can be called at any moment and from any thread. If an object contains either a single or multiple related objects within it, then calling commit on the parent object will automatically store all the subsequent objects too.

Objective-C

// Create a new object
Person* thisPerson = [Person new];

// Set some properties
thisPerson.age = 37;
thisPerson.payrollNumber = 123456;
thisPerson.name = @"Adrian Herridge";

// Persist the object into the datastore
[thisPerson commit];

Swift

// Create a new object
var thisPerson = Person()

// Set some properties
thisPerson.age = 37;
thisPerson.payrollNumber = 123456;
thisPerson.name = "Adrian Herridge";

// Persist the object into the datastore
thisPerson.commit()

Objects are committed immediately and are written to the store in an atomic fashion. They will become immediately queryable upon completion.

###Writing in Transactions For some batch storage situations, it may be better to batch a lot of writes into a single transaction, this will improve speed, but will also increase memory usage during that process as any event methods would have to be honoured during the commit. Transactions are setup as follows:

Objective-C

[SRKTransaction transaction:^{
    // Create a new object
    Person* thisPerson = [Person new];
    thisPerson.name = @"Adrian Herridge";
    // although the commit is indicated, it is delayed until the transaction is closed.
    [thisPerson commit];
} withRollback:^{}];

Swift

SRKTransaction.transaction({ 
    // Create a new object
    var thisPerson = Person()
    thisPerson.name = "Adrian Herridge";
    // although the commit is indicated, it is delayed until the transaction is closed.
    thisPerson.commit()
    }) { // the rollback on failure }

##Querying To retrieve objects back, we use the SRKQuery object that is associated with every SRKObject class. This then takes optional parameters such as where, limit, orderBy & offset. All of the parameters return the same query object back, enabling the building of a query within a single nested instruction.

The final call to a query object is made using fetch, count, sum, fetchLightweight & fetchAsync which will then execute the query and return the results.

An example to fetch an entire table: Objective-C

SRKResultSet* results = [[Person query] fetch];

Swift

var results : SRKResultSet = Person.query().fetch()

Queries can be built up using a FLUENT interface, so every call except a call to a retrieval method returns itself as a SRKQuery, allowing you to nest your parameters. Objective-C

SRKResultSet* results = [[[[[Person query]
                       		where:@"age = 35"]
                       		limit:99]
                     	  orderBy:@"name"]
                        fetch];

Swift

var results = Person.query()
					.whereWithFormat("age = %@", withParameters: [35])
					.limit(99).orderBy("name")
					.fetch()

As of v2.0.8 you can now use object dot notation to query related objects via the property path. If we take the example of a Person class which is related to the Department class via the department property.

Objective-C

[[[Person query] where:@"department.name = 'Test Department'"] fetch]

Swift

Person.query().whereWithFormat("department.name = %@", withParameters: ["Test Department"]).fetch()

Where name is within a related object, SharkORM will now automatically re-arrange the query and join the two tables on that relationship and therefore validate that condition.

###Supported parameters to SRKQuery Shark supports the following optional parameters to a query:

###where, whereWithFormat (and with parameters).
This is the query string supplied to the query, and can contain format specifiers along with object to be placed into the query as normal parameter options. Supported format specifiers are %@,%i,%u,%d,%s,%f,%ul,%ull.

%@ objects can also be Arrays and Sets for use in subqueries, such as @"department IN (%@)", @[@(1),@(2),@(3)]. ###limit Specifies the limit to the number of query results to return ###orderBy Specifies the order by which the SRKResultSet will be returned. These can be multiple values, such as orderBy("name,age"). ###offset Specifies the offset in the values to be retrieved, to allow developers to only retrieve a window of data when required. ###batch This, although it does not affect the query, does allow developers to iterate through a large data set without having the performance and memory issue of dealing with the entire data set. If a batch size of 10 is specified, then the SRKResultSet will perform an entire query, but will only fully retrieve the first 10 objects. Then, it will maintain a window of the batch size when iterating through the results, automatically fetching them in batches. This enables developers to optimise their system without the need to change the way their code is written. ###joinTo Shark allows LEFT JOIN unions to be made, to allow for faster and less nested queries. See Joins for more info. ##Other types of Query In addition to retrieving entire objects there are also additional types of queries which help developers solve other problems. ###fetchLightweight Fetches an object from the store, except it does not retrieve any property values. These are lazily loaded upon access, and can be configured to then be permanently available of freed immediately. ###fetchAsync Performs an asynchronous query on a background thread and then executes the supplied block when the results are complete.

###count Returns a count of the query, the same as COUNT(*) would. ###sum Returns a SUM(field) value from the supplied property name, these can also be compound, such as SUM(property1 + property2). ###distinct Returns an NSArray of the distinct values for a particular column, it is used like distinct("surname"). ###groupBy Returns an NSDictionary, which is grouped by the specified property groupBy("surname"). ###ids Returns the PK values of the matching objects, this is a faster way to store results for use in a subquery. Although, in practice it is little faster than using lightweight objects.

##Joins Joins represent the most powerful feature of SQL as the way any RDBMS is optimised is not through subqueries, but through joins and null checking.

In Shark, for the time being, all joins are LEFT JOIN. Simply because we have to retrieve whole objects from the originating query class. But joins can be multiple and compound.

Example of a join from [Person] -> [Department] Objective-C

[[Person query] joinTo:[Department class] leftParameter:@"department" targetParameter:@"Id"]

Swift

Person.query()
	  .joinTo(Department, leftParameter: "department", targetParameter: "Id")

But you can also create an [Person]->[Department]->[Location] three way join, using the result of the first join to perform the second. Objective-C

[[[Person query] joinTo:[Department class] leftParameter:@"department" targetParameter:@"Id"]
                 joinTo:[Location class] leftParameter:@"Department.location" targetParameter:@"Id"]

Swift

Person.query()
      .joinTo(Department, leftParameter: "department", targetParameter: "Id")
      .joinTo(Location, leftParameter: "Department.location", targetParameter: "Id")

Once you have performed your join, the results are stored per object in a dictionary joinedResults.

An example of output looks like this.

{
    "Department.Id" = 61;
    "Department.location" = 35;
    "Department.name" = Development;
    "Location.Id" = 35;
    "Location.locationName" = Alton;
}

###Removing objects To remove an object from Shark you simply call remove() on this object, this will delete it form the data store and sterilise it to ensure it cannot be accidentally written back at a later date. To optimise the bulk removal of objects, a query can be combined with a call to removeAll() on the result set to delete many objects at once.

Objective-C

[[[[Person query] where:@"age < 18"] fetch] removeAll];

Swift

Person.query()
      .whereWithFormat("age < %@", withParameters: [18])
      .fetch()
      .removeAll()

The longhand version of this is: Objective-C

for (Person* person in [[Person query] fetch]) {
	[person remove];
}

Swift

for person in Person.query().fetch() {
	person.remove()
}

##Event handling Shark events fall into two caregories, the first being events on an individual object and the second being events on a class.

Class events are raised when there has been any underlying change in the values stored in a class. This is useful for updating a view when data is written on a background thread, or event triggers are actioned.

Registering an event block simply requires you to create a new SRKEventHandler object by calling a creation method on the class. Objective-C

SRKEventHandler* eHandler = [Person eventHandler];
[eHandler registerBlockForEvents:SharkORMEventInsert withBlock:^(SRKEvent *event) {
        // update the tableview here
} onMainThread:YES];

Swift

let eHandler = Person.eventHandler()
eHandler.registerBlockForEvents(SharkORMEventInsert, withBlock: { (event: SRKEvent!) in
        // update the tableview here
}, onMainThread: true)

For object event handlers, all individual objects have the ability to register blocks against them by just making the same call to registerBlockForEvents. This will then automatically make the object live and will observe any changes to that corresponding object within the datastore, these will happen across any thread.

Requirements:

  • CocoaPods 1.0.0

Carthage compatible

client_web_mobile - Gogs: Go Git Service

信创手机端

.browserslistrc 30B

    > 1% last 2 versions not dead