jackpine / biketag-ios

http://biketag.jackpine.me
1 stars 1 forks source link

Feature/fix refresh locks screen #89

Closed michaelkirk closed 8 years ago

michaelkirk commented 8 years ago

fixes #79

Initially shows "loading screen" for each spot, while real image is fetched async.

I don't like that the Spot model now has to track it's spot view and notify it on change - but is there a better way @jmoody ?

jmoody commented 8 years ago

Let's talk about this today after stand up. Reading Swift is turning out to be difficult.

If we don't get a chance...

The pattern I use is to have the controller be responsible for fetching the remote data and then telling the views to refresh.

I tell a view to refresh by sending them setNeedsLayout which will trigger the view's layoutSubviews method.

It is that reference in the Spot model to the UIImageView that is a little strange...

michaelkirk commented 8 years ago

agreed that the reference from the Spot Model to the UIImageView is the awkward bit. I did try to put things in their "proper place" but unfortunately it was resulting in quite a lot more code, so I backed down. Maybe there is a different way to structure the relations that puts things in their "proper" place without a net increase in confusion.

jmoody commented 8 years ago

I am not concerned about the blurred lines between the Model and View. To my eye your implementation looked more complicated, but I didn't spend time thinking about alternatives.

I would have just shoved the behavior into the controller.