-
Notifications
You must be signed in to change notification settings - Fork 677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor #13
Merged
Refactor #13
Changes from all commits
Commits
Show all changes
67 commits
Select commit
Hold shift + click to select a range
3265bbe
Add interface
richardtop c62606e
Add console outputs
richardtop d5e43e3
Add image storage array
richardtop 1c14032
Add array of views
richardtop cfbf8fb
Merge pull request #1 from richardoti/refactor
richardtop bf514e0
Fix affine transform bug
richardtop d00b669
Make ImageStack a singleton
richardtop c231179
Add stub for view generation
richardtop b0a252e
Make scheme shared
richardtop d26d087
Separate model (ImageStack) and View (StackView(
richardtop c2be320
MVP
richardtop 24bba2e
Add PUSH to stack
richardtop 3af3d1e
Drop Wrapper to the floor
richardtop 24af5c8
Merge pull request #2 from richardoti/refactor
richardtop 094bdf9
Refactor ImageStack
richardtop 4f0de9e
Refactor StackView
richardtop c64a720
Comment-out temporarily unused functions
richardtop 7d1b645
Merge pull request #3 from richardoti/refactor
richardtop 622c719
Show images in correct order
richardtop ab44a32
Delegate method to map
richardtop 070efcd
Add array of views and gesture recognizer
richardtop e512178
Refactor delegate methods
richardtop ff32539
Refactor StackView
richardtop ca040fa
Refactor stack view
richardtop a8ef893
Remove debugging code from ImageStack
richardtop 75552f7
Fully remove ImageWrapper
richardtop 1afb0d3
Refactor variable names to StackView
richardtop 62104dd
Fully refactor remains of Wrapper
richardtop 5ea7743
Remove shared scheme
richardtop d9186a6
Merge branch 'master' of https://github.com/hyperoslo/ImagePicker
richardtop b2f2990
Merge pull request #12 from richardoti/master
richardtop d1a5cc3
Make stack to work like real stack (append to head)
richardtop eb8f80c
Fix correct ordering of pictures
richardtop 35b09b1
Add TODO
richardtop aafbee9
Revert previous behavior (append to the end)
richardtop 3f2ad44
Add animations
richardtop 4707d74
Merge pull request #14 from hyperoslo/improve/imageStack
richardtop 6892ca7
No println's are allowed
richardtop 9767f45
Correct layout to match original
richardtop 8f6743d
Change NSMutableArray to array of images
richardtop d0c175a
Replace delegate with notifications
richardtop 5492b09
Bind photo button label to notifications
richardtop 65e7133
Subscribe at correct place
richardtop a576b4c
Re-indent
richardtop 006457b
Remove extra pushes to stack
richardtop 6b6d7c2
ImageStack - make class, send sender with notifications
richardtop c4675a5
Stackview - remove shared instance
richardtop 7411f83
Remove shared instance from Picker shutter button
richardtop b87bf7b
Remove shared instance from datasource
richardtop b800bc5
Remove shared instance from controller
richardtop 5356ec7
Remove shared instance / delegate methods from gallery
richardtop a14ecd5
Fully remove shared stack
richardtop 3a3778b
Merge pull request #16 from hyperoslo/remove-shared-instance
richardtop 623daf8
Remove shared stack from the controller
richardtop eea9fd9
Remove commented code
richardtop d3688c2
Fix gesture recognizers and make interface compatible
richardtop 50c624a
Make vars and methods public
richardtop d7f5ca4
Change button title at one point only
richardtop b95a87d
Add stack-reload notification
richardtop d1f4913
Fix improper view rendering
richardtop ca73037
Reload collectionview automatically on source change
richardtop 8bde548
Revert "Reload collectionview automatically on source change"
richardtop d403ff7
Add public method to reset images in stack
richardtop 1148868
Make only one placeholder visible at a time
richardtop 6490e0c
Refactor according to the suggestions
richardtop 72955c7
Refactor according to the suggestions
richardtop 4f80265
Refactor according to the suggestions
richardtop File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import UIKit | ||
|
||
public class ImageStack { | ||
|
||
public struct Notifications { | ||
public static let imageDidPush = "imageDidPush:" | ||
public static let imageDidDrop = "imageDidDrop:" | ||
public static let stackDidReload = "stackDidReload:" | ||
public static let imageKey = "image" | ||
} | ||
|
||
public var images = [UIImage]() | ||
|
||
public func pushImage(image: UIImage) { | ||
images.append(image) | ||
NSNotificationCenter.defaultCenter().postNotificationName(Notifications.imageDidPush, object: self, userInfo: ["image" : image]) | ||
} | ||
|
||
public func dropImage(image: UIImage) { | ||
images = images.filter() {$0 != image} | ||
NSNotificationCenter.defaultCenter().postNotificationName(Notifications.imageDidDrop, object: self, userInfo: ["image" : image]) | ||
} | ||
|
||
public func resetImages(newImages: [UIImage]) { | ||
images = newImages | ||
NSNotificationCenter.defaultCenter().postNotificationName(Notifications.stackDidReload, object: self, userInfo: nil) | ||
} | ||
|
||
public func containsImage(image: UIImage) -> Bool { | ||
return contains(images, image) | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strange name of notification though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is
key
forUIImage
in Dictionary. Decided to keep in notifications as it is the only place its being used.