DSL in Objective C

Reference

1. Domain Specific Languages by Martin Fowler
2. Writing Less Code
3. Domain Specific Languages: Objective-C, Ruby and Java (and Groovy)
4. UITableViewDSL
5. expecta
6. Masonry
7. Fluent Interface

144 total views, 52 views today

Posted in iOS Tagged with: , , , , , , ,

UIWindow in iOS

In this article, I ‘ll share what I know about UIWindow

keyWindow

An app can have many UIWindow. The key window is the one that is designated to receive keyboard and other non-touch related events. Only one window at a time may be the key window.

You call makeKeyAndVisible or makeKeyWindow to make a UIWindow become the keyWindow. Note that UIWindow is hidden by default, so makeKeyAndVisible both makes a UIWindow become keyWindow and set its hidden property to NO

Read more ›

216 total views, 32 views today

Posted in iOS Tagged with: , , ,

AFNetworking gotcha

Hi, in this AFNetworking gotcha series, I’ll share something I learn about AFNetworking and remind you of some properties you may overlook

AFHTTPRequestOperation is an NSOperation

Take a look at AFURLConnectionOperation.m and its overridden “start” method, you ‘ll learn how AFNetworking starts an NSURLConnection. The same holds true for NSURLSession

Read more ›

200 total views, 48 views today

Posted in iOS Tagged with: , ,

Some good iOS questions

Here is the list of some good iOS questions on Stackoverflow. Most of the questions I list here are about the language Objective C. All in my opinion :) . Actually, I prefer the “Why” questions

Questions

1. What’s the meaning of Base SDK, iOS deployment target, Target, and Project in xcode
2. const char* and char const* – are they the same?
3. Objective-C static, extern, public variables
4. UIView frame, bounds and center
5. What’s the difference between a string constant and a string literal?] Read more ›

308 total views, 16 views today

Posted in iOS Tagged with: , , , , ,

How to create Xcode plugin

I list here some good references that teach how to build your own Xcode plugin. The best way to build an Xcode plugin is to learn from some with the same functionalities

Read more ›

296 total views, 8 views today

Posted in iOS Tagged with: , , ,

Android XML drawables Tips – Part 4: LayerDrawable

In this post series, I will share some cases I used Android drawable in more efficient ways. They can help your code looks cleaner, separating Java vs. XML, or can even reduce the complexity of your View hierachy.

Types of Drawable I will be writing about in this series are: LevelList / Bitmap / StateList / Layer / Clip Drawable

Read more ›

520 total views, 28 views today

Posted in Android

Handle reachability in iOS

Here are what I learn about reachability handling in iOS, aka checking for internet connection. Hope you will find it useful, too

The naive way

Some API you already know in UIKit can be used for checking internet connection. Most of them a synchronous code, so you ‘d better call them in a background thread

Read more ›

432 total views, 32 views today

Posted in iOS Tagged with: ,

Design Pattern in iOS

When talking about design pattern, I very much like this saying

Separating what changes from what stays the same

Normally, I tend to think of software engineer as world creator, and classes are citizen. You should assign each person small and specific tasks, don’t let him do too much. Make him loosely coupled with others. Also, when you create another world, you should be able to call the experienced citizen (code resuse)

Read more ›

576 total views, 148 views today

Posted in iOS Tagged with: ,

Android XML drawables Tips – Part 3: StateListDrawable

In this post series, I will share some cases I used Android drawable in more efficient ways. They can help your code looks cleaner, separating Java vs. XML, or can even reduce the complexity of your View hierachy.

Types of Drawable I will be writing about in this series are: LevelList / Bitmap / StateList / Layer / Clip Drawable

Read more ›

600 total views, 12 views today

Posted in Android

Make tutorial screen with UIScrollView and Autolayout

Hi, in this tutorial, I will show you some code that creates a tutorial screen. This is achieved using UIScrollView and Autolayout. I use Masonry as it provides SDL syntax

There are basically 2 approaches to deal with UIScrollView contentSize, and I choose the contentView approach

Read more ›

396 total views, 12 views today

Posted in iOS Tagged with: , , , , ,