Comments (3)
Do you expect to return the same text globally in the whole application for each of the methods or rather a build-in memory for keeping the strings around without the need to create variables?
from loremipsum.
Perhaps if when you instantiate a LoremIpsum
object it would provide the same strings for each invocation of paragraph
, sentence
, and so on. You could then just hold onto that single object some place. Might make sense from an API design perspective: the class methods on LoremIpsum
are randomized on each invocation and the equivalent instance methods are only randomized on instantiation of the LoremIpsum
object. Just a thought!
from loremipsum.
when you instantiate
This is exactly what I don't want to do. The LoremIpsum
should be just an in-place generator and should contain as little logic as possible. Therefore I don't like the idea of being able to instantiate objects of LoremIpsum
.
When introducing a global lock on the class, there would be a problem when attempting to use methods not intended to be locked. A lock for individual methods would be an overkill.
I have two suggestions for you:
- You could either build a category on
LoremIpsum
for your particular use case and move the code with storing the generated string there. - You can also generate the whole table structure at the beginning and store it in the view controller. Then you can use the already generated data in the
UITableViewDataSource
methods.
from loremipsum.
Related Issues (13)
- Rename LoremIpsum folder to Classes according to the CocoaPods suggestion HOT 1
- Add support for random colors in images from placehold.it
- Replace the usage of NSURLConnection by NSURLSession
- Add methods for retrieving random locations HOT 3
- Add methods for getting the image URL, not just the image itself
- Update iOS deployment target to 10.0 for Xcode 14.2+ Compatibility
- Prefix the method in NSArray category
- Add methods for retrieving random colors
- Add info about image generating to the pod spec
- Add support for offline images (e.g. filled with a single color)
- Use a table in the authors section in the read me file
- Add methods +capitalizedWord and +capitalizedWordsWithNumber:
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from loremipsum.