Skip to content

mpurland/Swiftly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Swiftly

Collection of learnings and utilities in Swift.

Localization

Example for localizaing strings easier.

var localizedHelloWorld = "Hello World".localized
localizedHelloWorld = "Hello World".localized(comment: "Title for Hello World")
localizedHelloWorld = "Hello World".localizedWithComment("Title for Hello World")

Synchronization

Example for using synchronized in Swift.

Basic synchronized

synchronized(someObj) {
	// Do something
}

Return a value from synchronized

let val: Int = synchronized(someObj) {
	return 5
}

Return a value from synchronized and use someObj as input to closure

let val: Int = synchronizedWith(someObj) {
	obj in
	// Use obj to calculate some value
	return 5
}

About

Collection of learnings and utilities in Swift.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages