hyperoslo/Sugar is a Mobile project on GitHub, written primarily in Swift. It has 1.1k stars. :coffee: Something sweet that goes great with your Cocoa
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
Get the actual pixel information of the device screen.
Simulator
if !Simulator.isRunning {
// add device specific operations here
}
To easily exclude operations from when you as a developer runs the application in the simulator,
not subscribing to push notification or running analytics operations etc.
Keyboard Observer
Observe keyboard showing and hiding events, and handle it
let handler = BasicKeyboardHandler()
handler.show = { [weak self] height in
// move text fields up
}
handler.hide = { [weak self] in
// move text fields back to original position
}
keyboardObserver = KeyboardObserver(handler: handler)
if date1 < date2 {
// do something
} else if date1 >= date2 {
// do something else
}
Construct
let _ = 5.day
let _ = 3.week
Frame
let view = UIView()
view.width = 200
view.height = 200
view.x = 25
view.y = 25
print(view.width) // prints 200
print(view.height) // prints 200
print(view.x) // prints 25
print(view.y) // prints 25
Grand Central Dispatch
dispatch {
// dispatch in main queue
}
dispatch(queue: .Background) {
// dispatch in background queue
}
lazy var serialQueue = dispatch_queue_create("serialQueue", DISPATCH_QUEUE_SERIAL)
dispatch(queue: .Custom(serialQueue)) {
// dispatch in a serial queue
}
Easy dispatching with grand central dispatch.
Support all the regular global queues: Main, Interactive, Initiated, Utility, Background.
And .Custom() for your own dispatch queues.
Localization
let string = localizedString("My Profile")
let formattedString = localizedString(key: "%d numbers", arguments: 10)
Swift access (pun intended) to NSLocalizedString, you will get more valid auto completion
with this one, we promise.
Once
let once = Once()
once.run {
// do something
}
once.run {
// no effect
}
Operators
var url = NSURL(string: "hyper.no")!
url ?= NSURL(string: "\\/http")
// url is equal to hyper.no
The ?= only assigns values if the right is not nil.
Range
let acceptable = 200..<300
if acceptable.contains(response.statusCode) {
// Status code is between 200 and 299.
}
Regex
if "[email protected]".isEmail() {
// Is email
}
let stringNumber = "1984"
if stringNumber.isNumber() {
// Is a number
}
if stringNumber.matches("^[0-9]+$") {
// Is a number
}
TopGit's metadata for hyperoslo/Sugar does not record a license. Most public repositories on GitHub ARE open source, but the exact terms vary — verify by opening the LICENSE file directly.
What else is in the Mobile space?
hyperoslo/Sugar is tracked by TopGit under the Mobile category, alongside 4 GitHub-tagged topics. Trending and Topics pages list peer repositories of comparable stars and language.
What is hyperoslo/Sugar?
hyperoslo/Sugar (hyperoslo/Sugar) is a Swift project on GitHub. From the project's own README: :coffee: Something sweet that goes great with your Cocoa
Where can I see hyperoslo/Sugar in action?
The project maintains a homepage at https://github.com/hyperoslo. The README tab on this page also usually contains screenshots and a quickstart.
Where do I read more about hyperoslo/Sugar?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/hyperoslo/Sugar is the definitive source.
Why is hyperoslo/Sugar categorized under Mobile?
TopGit places hyperoslo/Sugar in the Mobile category based on its GitHub topics and description (tagged: "ios", "sugar", "sweet"). Categories are assigned from real repository metadata, not editorial guesswork.
Read full README in the tab above.
Want a second opinion on Sugar?
Ask an AI that can read this page — one click and you get its take on Sugar.