Trên GitHub, Juanpe/Counter đã đạt 53 sao, nhóm Mobile, ngôn ngữ Swift. Counter is powerful and multipurpose counter
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
If you prefer, you can integrate Counter into your project manually. Simply add the Counter.swift source file directly into your project.
🐒 How to use
Import Counter in proper place.
import Counter
Now, you only need to create a Counter instance and start to play 🙂
let counter = Counter() // 0
counter.increment() // 1
You can specify how many units you want increment the counter
counter.increment(2) // 3
Also you can decrement the count
counter.decrement() // 2
And of course you can reset the counter
counter.reset() // 0
Other powerful feature is that you can sum various values at the same time
counter.sum(countables: 2, 3, -1) // 4
🤓 Advanced
Can use your own objects to increment the counter. Only need implement Countable protocol:
protocol Countable {
var deltaValue: Int { get }
}
Example:
struct Person {
var age: Int
}
extension Person: Countable{
var deltaValue: Int {
return self.age
}
}
let dad = Person(age: 45)
let mum = Person(age: 40)
let son = Person(age: 25)
let ageCounter = Counter()
ageCounter.increment(dad)
ageCounter.increment(mum)
ageCounter.increment(son)
print(ageCounter.currentValue) // 110
// Also you can use `sum` method or static method
ageCounter.sum(countables:dad, mum, son) // 110
let ages = Counter.sum(countables:dad, mum, son) // 110
🔔 Milestones
Sometimes you need to know when a counter has reached or will reach a value. With Counter will be a piece of cake.
You only need to add milestones and conform to CounterDelegate protocol. Then, your counter will notify you before reaching and when it reaches each previously defined milestone.
This is an open source project, so feel free to contribute. How?
Open an issue.
Send feedback via email.
Propose your own fixes, suggestions and open a pull request with the changes.
See all contributors
👨🏻💻 Author
Juanpe Catalán
👮🏻 License
MIT License
Copyright (c) 2017 Juanpe Catalán
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/Juanpe/Counter là nguồn chính thức.
Juanpe/Counter có bao nhiêu sao?
Juanpe/Counter có 53 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/Juanpe/Counter. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
Juanpe/Counter có phải mã nguồn mở không?
Có — Juanpe/Counter phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/Juanpe/Counter.
Juanpe/Counter còn đang phát triển không?
Commit gần nhất trên Juanpe/Counter là 8.8 năm trước (theo timestamp GitHub). Repo có 5 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
Juanpe/Counter là gì?
Juanpe/Counter (Juanpe/Counter) là dự án Swift trên GitHub. Theo mô tả gốc: Counter is powerful and multipurpose counter
Juanpe/Counter so với các dự án Mobile khác thế nào?
Juanpe/Counter được TopGit xếp vào nhóm Mobile, với 53 sao GitHub và viết bằng Swift. Xem trang chủ đề Mobile trên TopGit để so sánh với các dự án tương tự theo số sao và mức độ hoạt động.
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về Counter?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về Counter.