Skip to content

seorenn/SRChoco

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SRChoco

Carthage compatible

Seorenn's Something Special(?) Frameworks for Cocoa(AppKit) and Cocoa Touch(UIKit).

NOTE: I will separate some modules to independent project. SRChoco now refactoring. ;-)

SRExternalApp

Helper Module for External Application

TODO: Need more documentation

SRRegexp

Regular Expression Modules (likely Python's RE module)

TODO: Need more documentation

SRUUID

Simple Class to generate the UUID.

TODO: Need more documentation

SRStartupLauncher

Implementations of 'Launch at Login'.

TODO

Utilities

Some utility classes and extensions for more conveniences...

DateExtensions

let now = Date()
let date = now.dateComponents!
println("\(date.year) - \(date.month) - \(date.day), \(date.hour):\(date.minute):\(date.second)")

let generatedDate = NSDate.generate(year:2014, month:10, day:24, hour:12, minute:25, second:59)!

if date == generatedDate {
    println("date is same with generatedDate")
} else if date > generatedDate {
    println("date is later than generatedDate")
} else {
    println("date is earlier than generatedDate")
}

ArrayExtensions

// Join String Array
let inputArray = [ "This", "is", "test" ]
let outputString = inputArray.stringByJoining(" ")   // "This is test"

StringExtensions

// Subscript String
let string = "123 ABC abc-"
println(str[0])      // Character("1")
println(str[1])      // Character("2")
println(str[-1])     // Character("-")
println(str[-2])     // Character("c")

// Substring
let substring = string[1...3]      // "23 "

// Trim
let trimmedString = string.trimmedString()

// Check Containing
if string.containString("ABC") {
    // ...
}

// Split
"This is test".arrayBySpliting()    // [ "This", "is", "test" ]
"1,2,3".arrayBySpliting(",")        // [ "1", "2", "3" ]

ViewExtensions

let view = UIView()
view.x
view.y
view.width
view.height
view.origin         // CGPoint or NSPoint
view.size           // CGSize of NSSize
view.conterPoint    // CGPoint or NSPoint
view.moveToBelow(view: anotherView, margin: 5.0)

URLExtensions

Something useful features for file URL.

let myDownloadedFile = URL.urlForDownloads + "filename.txt"
myDownloadedFile.isExists
myDownloadedFile.isFile
myDownloadedFile.isDirectory
_ = trash(url: myDownloadedFile)

Branched Projects

About

Seorenn's Development Libraries for OS X and iOS

Resources

License

Stars

Watchers

Forks

Packages

No packages published