Tag Archives: Cocoa

Scipio: Download & build Cocoa frameworks


via mikekreuzer/Scipio · GitHub.

Scipio scripts the download & build of Cocoa frameworks. Scipio’s offered as an alternative to Carthage and CocoaPods. Scipio uses the same sort of Cartfiles as Carthage and the basic workflow is the same:

  1. Install Scipio
  2. Create a Cartfile that lists the frameworks you’d like to use (ie it’s a distributed system)
  3. Type scipio and Scipio will fetch and build each framework you’ve listed
  4. Drag the framework binaries into your application’s Xcode project

NSAttributedString in Swift


via iOS Development | NSAttributedString iOS Swift.

I have been talking quite a lot in the past about how to customize text in your app to improve the UI of your applications. Before iOS 6, Core Text was the only available option for developers. Although a great framework, Core Text is not a very straightforward tool to use. You can check our Core Text tutorial in Objective-C here. In iOS 6, Apple introduced NSAttributedString. You can check a couple of posts about this topic here and here.

Core Text still remains the way to go for some specific cases that we will see later but NSAttributedString brings less hassle so, if possible, you should adopt it as a your first option. Then, on early June 2014, Apple introduced Swift. In this tutorial, we will build a project using Swift and NSAttributedString.

First, let me tell you more about some Cocoa classes that give you easy access to text customization.NSAttributedString allows you to customize the text attributes of UILabel, UIButton, UIPickerView, andUITableViewCell.

CoreData Batch Updates in Swift


via iOS Development | CoreData Batch Updates iOS Swift.

Core Data, one of the most important Cocoa frameworks, received new interesting functionalities in iOS 8 and OS X 10.10.

Today, I am going to show you how to perform batch updates of the data contained in the Persistent Store. This will allow you to modify one or more properties of your entities with no need of loading the data into the Managed Object Context. Instead, batch updates are directly performed in the Persistent Store.

Until iOS 7, if you wanted to perform an update of a property of a set of managed objects, you had to execute three tasks: fetch, update and save. So, you have to perform a fetch request to bring the objects from the Persistent Store into the Managed Object Context. After that, you had to touch every managed object and update the properties with the new values. Finally, you had to save the results back into the Persistent Store.

This is quite straightforward to implement. However, in real applications the update of a large number of objects requires quite long processing time. Of course, you can use multiple contexts and thread confinement, but you really should know what to do, otherwise it is easy to mess with the main thread, blocking it and make the UI unresponsive.

Objective-C and Xcode Build Phase


via Objective C and Xcode Build Phase….

Welcome to my first posts about iOS development. I am Kru and I am an iOS developer by profession and a hacker by heart.

I have recently decided to start creating a journal about what I learn everyday in context of software development. I don’t consider my self perfect, hence everyday I try to learn more and improve my self. I hope looking back to these post after few years, I will see the difference in my self and skills.

Sharing my learning journey (Learny) will allow me to get criticism from peers and more importantly I may be able to answer questions other software developer might have.

Today, I would like to start writing about Objective C language. I will write about what I understand about the language and the process it goes through during Cocoa and Cocoa Touch project build phases.

iOS Debugging Magic


via Technical Note TN2239: iOS Debugging Magic.

iOS contains a number of ‘secret’ debugging facilities, including environment variables, preferences, routines callable from GDB, and so on. This technote describes these facilities. If you’re developing for iOS, you should look through this list to see if you’re missing out on something that will make your life easier.

SETTING UP JENKINS CI ON A MAC


via Setting up Jenkins CI on a Mac | Cocoa Is My Girlfriend.

Setting up a CI server can be nothing but pain and suffering, yet many of us take on this challenge to save time in the long run. Some things I would rather do than set up a CI server:

  1. Get a root canal at my desk waiting for Xcode SourceKit crashes to calm down.
  2. Submit an Apple Radar for one of my many Xcode crashes.
  3. Write a tutorial on how to set up a Jenkins CI server. (Oh hey!)

Whether you’re being a good developer and doing your unit testing, are tired of co-workers breaking your code, or have clients that can’t live without the latest and greatest build, CI will be your new best friend and butler.

There are tons of posts floating around the internet with bits and pieces on this topic; but none were comprehensive enough for me to get a server up and running. Because of this, I decided to write a thorough guide that will walk you through setting up a Jenkins CI Server on your machine of choice. In this instance we used a Mac Mini.

Note that our end goal with Jenkins was to build, test, and distribute apps for both the iOS and Android platforms. Some of the setup in this guide is aimed at accomplishing this goal.

An introduction to Swift for Ruby Developers


via An introduction to Swift for Ruby Developers — /aidanf/.

If you want to learn to develop apps for iOS and OS X there are a number of bottlenecks that you need to overcome.

  1. Learn how to program.
  2. Learn a language for developing on the Apple ecosystem, generally Swift or Objective-C.
  3. Learn the development tools: Xcode etc.
  4. Learn the Cocoa APIs.

If you already know how to program in Ruby, then you’ve already overcome the first bottleneck.

But if Ruby is your main programming language, then bottleneck number 2 has up to now been a significant hurdle.

Thus in recent years there have been several tools that allow you to develop iOS applications without having to learn Objective-C (e.g. Titanium, PhoneGap, rubymotion,Xamarin)

For Rubyists who are accustomed to the benefits and comforts that come with programming in Ruby, Objective-C is not a particularly pleasant language to program in and the learning-curve can be quite steep. But that has changed significantly with the recent release of Swift.

The jump from Ruby to Swift is much smaller than the jump from ruby to Objective-C. If you like Ruby, you’ll probably find that a lot to like about Swift.

In this article I’ll outline a number of interesting feature