Skip to content

shles/iOSDevelopmentGuides

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 

Repository files navigation

iOS Development Guides

Library of useful links, tips and hacks that I use.

Guides

Certificates

Push certificates

Create

Create push certificate guide

Convert to .pem

openssl pkcs12 -in pushcert.p12 -out pushcert.pem -nodes -clcerts

Sources

Add custom fonts

Apple guide

Theory

GCD vs NSOperation

  • GCD is a lightweight way to represent units of work that are going to be executed concurrently. You don’t schedule these units of work; the system takes care of scheduling for you. Adding dependency among blocks can be a headache. Canceling or suspending a block creates extra work for you as a developer!

  • Operation adds a little extra overhead compared to GCD, but you can add dependency among various operations and re-use, cancel or suspend them.

Stop block execution using GCD
Objective-C (iOS 8.0+)
dispatch_block_t work = dispatch_block_create(0, ^{
  NSLog(@"Hello.");
});
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(10 * NSEC_PER_SEC)), dispatch_get_main_queue(), work);

dispatch_block_cancel(work)

ARC

classes and blocks are involved in ARC(Automatic refernce counter).

ARC counts only strong refernces to the object insntances and deallocates it, when count become zero.

By default all references are strong

var a: A = A()

To prevent counting you can use weak or unowned references

Memory

Class references stay in Run Time Stack (RTS) and their instances stay in Heap area of Memory.

About

Library of useful links, tips and hacks that I use

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published