why we should do prevent to make singleton instances in ios, swift -


can please explain reason prevent instance in singleton.

i saw says below

private override init (){  } 

but works fine if or not.

i'm not sure mean question, if you're asking why initialiser private comes definition of singleton design pattern. initialiser needs private make sure nobody can crate instance of singleton.


Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -