iOS and Cocoa goo...
Follow
Find
148.1K views | +350 today
Scooped by jerometonnelier
onto iOS and Cocoa goodies
Scoop.it!

Open Source: Easily Customizable Rotary Pie Menu iOS Control

Open Source: Easily Customizable Rotary Pie Menu iOS Control | iOS and Cocoa goodies | Scoop.it
Some time ago I posted about a tutorial explaining the math and providing a demo project showing how to create a wheel type control on the iOS platform. Today I received the submission of an intere...
more...
No comment yet.
Anything related to iOS development, goodies, repositories, UI and tutorials
Your new post is loading...
Scooped by jerometonnelier
Scoop.it!

Implement Pull-to-refresh and Empty Table | iOS Programming

Implement Pull-to-refresh and Empty Table | iOS Programming | iOS and Cocoa goodies | Scoop.it
In this tutorial, we'll show you how to implement pull-to-refresh using UIRefreshControl and display friendly message in an empty table view.
more...
No comment yet.
Scooped by jerometonnelier
Scoop.it!

Creating a Jetpack Joyride with Unity 2D

Creating a Jetpack Joyride with Unity 2D | iOS and Cocoa goodies | Scoop.it
Learn how to create a game like Jetpack Joyride in Unity 2D in this three part tutorial series.
more...
No comment yet.
Scooped by jerometonnelier
Scoop.it!

An Xcode Plugin That Allows You To Easily Add Import Statements From Anywhere In Your Code

I've mentioned a number of nice time-saving Xcode plugins which you can find on the Xcode plugin list. Here's an Xcode plugin submitted by Marko Hlebar that makes for a fantastic timesaver allowing...
more...
No comment yet.
Scooped by jerometonnelier
Scoop.it!

Open Source iOS Library Providing A Blocks Driven Syntax For Working With SQLite Databases

Some time ago I mentioned the long time popular FMDB library working with SQLite databases, and iActiveRecord which provides an active record based library for working with SQLite. Here's a newer l...
more...
No comment yet.
Scooped by jerometonnelier
Scoop.it!

Tool: Xcode Plugin For Quickly Creating Localized Strings

Some time ago I mentioned an Xcode plugin for working on your localized strings called Lin. Here's a newer Xcode plugin  allowing you to very quickly take a string and turn it into a NSLo...
more...
No comment yet.
Scooped by jerometonnelier
Scoop.it!

Tutorial: Avoiding Issues When Moving From Objective-C To Swift

Last week I mentioned a nice tutorial on creating a simple Candy Crush style game with Swift and Sprite Kit. Here's a tutorial from Yari D'areglia aimed to help Objective-C developers avoid issues ...
more...
No comment yet.
Scooped by jerometonnelier
Scoop.it!

Open Source Library Providing A Core Data Query Language For Swift

I've mentioned a number of libraries for working with Core Data, the most popular of which being Magical Record. Here's an open source Swift based library providing a very nice syntax for querying ...
more...
No comment yet.
Scooped by jerometonnelier
Scoop.it!

Open Source Swift Library Allowing You To Create Complex Auto Layout Layouts from Code

Previously I mentioned the FLKLAutoLayout that allows you to easily create complex auto layouts from code. Here's an auto layout helper library created in Swift from Robert Böhnke inspired by FLKAu...
more...
No comment yet.
Scooped by jerometonnelier
Scoop.it!

Recreating Skype's Action Sheet Animation · Arkadiusz Holko

Recreating Skype's Action Sheet Animation · Arkadiusz Holko | iOS and Cocoa goodies | Scoop.it
more...
No comment yet.
Scooped by jerometonnelier
Scoop.it!

• Singletons in Swift In this post, I will to...

• Singletons in Swift In this post, I will to... | iOS and Cocoa goodies | Scoop.it
Singletons in Swift



In this post, I will to demonstrate one particular way of creating singletons in Swift. But, before starting, let me just say: Swift is a very powerful programming language that allows developers to construct the same functionality in multiple ways. Therefore, the following example is just one way of building a singleton in Swift.



Generally, I discourage the use of singletons, as instantiating an object that will last forever is not good design. Instead, I prefer letting ARC do the memory management and letting ARC decide when to release an object or keep it alive. Additionally, there’s always an alternative way to build what you are trying to do with a singleton.




Nonetheless, despite my recommendations, I will demonstrate a way of building a singleton or a shared object in Swift, just in case you absolutely need one.



Let’s suppose that you need a shared instance of a class Monitor to continuously monitor the status of a running algorithm in your application. The Monitor class will be a subclass of NSObject and you want to instantiate this class only once. Here’s how to build this class in Swift:



import Foundation
class Monitor : NSObject {

class func sharedMonitor() -> Monitor {
return _sharedMonitor
}

}
var _sharedMonitor: Monitor = { Monitor() }()




In the above source code, first, I imported the Foundation module to be able to subclass NSObject. Then, I created a class Monitor subclassing NSObject. The class contains a class function sharedMonitor. This function doesn’t take any input arguments and returns a class type Monitor. The _sharedMonitor variable is defined as a global variable and I initialized it to a closure that simply instantiated the Monitor class.



But, how can you use it? Well, suppose you need to reference this singleton from another object. You can write:



let monitor = Monitor.sharedMonitor()




Now, let’s build a small example. Using Xcode 6 (currently in beta), create a Single View Application and name the project Singleton. Choose Swift as the programming language and save the project wherever you like. Then, add a new class to the project. Choose iOS -> Source -> Cocoa Touch Class. Name the class Monitor and make it a subclass of NSObject. Choose Swift as the language and save the class.



Next, open the Monitor.swift file and modify it as I previously described:



import Foundation

class Monitor: NSObject {

class func sharedMonitor() -> Monitor {
return _sharedMonitor
}

}
var _sharedMonitor : Monitor = { Monitor() }()




Then, open the ViewController.swift file and in the -viewDidLoad method create two constants of type Monitor and check that they are identical:



let monitor1 = Monitor.sharedMonitor()
let monitor2 = Monitor.sharedMonitor()

if monitor1 === monitor2 {
println(
more...
No comment yet.
Scooped by jerometonnelier
Scoop.it!

Open Source Component For A Customizable Keyboard Text Suggestion Bar With Morphing Animations

Previously I've mentioned a few libraries allowing you to enhance the iOS keyboard with a suggestion bar, most recently JustType that adds a suggestion bar and a number of other enhancements, and A...
more...
No comment yet.
Scooped by jerometonnelier
Scoop.it!

Introducing the raywenderlich.com Swift Style Guide | Ray Wenderlich

Introducing the raywenderlich.com Swift Style Guide | Ray Wenderlich | iOS and Cocoa goodies | Scoop.it
Check out the first draft of our official Swift style guide - and submit your comments!
more...
No comment yet.
Scooped by jerometonnelier
Scoop.it!

Open Source iOS Component For Buttons With A Neat Ripple Animation On Press

A couple of months ago I mentioned a nice open source library allowing you to create round and square buttons that have a nice 3d animation effect when pressed. Here's an open source component allo...
more...
No comment yet.
Scooped by jerometonnelier
Scoop.it!

NSCalendarUnitYear

NSHipster.com was launched 2 years ago to the day. Each week since has featured a new article on some obscure topic in Objective-C or Cocoa (with only a couple gaps). Let's celebrate with some cake.
more...
No comment yet.
Scooped by jerometonnelier
Scoop.it!

Core Data from Scratch: Relationships and More Fetching - Tuts+ Code Tutorial

Core Data from Scratch: Relationships and More Fetching - Tuts+ Code Tutorial | iOS and Cocoa goodies | Scoop.it
In the previous article, we learned about NSManagedObject and how easy it is to create, read, update, and delete records using Core Data. However, I didn't mention relationships in that discussion. Aside from a few caveats you need to be aware of, relationships are just as easy to manipulate as attributes. In this article, we will focus on relationships and we'll also continue our exploration of NSFetchRequest. | Difficulty: Intermediate; Length: Medium; Tags: Mobile Development, iOS SDK, Core Data, Xcode
more...
No comment yet.
Scooped by jerometonnelier
Scoop.it!

Example: Full Featured Chat App With A Great Interface Using Parse For The Backend

We've mentioned a number of nice chat example apps in the past few months most recently an example from Related Code showing how to create a chat app using Firebase for the backend and an &nbs...
more...
No comment yet.
Scooped by jerometonnelier
Scoop.it!

A Twitter Inspired Open Source iOS Paging Control With Titles In The Navigation Bar

I've mentioned a number of custom paging controls in the past the most popular being this control with slick paperfold transitions. Here's an open source paging controller inspired by the Twitter a...
more...
No comment yet.
Scooped by jerometonnelier
Scoop.it!

From Objective-C to Swift: thoughts and hints - Think & Build

Tutorials about OS X, iOS and web development!
more...
No comment yet.
Scooped by jerometonnelier
Scoop.it!

UIViewController-ScrollingStatusBar for iOS - Cocoa Controls

UIViewController-ScrollingStatusBar for iOS - Cocoa Controls | iOS and Cocoa goodies | Scoop.it
more...
No comment yet.
Scooped by jerometonnelier
Scoop.it!

Tutorial: How To Use The JSONModel Library For Easily Handling JSON Data

Tutorial: How To Use The JSONModel Library For Easily Handling JSON Data | iOS and Cocoa goodies | Scoop.it
Previously I mentioned the excellent JSONModel library providing a number of nice features working with JSON data most notably that makes it easy to convert JSON data to Objective-C objects. Here's...
more...
No comment yet.
Scooped by jerometonnelier
Scoop.it!

Open Source iOS Library Allowing You To Easily Create Real-Time Asynchronous Blurring Effects

Since iOS 7 brought blurring effects into the forefront we've mentioned a number of libraries for creating blurring effects most recently ANBlurredImageView allowing you to apply an animated tintab...
more...
No comment yet.
Scooped by jerometonnelier
Scoop.it!

Open Source iOS Component For Creating Draggable Card Style Alert Views

Late last year I mentioned a nice library for creating custom alert views that are styled similar to the native iOS alert views, but adding in nice features such as support for images, and extra bu...
more...
No comment yet.
Scooped by jerometonnelier
Scoop.it!

Open Source Library For Easy and Clean Asynchronous Flow Control In Swift

About a year and a half ago I mentioned a library for asynchronous flow control in Objetive-C called Sequencer. Sequencer definitely helps to make your asynchronous code more readable and clean. He...
more...
No comment yet.
Scooped by jerometonnelier
Scoop.it!

Tutorial: Creating A Candy Crush Style Game In Swift With Sprite Kit

Tutorial: Creating A Candy Crush Style Game In Swift With Sprite Kit | iOS and Cocoa goodies | Scoop.it
Apple has done an excellent job with the documenting the Swift programming language and I've been asked a couple of times about tutorials and so far by the best are on Apple's own Swift Progra...
more...
No comment yet.
Scooped by jerometonnelier
Scoop.it!

Open Source iOS Library For Easily Creating Local Notifications At Specific Time Intervals

Last month I mentioned a nice open source library allowing you to automatically present users with notes after updates. Here's another library that provides a nice way to communicate with users all...
more...
No comment yet.