![]() ![]() In Main.storyboard, delete the default ViewController scene. With our subclass created, we now have to customize the Storyboard to utilize it. Be sure to leave the checkbox for “Also create XIB file” unchecked and the Language as Objective-C. Go to File → New → File then click “Cocoa Touch Class.” In the resulting dialog, set the name to “MainGridController” and the subclass to UICollectionViewController (we will update the subclass to the grid controller later). Now that we have our base project setup, we need to first create a subclass of ABFRealmGridController to allow us to customize its display. When it’s done, you’ll need to close the Xcode window and open the xcworkspace file that CocoaPods created, so that you can use the classes inside the pods. This will also install Realm Swift automatically! (If this is your first time using CocoaPods, this could take a while. # Pre-built data model for New York Times Top Stories API pod 'RealmNYTStories' # Image loading/caching library pod 'Haneke' # Easy UIViewController to display website pod 'TOWebViewController' To install ABFRealmGridController, simply add the following lines to the Podfile you just created: (If you don’t have CocoaPods installed, follow their instructions before continuing.) In your terminal, cd to the project folder you just created, and open the Podfile (if you don’t have a podfile, perform pod init in the folder first). Be sure “Language” is set to Objective-C, and that “Use Core Data” is unchecked.ĪBFRealmGridController is available through CocoaPods. TutorialĬreate a new Xcode project, using the “Single View Application” template. If you’re looking for a Swift version, you can check out the tutorial for RealmGridController, which has an identical API. Let’s get started, but if you want to jump to the end product, you can see the final code on GitHub here. ![]() This tutorial is going to show you how you can use ABFRealmGridController, a specialized subclass of UICollectionViewController, to bind to your data in Realm. Best of all, changes to your data will trigger automatic animations! ![]() With your data stored in Realm, you can create an interface like this really quickly. Looking to build a grid layout in your app? ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |