Skip to content
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
merged 67 commits into from
Aug 26, 2015
Merged

Refactor #13

merged 67 commits into from
Aug 26, 2015

Conversation

richardtop
Copy link
Contributor

I've separated view (StackView) from model (ImageStack), so we could easily swap views if needed.
Now ImageStack is the model object which represents selected photos. As it's state is being shown by multiple items (StackView, selected photos number) - I use notifications to change their state.

I've removed some delegate calls as they are not needed now, as the controller owns the stack and passes it to the collection view.

It is possible to reuse separate components. StackView and ImageStack were designed to be reusable - i.e. it is possible to swap view with any other, or add more/less images.

Tested on device.

@RamonGilabert how do you feel about it? I think, now it is finalized


func adjustButtonTitle(notification: NSNotification) {
if let sender = notification.object as? ImageStack {
let title = sender.images.count != 0 ?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I favor .isEmpty here.

//TODO: subclass view and use setimage method here to automatically adjust alpha and NIL
views.map { $0.image = nil }
views.map { $0.alpha = 0 }
views[0].alpha = 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you do?

views.first.alpha = 1

@zenangst
Copy link
Contributor

@hyperoslo/myshop-ios this looks fine to me. what do you guys think?

@RamonGilabert
Copy link
Contributor

Having a look now.

[topView, cameraController.view, galleryView, bottomContainer].map { self.view.addSubview($0) }
view.backgroundColor = self.configuration.mainColor

setupConstraints()
}


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could remove this extra newline

zenangst added a commit that referenced this pull request Aug 26, 2015
@zenangst zenangst merged commit 6215145 into master Aug 26, 2015
@zenangst zenangst deleted the refactor branch August 26, 2015 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants