Write once — Use everywhere in the whole project, no conditions — no modifications

Part-1 — UITableViewDelegate | UITableViewDatasource, $151.00 prize money

Hitendra Solanki
Swift India
6 min readMay 19, 2018

--

Push your self, become a winner.
Updated on 4th April 2019, 03:20 AM GMT 5:30+

Vision:

Less code, fewer bugs, fewer use-cases to test

Mission:

Reduce the possibility of bugs and improve the scalability by reducing the code of project in every possible scenario at an extreme level.

What is the challenge?

Have you ever think to write your table view delegates and data sources only one time for the whole project?

Once you are done with writing your code at one place, i.e. implementation of data source and delegates methods to create table view, none of the view controllers required to implement data source and delegate of table view in whole project, it must be written at one place only and used many times, any condition or modifications not required when you will have new screens to develop with different cell design. Your reusable code must be usable in other projects also, without any modifications or conditions.

Your solution must be a framework level solution instead of project level solution. You don’t require to create a framework here but my context is you can’t restrict the user to use his/her own existing base class if he/she already have in a project, something like bases classes of UIViewController and UITabelViewCell.

You must not restrict the user to access APIs provided by Apple’s UIKit to create table view or table view cell, the user should be allowed to create a table view or cell using pure code or XIB or storyboard.

user — who is using your reusable component

In your regular coding, whenever you confirm UITableViewDatasource in your view controller, compiler asks you for two required methods cellForRowAtIndexPath: and numberOfRowsInSection: if you miss any one of these two methods you will get compile time error. Your reusable component must allow the user to write delegate and data source methods manually in view controller whenever required, without any restrictions.

This means if the user wants to write only cellForRowAtIndexPath: method with custom logic and without implementing numberOfRowsInSection: then it must work if the user wants custom logic in cellForRowAtIndexPath: only. Similarly for all the UITableViewDelegate methods also.

You are not allowed to use closures or blocks or obj-c runtime, it must be implemented by delegation pattern only.

Start thinking about the challenge.

How to participate in this challenge?

Push your self, learn something new and be a winner.

1. Just fill this Google form: https://goo.gl/forms/zj2YrQu3H1LTbEKw2
2. Provide proper steps or Readme.md with your solution, so I can test it by creating a new view controller, new cell and new data model or dictionary to test your component.
3. Solution submission: https://goo.gl/forms/RIgCO1EAqmHgPGPN2

What will be the prize money for the winner(s)?

Winner(s) will get prize money of 151.00 USD.
It may be increased to 200.00 USD or more depends on the total number of participants and winners.
If there will be of more than one winner, I will distribute the prize money by the number of winners. If two winners then it will be 151/2 USD or more for each winner if prize money is 151.00 USD.

How winners will get prize money?

  • Paypal
  • UPI payments
  • Paytm | Freecharge |PhonePay | G Pay(Google pay) App
  • Bank Account
  • Amazon Pay
  • You can suggest your preferred way also

Note:

In the case of chargeable transactions, transaction charge is a part of prize money. e.g. transaction charge will be 2.00 then the winner will get 1998.00 if price money is 2000.00.

What if the requirements of this challenge are not clear for me?

Please write an email to hitendra.developer@gmail.com with subject “QUERY — Write once — Use every where in whole project, no conditions — no modifications” and I will respond to you in the same thread.

Disclaimer:

Hitendra Solanki reserved all rights to do any changes in mentioned requirements of this challenge, just to make the requirements more clear. Hitendra Solanki can also increase the prize money, but can not decrease below 99.00 USD or equivalent. Hitendra Solanki can ask you questions from the solution you submitted if required.

See what participants of this challenge are saying

By Luke Van In

Kindly do not copy paste the solution available on the internet, instead try to implement the solution by understanding the concept, this is the only reason behind this challenge.

Stay tuned, great concept implementation is on the way

Solution is already implemented by my self, Writing of this blog is almost done, just polishing the blog.
Only waiting for WINNERs and ideas of great iOS developers like you.

After announcement of winners, this blog will be published.
Start submitting your solutions now. I will mention name and details of winner in this blog.

typing…

This blog is an output of interesting and challenging question comes in mind when I think about reusability and code optimization.

The mentor and leader who gave me this kind of vision is Umang Kathiyara sir. He was always trying to push us at an extream level of logical thinking once we are done with our solutions during training periods. Umang Kathiyara is a big fan of #9.

Atit Sir found that I am going in a good direction which helps the community, so he wants to support my vision. Again I am increasing the prize money of this contests to 151.00 USD with his support.

Atit Purani (AP), is a serial entrepreneur who manages the development and growth of several tech ventures. His career journey started in early 2000 as a Database Programmer. Database Programming took him to the education field and then from founding & building several IT startup companies in India and other parts of the world too.

With around 16+ years of experience in the Information technology domain, his key strengths are fixing software delivery problems being a “tech” guy, team building, daily operations, training and development, capacity building and analysis for IT industry at large.

Atit holds a diverse portfolio of technology as well as other industry investments too. He always believes in finding a solution rather than focusing on the Problem. He argues that business is done with the brain, because he has successfully created all his businesses by engaging his heart & investing in the right people.

Atit always says that “Intentional Perseverance and deliberate patience overpowers talent “. His Moto: “Invest in right People and they will reap it back to You”.

AP is also the author of the book named Get It Delivered, which deals with software delivery rules.

Highlights of this challenge

The challenge is highlighted in one of the best telegram channel named Programming Challenges.

The challenge is highlighted on INDIA’s top swift community medium publication named Swift India and on their twitter handle.

Where to go from here?

Read my latest series ‘Design patterns by Tutorials — The power of OOP’

Part-1: Faceted and Fluent Builder pattern in Swift
Part-2: Singleton Design Pattern in Swift

Read my top-rated series ‘Protocol — The power of Swift’

Part-1: What are type-casting and class-types?
Part-2: Conforming a protocol
Part-3: Protocol composition
Part-4: My rule of thumb for possible data types
Part-5: Protocol as a super-type

Find my repositories on Github
Read my blogs on Medium
Connect me via LinkedIn
Follow me on Twitter

Be my patron

More challenges coming soon…

Liked this article?
Give claps and show your support, Follow my profile
Stay tuned, @hitendrahckr is typing

--

--

Hitendra Solanki
Swift India

Software Engineer, {Self-taught Developer by passion, Quick Learner, Mentor, blogger, TeamLead} GitHub: https://github.com/hitendradeveloper