ankurp / cent Goto Github PK
View Code? Open in Web Editor NEWExtensions for Swift Standard Types and Classes
Home Page: https://www.dollarswift.org#cent-usage
License: MIT License
Extensions for Swift Standard Types and Classes
Home Page: https://www.dollarswift.org#cent-usage
License: MIT License
let nutrient = "vitaminB3"
print(nutrient.startCase)
// prints "Vitamin 3", but I expected "Vitamin B3"
A similar thing happens for snakeCase
. I've gone and inspected Cent's internal .words()
function, and it seems to be the culprit, since the array would be ["vitamin", "3"]
instead of ["vitamin", "B3"]
When compiling w/ XCode7.3.1 we get these warnings:
/Users/jaz/Projects/xxx/Pods/Cent/Sources/Int.swift:107:23: '--' is deprecated: it will be removed in Swift 3
/Users/jaz/Projects/xxx/Pods/Cent/Sources/Int.swift:119:30: '--' is deprecated: it will be removed in Swift 3
/Users/jaz/Projects/xxx/Pods/Cent/Sources/Regex.swift:50:40: '++' is deprecated: it will be removed in Swift 3
/Users/jaz/Projects/xxx/Pods/Cent/Sources/Regex.swift:54:36: '++' is deprecated: it will be removed in Swift 3
/Users/jaz/Projects/xxx/Pods/Cent/Sources/String.swift:82:40: 'init(start:end:)' is deprecated: it will be removed in Swift 3. Use the '..<' operator.
It is not possible to include Cent
in a Carthage project, and trying to results in the following error:
*** Checking out Cent at "6.0.4"
Parse error: expected submodule commit SHA in output of task (ls-tree -z 6.0.4 Dollar) but encountered:
Attempted using the latest [email protected]
& [email protected]
.
What about the Xcod8 beta and Swift3 Support?
/Pods/Cent/Sources/String.swift:82:16: Value of type 'String' has no member 'substringWithRange'
/Pods/Cent/Sources/String.swift:134:16: Value of type 'String' has no member 'stringByTrimmingCharactersInSet'
...
Let's implement something like:
extension Array {
mutating func moveItem(at oldIndex: Int, to newIndex: Int) {
self.insert(self.remove(at: oldIndex), at: newIndex)
}
}
public func upTo(limit: Int, callback: @escaping (Void) -> Void) {
(self...limit).forEach { _ in
callback(<#Void#>)
}
}public func downTo(limit: Int, callback: (Void) -> Void) {
var selfCopy = self
while selfCopy >= limit {
callback()
selfCopy -= 1
}
}
public func times(function: @escaping (Void) -> Void) {
self.times { (index: Int) -> Void in
function(<#Void#>)
}
}
error
Missing argument for parameter #1 in call
int.swift file
Pods/Cent/Sources/Int.swift:95:22: Editor placeholder in source file
Some of the function do not need the result value. So could you please modify them to use@discardableResult
?
When to adapt swift 4.0?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.