-
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
Conversation
Conflicts: Source/BottomView/BottomContainerView.swift Source/BottomView/ImageWrapper.swift Source/ImagePickerController.swift
|
||
func adjustButtonTitle(notification: NSNotification) { | ||
if let sender = notification.object as? ImageStack { | ||
let title = sender.images.count != 0 ? |
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.
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 |
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.
Could you do?
views.first.alpha = 1
@hyperoslo/myshop-ios this looks fine to me. what do you guys think? |
Having a look now. |
[topView, cameraController.view, galleryView, bottomContainer].map { self.view.addSubview($0) } | ||
view.backgroundColor = self.configuration.mainColor | ||
|
||
setupConstraints() | ||
} | ||
|
||
|
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.
You could remove this extra newline
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