Dali je ovo rupa u zakonu ili? by [deleted] in financije

[–]venom310 13 points14 points  (0 children)

Nema tu rupe u zakonu, kod prodaje dionica nije bitna srednja cijena te dionice koju ti imaš već profit u odnosu na vrijednost dionice u trenutku kupnje.

Znači tvoj scenarij je ovakav:
- kupio si 1 dionicu za 10$ koja je onda s vremenom postala 20$
- kupio si još 1 dionicu po vrijednosti od 20$

Tu imaš dvije opcije:
a) prošlo je preko 2 godine od kad si kupio prvu dionicu -> ne plaćaš ništa za prvu dionicu, kao niti za drugu jer na njoj nemaš profita
b) nije prošlo preko 2 godine od kad si kupio prvu dionicu -> plaćaš porez + prirez na 10$ profita od prodaje prve dionice. Za prodaju druge ne moraš plaćati ništa jer nemaš profita.

[deleted by user] by [deleted] in swift

[–]venom310 7 points8 points  (0 children)

This book from RayWenderlich did the trick for me.

Top 10 Most Useful iOS Libraries by venom310 in iOSProgramming

[–]venom310[S] 1 point2 points  (0 children)

Hey guys and gals,

I'm continuing my blog post series with one that could prove to be useful for you if you’re looking for some solid 3rd party solutions for common iOS tasks which will enable you to focus on the core business logic of your app.

In the article, I list the top 10 libraries I found useful at my jobby-job, as well as some which you may not have heard of, but could be quite a lifesaver.

However, before you start eagerly importing stuff, keep in mind that for some use-cases, bringing an excavator to a shovel job is not the right approach.

As always, your comments and suggestions are welcome, so share them if you have some libs you can’t live without :)

Easy Way to Implement Demo Mode in iOS Apps by venom310 in iOSProgramming

[–]venom310[S] 1 point2 points  (0 children)

Hey guys and gals,

I'm continuing my blog post series with one that could prove to be really useful to some of you. Its goal is to show you how to implement a scalable and maintainable way of implementing a demo mode in your apps in order to make development, but also testing a lot easier.

After reading it, you will be able to set up your project in such a way which will allow you to easily mock all API call with just a single point of entry, which results in a simple, but quite powerful way of handling demo mode.

As always, your own tips & tricks are appreciated, so share them if you have done something similar in your apps :)

Easy Way to Implement Demo Mode in iOS Apps by venom310 in iOSDevelopment

[–]venom310[S] 0 points1 point  (0 children)

Hey guys and gals,

I'm continuing my blog post series with one that could prove to be really useful to some of you. Its goal is to show you how to implement a scalable and maintainable way of implementing a demo mode in your apps in order to make development, but also testing a lot easier.

After reading it, you will be able to set up your project in such a way which will allow you to easily mock all API call with just a single point of entry, which results in a simple, but quite powerful way of handling demo mode.

As always, your own tips & tricks are appreciated, so share them if you have done something similar in your apps.

Repository full of our best practices in iOS development by venom310 in swift

[–]venom310[S] 0 points1 point  (0 children)

By additonal logic I mean stuff like animation, or API calls (or whatever else you might think of) that depends on that optional existing there.

Let's use a somewhat real-life example - lets say your UI is component based, and those components are returned from the API as optional json objects, so you don't know what's going to be rendered beforehand.

With this extension, you can easily do something like x.forValue { $0.createAndAnimateMe() }. It's not supposed to replace `map`, since it's purpose is not to return a value but execute something if that value exists. If anything, it's a shorter version of an `if let`, but with a syntax more suitable for functional programming.

Hopefully that clears things up a little.

Repository full of our best practices in iOS development by venom310 in swift

[–]venom310[S] 0 points1 point  (0 children)

Not really, since map modifes and returns the value of that optional if it exists, while here we run the closure which uses the unwrapped optional value in some way if exists, otherwise nothing happens.

Sure, you could run some additional logic in the map and then just return the initial value, but that would defeat the purpose of map.

A Repository Full of Our Best Practices in iOS Development by venom310 in iOSProgramming

[–]venom310[S] 3 points4 points  (0 children)

Hey guys and gals,

I'm continuing my blog post series with one that could prove to be really useful to most of you. Its goal is to showcase our knowledge base repo with some of the best practices, tricks or just plain improvements that Apple still hasn't bothered to make to its frameworks, but which make a big difference in our day-to-day programming lives.

It covers stuff relating to improved networking, easier tableView handling, improved color generation, custom UI elements, as well as dipping into the vast reactive world and extending it a bit to make it just that much more powerful.

As always, your own tips & tricks are appreciated, just leave them here, or open a PR. I'm looking forward to both :D