Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
hongxinhope committed May 26, 2017
1 parent 6ad910f commit a0e1892
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#RRuleSwift
# RRuleSwift
Swift rrule library for working with recurrence rules of calendar dates.

![Example](Gif/RRuleSwiftExample.gif "RRuleSwiftExample")

RRuleSwift is based on [rrule.js](https://github.com/jkbrzt/rrule).

##How To Get Started
###Carthage
## How To Get Started
### Carthage
Specify "RRuleSwift" in your ```Cartfile```:
```ogdl
github "teambition/RRuleSwift"
```

###Usage
##### Initialization
### Usage
#### Initialization
```swift
var recurrenceRule = RecurrenceRule(frequency: .daily)
recurrenceRule.calendar = ...
Expand All @@ -35,20 +35,20 @@ recurrenceRule.rdate = ...
recurrenceRule.exdate = ...
```

##### Rule form string
#### Rule form string
```swift
let ruleString = "RRULE:FREQ=MONTHLY;DTSTART=20160404T021000Z;COUNT=5;INTERVAL=2;WKST=MO;BYDAY=MO,TU"
let rule = RecurrenceRule(rruleString: ruleString)
```

##### String form rule
#### String form rule
```swift
let ruleString = rule.toRRuleString()
print(ruleString)
// RRULE:FREQ=MONTHLY;DTSTART=20160404T021000Z;COUNT=5;INTERVAL=2;WKST=MO;BYDAY=MO,TU
```

##### Inclusion date and Exclusion date
#### Inclusion date and Exclusion date
```swift
let rdateString = "RDATE:20180706T160000Z,20210706T160000Z"
if let inclusionDate = InclusionDate(rdateString: rdateString) {
Expand All @@ -75,7 +75,7 @@ if let exclusionDate = ExclusionDate(exdateString: exdateString, granularity: .y
}
```

##### Occurrence iterator
#### Occurrence iterator
```swift
let ruleString = "RRULE:FREQ=YEARLY;COUNT=11;WKST=MO"
if let rule = RecurrenceRule(rruleString: ruleString) {
Expand Down

0 comments on commit a0e1892

Please sign in to comment.