Skip to content

Commit

Permalink
Merge pull request #5 from T-Pham/master
Browse files Browse the repository at this point in the history
Fixed Carthage building fails
  • Loading branch information
alexdrone authored Sep 11, 2016
2 parents 0b38ad8 + 89305f8 commit 56b9719
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 17 deletions.
4 changes: 2 additions & 2 deletions Buffer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -265,7 +265,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down
80 changes: 80 additions & 0 deletions Buffer.xcodeproj/xcshareddata/xcschemes/Buffer.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "160E255E1CF44C3700A5F828"
BuildableName = "Buffer.framework"
BlueprintName = "Buffer"
ReferencedContainer = "container:Buffer.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "160E255E1CF44C3700A5F828"
BuildableName = "Buffer.framework"
BlueprintName = "Buffer"
ReferencedContainer = "container:Buffer.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "160E255E1CF44C3700A5F828"
BuildableName = "Buffer.framework"
BlueprintName = "Buffer"
ReferencedContainer = "container:Buffer.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ To install Carthage, run (using Homebrew):

Then add the following line to your `Cartfile`:

github "alexdrone/Buffer" "master"
github "alexdrone/Buffer" "master"


#### CocoaPods
TODO

#### Manually
Download and drop ```/Buffer``` folder in your project.
Download and drop ```/Buffer``` folder in your project.

import Buffer

#Getting started
#Getting started

Buffer is designed to be very granular and has APIs with very different degrees of abstraction.

Expand All @@ -53,7 +53,7 @@ class MyClass: BufferDelegate {

var elements: [Foo] = [Foo]() {
didSet {
// When the elements are changed the buffer object will compute the difference and trigger
// When the elements are changed the buffer object will compute the difference and trigger
// the invocation of the delegate methods.
// The `synchronous` and `completion` arguments are optional.
self.buffer.update(newValues, synchronous: false, completion: nil)
Expand Down Expand Up @@ -84,7 +84,7 @@ class MyClass: BufferDelegate {
public func bufferDidChangeAllContent(buffer: BufferType) {
}
}
```
```

###Tracking Keypaths

Expand All @@ -93,13 +93,13 @@ When one of the observed keypath changes for one of the items managed by your bu

```swift
buffer.trackKeyPaths(["foo", "bar.baz"])
```
```

###Built-in UITableView and UICollectionView adapter

One of the main use cases for **Buffer** is probably to apply changes to a TableView or a CollectionView.
**Buffer** provides 2 adapter classes that implement the `BufferDelegate` protocol and automatically perform the required
changes on the target tableview/collectionview when required.
**Buffer** provides 2 adapter classes that implement the `BufferDelegate` protocol and automatically perform the required
changes on the target tableview/collectionview when required.

```swift

Expand All @@ -115,7 +115,7 @@ class MyClass: UITableViewController {

var elements: [Foo] = [Foo]() {
didSet {
// When the elements are changed the buffer object will compute the difference and trigger
// When the elements are changed the buffer object will compute the difference and trigger
// the invocation of the delegate methods.
// The `synchronous` and `completion` arguments are optional.
self.buffer.update(newValues, synchronous: false, completion: nil)
Expand All @@ -128,7 +128,7 @@ let adapter: TableViewDiffAdapter<Foo>!
super.init()
self.adapter = TableViewDiffAdapter(buffer: self.buffer, view: self.tableView)

// Additionaly you can let the adapter be the datasource for your table view by passing a cell
// Additionaly you can let the adapter be the datasource for your table view by passing a cell
// configuration closure to the adpater.
adapter.useAsDataSource { (tableView, object, indexPath) -> UITableViewCell in
let cell = tableView.dequeueReusableCellWithIdentifier("MyCell")
Expand All @@ -139,7 +139,7 @@ let adapter: TableViewDiffAdapter<Foo>!

}

```
```

###Component-Oriented TableView

Expand All @@ -151,12 +151,12 @@ This abstraction allows for the tableView to reconfigure itself when its state (
import Buffer

class ViewController: UIViewController {

lazy var tableView: TableView<FooModel> = {
let tableView = TableView<FooModel>()
return tableView
}()

lazy var elements: [AnyListItem<FooModel>] = {
var elements = [AnyListItem<FooModel>]()
for _ in 0...100 {
Expand All @@ -176,15 +176,15 @@ class ViewController: UIViewController {
override func viewDidLayoutSubviews() {
self.tableView.frame = self.view.bounds
}

override func viewDidLoad() {
super.viewDidLoad()
self.view.addSubview(self.tableView)
self.tableView.elements = self.elements
}
}

```
```

Check the demo out to learn more about Buffer.

Expand Down

0 comments on commit 56b9719

Please sign in to comment.