Skip to content

nceruchalu/gravvy-ios

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gravvy

About Gravvy

Author Nnoduka Eruchalu
Date 05/09/2014
Website http://gravvy.nnoduka.com

Software Description

3rd-party Objective-C Modules

Other Libraries

Working with Git Submodules

  • All submodules can be found in the ThirdParty/ directory
  • Clone this project with: git clone --recursive <git repo>
  • Update submodules with git submodule update --remote <Module-Name>

Core Data Design Decisions

Denormalization

Goal is to avoid unnecessary joins (i.e. performance optimization) So the idea here is to store relationship meta information on source such as:

  • count
  • existence
  • aggregate values

This drove the decision to have an unreadMessageCount attribute on the BBTContactConversation NSManagedObject.

Normalization

Goal is to prevent duplication of data. So the idea here is to separate unlike things hence the two NSManagedObjects: GRVVideo and GRVClip linked with the following relationships

  • clip.video <<--> video.clips
  • clip.videoUsingAsLeadClip <--> video.leadClip

Fetch Batch Size

  • On an iPhone only 10 rows are visible
  • So doesn't make sense to fetch every possible object
  • Hence chose to use a fetch batch size of 20

Relationship faulting

  • There are some cases where the master table shows related data, so need the related data now.
  • In these cases prefetch to avoid faulting individually ** so for videos TVC use [request setRelationshipKeypathsForPrefetching: @["owner"]]

Core Data Migration

Lightweight migrations are relatively easy and can be peformed with some simple steps

  • Select Gravvy.xcdatamodeld in Xcode
  • From the menu select Editor > Add Model Version...
  • Leave the version name as is and then click Finish.
  • Select Gravvy.xcdatamodeld again (not Gravvy.xcdatamodel, that's the old version) and this time in the File inspector (View > Utilities > Show File Inspector)
  • In the Model Version section, select the new version name for Current.
  • You should now see a little green circle with a white checkmark badge on the new model version in the Project Navigator (View > Navigators > Show Project Navigator).

Compiling

KeychainItemWrapper

Since the project uses ARC and the KeychainItemWrapper class is not ARC compliant you have to inform the compiler that this class is not an ARC compliant class. You can do this by selecting your target and select the Build Phases tab and add the -fno-objc-arc compiler flag.