├── Pods ├── Pods-MagicalRecord.xcconfig ├── Headers │ ├── MagicalRecord │ │ ├── MagicalRecord.h │ │ ├── MagicalRecord+Setup.h │ │ ├── CoreData+MagicalRecord.h │ │ ├── MagicalRecord+Actions.h │ │ ├── MagicalRecord+Options.h │ │ ├── MagicalRecord+iCloud.h │ │ ├── MagicalRecordShorthand.h │ │ ├── MagicalRecord+ErrorHandling.h │ │ ├── MagicalImportFunctions.h │ │ ├── MagicalRecord+ShorthandSupport.h │ │ ├── NSPersistentStore+MagicalRecord.h │ │ ├── NSNumber+MagicalDataImport.h │ │ ├── NSObject+MagicalDataImport.h │ │ ├── NSString+MagicalDataImport.h │ │ ├── NSManagedObjectModel+MagicalRecord.h │ │ ├── NSManagedObject+MagicalFinders.h │ │ ├── NSManagedObject+MagicalRecord.h │ │ ├── NSManagedObject+MagicalDataImport.h │ │ ├── NSManagedObject+MagicalRequests.h │ │ ├── NSEntityDescription+MagicalDataImport.h │ │ ├── NSManagedObject+MagicalAggregation.h │ │ ├── NSPersistentStoreCoordinator+MagicalRecord.h │ │ ├── NSAttributeDescription+MagicalDataImport.h │ │ ├── NSManagedObjectContext+MagicalRecord.h │ │ ├── NSManagedObjectContext+MagicalSaves.h │ │ ├── NSRelationshipDescription+MagicalDataImport.h │ │ ├── NSManagedObjectContext+MagicalObserving.h │ │ └── NSManagedObjectContext+MagicalThreading.h │ ├── JSMessagesViewController │ │ ├── JSMessage.h │ │ ├── JSBubbleView.h │ │ ├── JSMessageData.h │ │ ├── JSMessageInputView.h │ │ ├── JSMessageTableView.h │ │ ├── JSMessageTextView.h │ │ ├── JSBubbleMessageCell.h │ │ ├── JSDismissiveTextView.h │ │ ├── JSMessageSoundEffect.h │ │ ├── JSAvatarImageFactory.h │ │ ├── JSMessagesViewController.h │ │ ├── NSString+JSMessagesView.h │ │ ├── UIColor+JSMessagesView.h │ │ ├── UIImage+JSMessagesView.h │ │ └── JSBubbleImageViewFactory.h │ └── JSQSystemSoundPlayer │ │ └── JSQSystemSoundPlayer.h ├── BuildHeaders │ ├── MagicalRecord │ │ ├── MagicalRecord.h │ │ ├── MagicalRecord+Setup.h │ │ ├── CoreData+MagicalRecord.h │ │ ├── MagicalRecord+Actions.h │ │ ├── MagicalRecord+Options.h │ │ ├── MagicalRecord+iCloud.h │ │ ├── MagicalRecordShorthand.h │ │ ├── MagicalRecord+ErrorHandling.h │ │ ├── MagicalImportFunctions.h │ │ ├── MagicalRecord+ShorthandSupport.h │ │ ├── NSPersistentStore+MagicalRecord.h │ │ ├── NSNumber+MagicalDataImport.h │ │ ├── NSObject+MagicalDataImport.h │ │ ├── NSString+MagicalDataImport.h │ │ ├── NSManagedObjectModel+MagicalRecord.h │ │ ├── NSManagedObject+MagicalFinders.h │ │ ├── NSManagedObject+MagicalRecord.h │ │ ├── NSManagedObject+MagicalDataImport.h │ │ ├── NSManagedObject+MagicalRequests.h │ │ ├── NSEntityDescription+MagicalDataImport.h │ │ ├── NSManagedObject+MagicalAggregation.h │ │ ├── NSPersistentStoreCoordinator+MagicalRecord.h │ │ ├── NSAttributeDescription+MagicalDataImport.h │ │ ├── NSManagedObjectContext+MagicalRecord.h │ │ ├── NSManagedObjectContext+MagicalSaves.h │ │ ├── NSRelationshipDescription+MagicalDataImport.h │ │ ├── NSManagedObjectContext+MagicalObserving.h │ │ └── NSManagedObjectContext+MagicalThreading.h │ ├── JSMessagesViewController │ │ ├── JSMessage.h │ │ ├── JSBubbleView.h │ │ ├── JSMessageData.h │ │ ├── JSMessageInputView.h │ │ ├── JSMessageTableView.h │ │ ├── JSMessageTextView.h │ │ ├── JSBubbleMessageCell.h │ │ ├── JSDismissiveTextView.h │ │ ├── JSMessageSoundEffect.h │ │ ├── JSAvatarImageFactory.h │ │ ├── JSMessagesViewController.h │ │ ├── NSString+JSMessagesView.h │ │ ├── UIColor+JSMessagesView.h │ │ ├── UIImage+JSMessagesView.h │ │ └── JSBubbleImageViewFactory.h │ └── JSQSystemSoundPlayer │ │ └── JSQSystemSoundPlayer.h ├── Pods-JSQSystemSoundPlayer.xcconfig ├── Pods-JSMessagesViewController.xcconfig ├── Pods-JSQSystemSoundPlayer-prefix.pch ├── Pods-JSMessagesViewController-prefix.pch ├── Pods-dummy.m ├── Pods-MagicalRecord-dummy.m ├── Pods-MagicalRecord-prefix.pch ├── Pods-JSQSystemSoundPlayer-dummy.m ├── Pods-JSMessagesViewController-dummy.m ├── JSMessagesViewController │ ├── JSMessagesViewController │ │ ├── Resources │ │ │ ├── Sounds │ │ │ │ ├── message-sent.aiff │ │ │ │ └── message-received.aiff │ │ │ └── Images │ │ │ │ ├── bubble-flat │ │ │ │ ├── bubble.png │ │ │ │ ├── bubble@2x.png │ │ │ │ ├── bubble-min.png │ │ │ │ ├── bubble-min@2x.png │ │ │ │ ├── bubble-stroked.png │ │ │ │ ├── bubble-stroked@2x.png │ │ │ │ ├── bubble-tailless.png │ │ │ │ ├── bubble-min-tailless.png │ │ │ │ ├── bubble-tailless@2x.png │ │ │ │ ├── bubble-min-tailless@2x.png │ │ │ │ ├── bubble-stroked-tailless.png │ │ │ │ └── bubble-stroked-tailless@2x.png │ │ │ │ ├── avatar │ │ │ │ ├── avatar-placeholder.png │ │ │ │ └── avatar-placeholder@2x.png │ │ │ │ ├── input-bar-classic │ │ │ │ ├── send-button.png │ │ │ │ ├── send-button@2x.png │ │ │ │ ├── input-field-cover.png │ │ │ │ ├── input-bar-background.png │ │ │ │ ├── input-field-cover@2x.png │ │ │ │ ├── send-button-pressed.png │ │ │ │ ├── input-bar-background@2x.png │ │ │ │ └── send-button-pressed@2x.png │ │ │ │ ├── input-bar-flat │ │ │ │ ├── button-photo.png │ │ │ │ ├── input-bar-flat.png │ │ │ │ ├── button-photo@2x.png │ │ │ │ └── input-bar-flat@2x.png │ │ │ │ ├── bubble-classic │ │ │ │ ├── bubble-classic-blue.png │ │ │ │ ├── bubble-classic-gray.png │ │ │ │ ├── bubble-classic-green.png │ │ │ │ ├── bubble-classic-typing.png │ │ │ │ ├── bubble-classic-blue@2x.png │ │ │ │ ├── bubble-classic-gray@2x.png │ │ │ │ ├── bubble-classic-green@2x.png │ │ │ │ ├── bubble-classic-selected.png │ │ │ │ ├── bubble-classic-typing@2x.png │ │ │ │ └── bubble-classic-selected@2x.png │ │ │ │ └── bubble-classic-square │ │ │ │ ├── bubble-classic-square-blue.png │ │ │ │ ├── bubble-classic-square-gray.png │ │ │ │ ├── bubble-classic-square-blue@2x.png │ │ │ │ ├── bubble-classic-square-gray@2x.png │ │ │ │ ├── bubble-classic-square-selected.png │ │ │ │ └── bubble-classic-square-selected@2x.png │ │ └── Classes │ │ │ ├── JSMessageTableView.m │ │ │ ├── JSMessageTableView.h │ │ │ ├── Categories │ │ │ ├── NSString+JSMessagesView.m │ │ │ ├── NSString+JSMessagesView.h │ │ │ ├── UIColor+JSMessagesView.h │ │ │ ├── UIImage+JSMessagesView.h │ │ │ └── UIColor+JSMessagesView.m │ │ │ ├── JSMessageData.h │ │ │ ├── JSMessageSoundEffect.h │ │ │ ├── JSMessageSoundEffect.m │ │ │ ├── Factories │ │ │ ├── JSAvatarImageFactory.m │ │ │ ├── JSBubbleImageViewFactory.h │ │ │ └── JSAvatarImageFactory.h │ │ │ ├── JSMessage.h │ │ │ ├── JSMessage.m │ │ │ ├── JSMessageTextView.h │ │ │ ├── JSDismissiveTextView.h │ │ │ ├── JSBubbleView.h │ │ │ └── JSMessageInputView.h │ └── LICENSE.txt ├── Pods-MagicalRecord-Private.xcconfig ├── MagicalRecord │ ├── MagicalRecord │ │ ├── Core │ │ │ ├── MagicalRecord+ShorthandSupport.h │ │ │ ├── MagicalRecord+ErrorHandling.h │ │ │ ├── MagicalRecord+Setup.h │ │ │ ├── MagicalRecord+iCloud.h │ │ │ ├── MagicalRecord+Options.h │ │ │ ├── MagicalRecord+Options.m │ │ │ ├── MagicalRecord.h │ │ │ ├── MagicalRecord+Setup.m │ │ │ ├── MagicalRecord+Actions.h │ │ │ ├── MagicalRecord+ErrorHandling.m │ │ │ ├── MagicalRecord+iCloud.m │ │ │ └── MagicalRecord.m │ │ ├── Categories │ │ │ ├── DataImport │ │ │ │ ├── NSString+MagicalDataImport.h │ │ │ │ ├── NSRelationshipDescription+MagicalDataImport.h │ │ │ │ ├── NSEntityDescription+MagicalDataImport.h │ │ │ │ ├── NSAttributeDescription+MagicalDataImport.h │ │ │ │ ├── NSNumber+MagicalDataImport.h │ │ │ │ ├── NSNumber+MagicalDataImport.m │ │ │ │ ├── NSObject+MagicalDataImport.h │ │ │ │ ├── NSRelationshipDescription+MagicalDataImport.m │ │ │ │ ├── MagicalImportFunctions.h │ │ │ │ ├── NSString+MagicalDataImport.m │ │ │ │ ├── NSEntityDescription+MagicalDataImport.m │ │ │ │ ├── NSAttributeDescription+MagicalDataImport.m │ │ │ │ ├── NSObject+MagicalDataImport.m │ │ │ │ └── MagicalImportFunctions.m │ │ │ ├── NSManagedObjectContext │ │ │ │ ├── NSManagedObjectContext+MagicalThreading.h │ │ │ │ ├── NSManagedObjectContext+MagicalObserving.h │ │ │ │ ├── NSManagedObjectContext+MagicalRecord.h │ │ │ │ └── NSManagedObjectContext+MagicalThreading.m │ │ │ ├── NSPersistentStore+MagicalRecord.h │ │ │ ├── NSManagedObjectModel+MagicalRecord.h │ │ │ ├── NSManagedObject │ │ │ │ ├── NSManagedObject+MagicalDataImport.h │ │ │ │ ├── NSManagedObject+MagicalAggregation.h │ │ │ │ ├── NSManagedObject+MagicalRecord.h │ │ │ │ └── NSManagedObject+MagicalRequests.h │ │ │ ├── NSManagedObjectModel+MagicalRecord.m │ │ │ ├── NSPersistentStoreCoordinator+MagicalRecord.h │ │ │ └── NSPersistentStore+MagicalRecord.m │ │ └── CoreData+MagicalRecord.h │ ├── LICENSE │ └── README.md ├── Pods-JSQSystemSoundPlayer-Private.xcconfig ├── Pods-JSMessagesViewController-Private.xcconfig ├── Manifest.lock ├── Pods.xcconfig ├── JSQSystemSoundPlayer │ └── LICENSE ├── Pods-environment.h ├── Pods.xcodeproj │ ├── xcuserdata │ │ └── alexbutenko.xcuserdatad │ │ │ └── xcschemes │ │ │ ├── Pods.xcscheme │ │ │ ├── Pods-MagicalRecord.xcscheme │ │ │ ├── Pods-JSQSystemSoundPlayer.xcscheme │ │ │ └── Pods-JSMessagesViewController.xcscheme │ └── xcshareddata │ │ └── xcschemes │ │ ├── Pods.xcscheme │ │ ├── Pods-MagicalRecord.xcscheme │ │ ├── Pods-JSQSystemSoundPlayer.xcscheme │ │ └── Pods-JSMessagesViewController.xcscheme └── Pods-acknowledgements.markdown ├── screenshot.png ├── Podfile ├── SimpleChat ├── Images.xcassets │ ├── avatar_1.imageset │ │ ├── demo-avatar-cook.png │ │ ├── demo-avatar-cook@2x.png │ │ └── Contents.json │ ├── avatar_2.imageset │ │ ├── demo-avatar-jobs.png │ │ ├── demo-avatar-jobs@2x.png │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ ├── Chat-icon-1106010101.png │ │ ├── Chat-icon-1106010101-1.png │ │ ├── Chat-icon-1106010101-2.png │ │ └── Contents.json │ └── LaunchImage.launchimage │ │ └── Contents.json ├── SimpleChat-Bridging-Header.h ├── SimpleChat.xcdatamodeld │ ├── .xccurrentversion │ └── SimpleChat.xcdatamodel │ │ └── contents ├── Message.swift ├── Buddy.swift ├── BuddyPlainObject.swift ├── SimpleChat.entitlements ├── MessagePlainObject.swift ├── BuddiesCloudManager.swift ├── Info.plist ├── SenderBuddyDataManager.swift ├── BuddiesViewController.swift ├── SenderBuddyCloudManager.swift ├── BuddiesDataManager.swift ├── MessagesCloudManager.swift ├── AppDelegate.swift └── MessagesDataManager.swift ├── SimpleChat.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ ├── SimpleChat.xcscmblueprint │ └── SimpleChat.xccheckout ├── SimpleChat.xcodeproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── Podfile.lock ├── README.md └── SimpleChatTests ├── Info.plist └── SimpleChatTests.swift /Pods/Pods-MagicalRecord.xcconfig: -------------------------------------------------------------------------------- 1 | PODS_MAGICALRECORD_OTHER_LDFLAGS = -framework CoreData -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/screenshot.png -------------------------------------------------------------------------------- /Pods/Headers/MagicalRecord/MagicalRecord.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Core/MagicalRecord.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/MagicalRecord/MagicalRecord.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Core/MagicalRecord.h -------------------------------------------------------------------------------- /Pods/Headers/MagicalRecord/MagicalRecord+Setup.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Core/MagicalRecord+Setup.h -------------------------------------------------------------------------------- /Pods/Pods-JSQSystemSoundPlayer.xcconfig: -------------------------------------------------------------------------------- 1 | PODS_JSQSYSTEMSOUNDPLAYER_OTHER_LDFLAGS = -framework AudioToolbox -------------------------------------------------------------------------------- /Pods/BuildHeaders/MagicalRecord/MagicalRecord+Setup.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Core/MagicalRecord+Setup.h -------------------------------------------------------------------------------- /Pods/Headers/MagicalRecord/CoreData+MagicalRecord.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/CoreData+MagicalRecord.h -------------------------------------------------------------------------------- /Pods/Headers/MagicalRecord/MagicalRecord+Actions.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Core/MagicalRecord+Actions.h -------------------------------------------------------------------------------- /Pods/Headers/MagicalRecord/MagicalRecord+Options.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Core/MagicalRecord+Options.h -------------------------------------------------------------------------------- /Pods/Headers/MagicalRecord/MagicalRecord+iCloud.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Core/MagicalRecord+iCloud.h -------------------------------------------------------------------------------- /Pods/Pods-JSMessagesViewController.xcconfig: -------------------------------------------------------------------------------- 1 | PODS_JSMESSAGESVIEWCONTROLLER_OTHER_LDFLAGS = -framework QuartzCore -------------------------------------------------------------------------------- /Pods/BuildHeaders/MagicalRecord/CoreData+MagicalRecord.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/CoreData+MagicalRecord.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/MagicalRecord/MagicalRecord+Actions.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Core/MagicalRecord+Actions.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/MagicalRecord/MagicalRecord+Options.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Core/MagicalRecord+Options.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/MagicalRecord/MagicalRecord+iCloud.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Core/MagicalRecord+iCloud.h -------------------------------------------------------------------------------- /Pods/Headers/MagicalRecord/MagicalRecordShorthand.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Core/MagicalRecordShorthand.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/MagicalRecord/MagicalRecordShorthand.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Core/MagicalRecordShorthand.h -------------------------------------------------------------------------------- /Pods/Headers/JSMessagesViewController/JSMessage.h: -------------------------------------------------------------------------------- 1 | ../../JSMessagesViewController/JSMessagesViewController/Classes/JSMessage.h -------------------------------------------------------------------------------- /Pods/Headers/MagicalRecord/MagicalRecord+ErrorHandling.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Core/MagicalRecord+ErrorHandling.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/JSMessagesViewController/JSMessage.h: -------------------------------------------------------------------------------- 1 | ../../JSMessagesViewController/JSMessagesViewController/Classes/JSMessage.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/MagicalRecord/MagicalRecord+ErrorHandling.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Core/MagicalRecord+ErrorHandling.h -------------------------------------------------------------------------------- /Pods/Headers/JSMessagesViewController/JSBubbleView.h: -------------------------------------------------------------------------------- 1 | ../../JSMessagesViewController/JSMessagesViewController/Classes/JSBubbleView.h -------------------------------------------------------------------------------- /Pods/Headers/JSMessagesViewController/JSMessageData.h: -------------------------------------------------------------------------------- 1 | ../../JSMessagesViewController/JSMessagesViewController/Classes/JSMessageData.h -------------------------------------------------------------------------------- /Pods/Headers/MagicalRecord/MagicalImportFunctions.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/DataImport/MagicalImportFunctions.h -------------------------------------------------------------------------------- /Pods/Headers/MagicalRecord/MagicalRecord+ShorthandSupport.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Core/MagicalRecord+ShorthandSupport.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/JSMessagesViewController/JSBubbleView.h: -------------------------------------------------------------------------------- 1 | ../../JSMessagesViewController/JSMessagesViewController/Classes/JSBubbleView.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/JSMessagesViewController/JSMessageData.h: -------------------------------------------------------------------------------- 1 | ../../JSMessagesViewController/JSMessagesViewController/Classes/JSMessageData.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/MagicalRecord/MagicalImportFunctions.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/DataImport/MagicalImportFunctions.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/MagicalRecord/MagicalRecord+ShorthandSupport.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Core/MagicalRecord+ShorthandSupport.h -------------------------------------------------------------------------------- /Pods/Headers/JSQSystemSoundPlayer/JSQSystemSoundPlayer.h: -------------------------------------------------------------------------------- 1 | ../../JSQSystemSoundPlayer/JSQSystemSoundPlayer/Classes/JSQSystemSoundPlayer.h -------------------------------------------------------------------------------- /Pods/Headers/MagicalRecord/NSPersistentStore+MagicalRecord.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/NSPersistentStore+MagicalRecord.h -------------------------------------------------------------------------------- /Pods/Pods-JSQSystemSoundPlayer-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Pods-environment.h" 6 | -------------------------------------------------------------------------------- /Pods/BuildHeaders/JSQSystemSoundPlayer/JSQSystemSoundPlayer.h: -------------------------------------------------------------------------------- 1 | ../../JSQSystemSoundPlayer/JSQSystemSoundPlayer/Classes/JSQSystemSoundPlayer.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/MagicalRecord/NSPersistentStore+MagicalRecord.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/NSPersistentStore+MagicalRecord.h -------------------------------------------------------------------------------- /Pods/Headers/JSMessagesViewController/JSMessageInputView.h: -------------------------------------------------------------------------------- 1 | ../../JSMessagesViewController/JSMessagesViewController/Classes/JSMessageInputView.h -------------------------------------------------------------------------------- /Pods/Headers/JSMessagesViewController/JSMessageTableView.h: -------------------------------------------------------------------------------- 1 | ../../JSMessagesViewController/JSMessagesViewController/Classes/JSMessageTableView.h -------------------------------------------------------------------------------- /Pods/Headers/JSMessagesViewController/JSMessageTextView.h: -------------------------------------------------------------------------------- 1 | ../../JSMessagesViewController/JSMessagesViewController/Classes/JSMessageTextView.h -------------------------------------------------------------------------------- /Pods/Headers/MagicalRecord/NSNumber+MagicalDataImport.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/DataImport/NSNumber+MagicalDataImport.h -------------------------------------------------------------------------------- /Pods/Headers/MagicalRecord/NSObject+MagicalDataImport.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/DataImport/NSObject+MagicalDataImport.h -------------------------------------------------------------------------------- /Pods/Headers/MagicalRecord/NSString+MagicalDataImport.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/DataImport/NSString+MagicalDataImport.h -------------------------------------------------------------------------------- /Pods/Pods-JSMessagesViewController-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Pods-environment.h" 6 | -------------------------------------------------------------------------------- /Pods/BuildHeaders/JSMessagesViewController/JSMessageInputView.h: -------------------------------------------------------------------------------- 1 | ../../JSMessagesViewController/JSMessagesViewController/Classes/JSMessageInputView.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/JSMessagesViewController/JSMessageTableView.h: -------------------------------------------------------------------------------- 1 | ../../JSMessagesViewController/JSMessagesViewController/Classes/JSMessageTableView.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/JSMessagesViewController/JSMessageTextView.h: -------------------------------------------------------------------------------- 1 | ../../JSMessagesViewController/JSMessagesViewController/Classes/JSMessageTextView.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/MagicalRecord/NSNumber+MagicalDataImport.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/DataImport/NSNumber+MagicalDataImport.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/MagicalRecord/NSObject+MagicalDataImport.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/DataImport/NSObject+MagicalDataImport.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/MagicalRecord/NSString+MagicalDataImport.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/DataImport/NSString+MagicalDataImport.h -------------------------------------------------------------------------------- /Pods/Headers/JSMessagesViewController/JSBubbleMessageCell.h: -------------------------------------------------------------------------------- 1 | ../../JSMessagesViewController/JSMessagesViewController/Classes/JSBubbleMessageCell.h -------------------------------------------------------------------------------- /Pods/Headers/JSMessagesViewController/JSDismissiveTextView.h: -------------------------------------------------------------------------------- 1 | ../../JSMessagesViewController/JSMessagesViewController/Classes/JSDismissiveTextView.h -------------------------------------------------------------------------------- /Pods/Headers/JSMessagesViewController/JSMessageSoundEffect.h: -------------------------------------------------------------------------------- 1 | ../../JSMessagesViewController/JSMessagesViewController/Classes/JSMessageSoundEffect.h -------------------------------------------------------------------------------- /Pods/Headers/MagicalRecord/NSManagedObjectModel+MagicalRecord.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/NSManagedObjectModel+MagicalRecord.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/JSMessagesViewController/JSBubbleMessageCell.h: -------------------------------------------------------------------------------- 1 | ../../JSMessagesViewController/JSMessagesViewController/Classes/JSBubbleMessageCell.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/JSMessagesViewController/JSDismissiveTextView.h: -------------------------------------------------------------------------------- 1 | ../../JSMessagesViewController/JSMessagesViewController/Classes/JSDismissiveTextView.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/JSMessagesViewController/JSMessageSoundEffect.h: -------------------------------------------------------------------------------- 1 | ../../JSMessagesViewController/JSMessagesViewController/Classes/JSMessageSoundEffect.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/MagicalRecord/NSManagedObjectModel+MagicalRecord.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/NSManagedObjectModel+MagicalRecord.h -------------------------------------------------------------------------------- /Pods/Headers/MagicalRecord/NSManagedObject+MagicalFinders.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalFinders.h -------------------------------------------------------------------------------- /Pods/Headers/MagicalRecord/NSManagedObject+MagicalRecord.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalRecord.h -------------------------------------------------------------------------------- /Pods/Pods-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods : NSObject 3 | @end 4 | @implementation PodsDummy_Pods 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/BuildHeaders/MagicalRecord/NSManagedObject+MagicalFinders.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalFinders.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/MagicalRecord/NSManagedObject+MagicalRecord.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalRecord.h -------------------------------------------------------------------------------- /Pods/Headers/JSMessagesViewController/JSAvatarImageFactory.h: -------------------------------------------------------------------------------- 1 | ../../JSMessagesViewController/JSMessagesViewController/Classes/Factories/JSAvatarImageFactory.h -------------------------------------------------------------------------------- /Pods/Headers/JSMessagesViewController/JSMessagesViewController.h: -------------------------------------------------------------------------------- 1 | ../../JSMessagesViewController/JSMessagesViewController/Classes/JSMessagesViewController.h -------------------------------------------------------------------------------- /Pods/Headers/MagicalRecord/NSManagedObject+MagicalDataImport.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalDataImport.h -------------------------------------------------------------------------------- /Pods/Headers/MagicalRecord/NSManagedObject+MagicalRequests.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalRequests.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/JSMessagesViewController/JSAvatarImageFactory.h: -------------------------------------------------------------------------------- 1 | ../../JSMessagesViewController/JSMessagesViewController/Classes/Factories/JSAvatarImageFactory.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/JSMessagesViewController/JSMessagesViewController.h: -------------------------------------------------------------------------------- 1 | ../../JSMessagesViewController/JSMessagesViewController/Classes/JSMessagesViewController.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/MagicalRecord/NSManagedObject+MagicalDataImport.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalDataImport.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/MagicalRecord/NSManagedObject+MagicalRequests.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalRequests.h -------------------------------------------------------------------------------- /Pods/Headers/JSMessagesViewController/NSString+JSMessagesView.h: -------------------------------------------------------------------------------- 1 | ../../JSMessagesViewController/JSMessagesViewController/Classes/Categories/NSString+JSMessagesView.h -------------------------------------------------------------------------------- /Pods/Headers/JSMessagesViewController/UIColor+JSMessagesView.h: -------------------------------------------------------------------------------- 1 | ../../JSMessagesViewController/JSMessagesViewController/Classes/Categories/UIColor+JSMessagesView.h -------------------------------------------------------------------------------- /Pods/Headers/JSMessagesViewController/UIImage+JSMessagesView.h: -------------------------------------------------------------------------------- 1 | ../../JSMessagesViewController/JSMessagesViewController/Classes/Categories/UIImage+JSMessagesView.h -------------------------------------------------------------------------------- /Pods/Headers/MagicalRecord/NSEntityDescription+MagicalDataImport.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/DataImport/NSEntityDescription+MagicalDataImport.h -------------------------------------------------------------------------------- /Pods/Headers/MagicalRecord/NSManagedObject+MagicalAggregation.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalAggregation.h -------------------------------------------------------------------------------- /Pods/Headers/MagicalRecord/NSPersistentStoreCoordinator+MagicalRecord.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/NSPersistentStoreCoordinator+MagicalRecord.h -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '7.0' 2 | 3 | pod 'JSMessagesViewController' 4 | pod 'MagicalRecord' 5 | 6 | # ignore all warnings from all pods 7 | inhibit_all_warnings! 8 | -------------------------------------------------------------------------------- /Pods/BuildHeaders/JSMessagesViewController/NSString+JSMessagesView.h: -------------------------------------------------------------------------------- 1 | ../../JSMessagesViewController/JSMessagesViewController/Classes/Categories/NSString+JSMessagesView.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/JSMessagesViewController/UIColor+JSMessagesView.h: -------------------------------------------------------------------------------- 1 | ../../JSMessagesViewController/JSMessagesViewController/Classes/Categories/UIColor+JSMessagesView.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/JSMessagesViewController/UIImage+JSMessagesView.h: -------------------------------------------------------------------------------- 1 | ../../JSMessagesViewController/JSMessagesViewController/Classes/Categories/UIImage+JSMessagesView.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/MagicalRecord/NSEntityDescription+MagicalDataImport.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/DataImport/NSEntityDescription+MagicalDataImport.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/MagicalRecord/NSManagedObject+MagicalAggregation.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalAggregation.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/MagicalRecord/NSPersistentStoreCoordinator+MagicalRecord.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/NSPersistentStoreCoordinator+MagicalRecord.h -------------------------------------------------------------------------------- /Pods/Headers/JSMessagesViewController/JSBubbleImageViewFactory.h: -------------------------------------------------------------------------------- 1 | ../../JSMessagesViewController/JSMessagesViewController/Classes/Factories/JSBubbleImageViewFactory.h -------------------------------------------------------------------------------- /Pods/Headers/MagicalRecord/NSAttributeDescription+MagicalDataImport.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/DataImport/NSAttributeDescription+MagicalDataImport.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/JSMessagesViewController/JSBubbleImageViewFactory.h: -------------------------------------------------------------------------------- 1 | ../../JSMessagesViewController/JSMessagesViewController/Classes/Factories/JSBubbleImageViewFactory.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/MagicalRecord/NSAttributeDescription+MagicalDataImport.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/DataImport/NSAttributeDescription+MagicalDataImport.h -------------------------------------------------------------------------------- /Pods/Headers/MagicalRecord/NSManagedObjectContext+MagicalRecord.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalRecord.h -------------------------------------------------------------------------------- /Pods/Headers/MagicalRecord/NSManagedObjectContext+MagicalSaves.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalSaves.h -------------------------------------------------------------------------------- /Pods/Headers/MagicalRecord/NSRelationshipDescription+MagicalDataImport.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/DataImport/NSRelationshipDescription+MagicalDataImport.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/MagicalRecord/NSManagedObjectContext+MagicalRecord.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalRecord.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/MagicalRecord/NSManagedObjectContext+MagicalSaves.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalSaves.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/MagicalRecord/NSRelationshipDescription+MagicalDataImport.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/DataImport/NSRelationshipDescription+MagicalDataImport.h -------------------------------------------------------------------------------- /Pods/Headers/MagicalRecord/NSManagedObjectContext+MagicalObserving.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalObserving.h -------------------------------------------------------------------------------- /Pods/Headers/MagicalRecord/NSManagedObjectContext+MagicalThreading.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalThreading.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/MagicalRecord/NSManagedObjectContext+MagicalObserving.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalObserving.h -------------------------------------------------------------------------------- /Pods/BuildHeaders/MagicalRecord/NSManagedObjectContext+MagicalThreading.h: -------------------------------------------------------------------------------- 1 | ../../MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalThreading.h -------------------------------------------------------------------------------- /SimpleChat/Images.xcassets/avatar_1.imageset/demo-avatar-cook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/SimpleChat/Images.xcassets/avatar_1.imageset/demo-avatar-cook.png -------------------------------------------------------------------------------- /SimpleChat/Images.xcassets/avatar_2.imageset/demo-avatar-jobs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/SimpleChat/Images.xcassets/avatar_2.imageset/demo-avatar-jobs.png -------------------------------------------------------------------------------- /Pods/Pods-MagicalRecord-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_MagicalRecord : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_MagicalRecord 5 | @end 6 | -------------------------------------------------------------------------------- /SimpleChat/Images.xcassets/AppIcon.appiconset/Chat-icon-1106010101.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/SimpleChat/Images.xcassets/AppIcon.appiconset/Chat-icon-1106010101.png -------------------------------------------------------------------------------- /SimpleChat/Images.xcassets/avatar_1.imageset/demo-avatar-cook@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/SimpleChat/Images.xcassets/avatar_1.imageset/demo-avatar-cook@2x.png -------------------------------------------------------------------------------- /SimpleChat/Images.xcassets/avatar_2.imageset/demo-avatar-jobs@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/SimpleChat/Images.xcassets/avatar_2.imageset/demo-avatar-jobs@2x.png -------------------------------------------------------------------------------- /SimpleChat/Images.xcassets/AppIcon.appiconset/Chat-icon-1106010101-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/SimpleChat/Images.xcassets/AppIcon.appiconset/Chat-icon-1106010101-1.png -------------------------------------------------------------------------------- /SimpleChat/Images.xcassets/AppIcon.appiconset/Chat-icon-1106010101-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/SimpleChat/Images.xcassets/AppIcon.appiconset/Chat-icon-1106010101-2.png -------------------------------------------------------------------------------- /Pods/Pods-MagicalRecord-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Pods-environment.h" 6 | #import 7 | #import "CoreData+MagicalRecord.h" 8 | -------------------------------------------------------------------------------- /Pods/Pods-JSQSystemSoundPlayer-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_JSQSystemSoundPlayer : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_JSQSystemSoundPlayer 5 | @end 6 | -------------------------------------------------------------------------------- /SimpleChat.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Pods/Pods-JSMessagesViewController-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_JSMessagesViewController : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_JSMessagesViewController 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Sounds/message-sent.aiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Sounds/message-sent.aiff -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-flat/bubble.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-flat/bubble.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Sounds/message-received.aiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Sounds/message-received.aiff -------------------------------------------------------------------------------- /SimpleChat.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-flat/bubble@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-flat/bubble@2x.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-flat/bubble-min.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-flat/bubble-min.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/avatar/avatar-placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/avatar/avatar-placeholder.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-flat/bubble-min@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-flat/bubble-min@2x.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-flat/bubble-stroked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-flat/bubble-stroked.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/avatar/avatar-placeholder@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/avatar/avatar-placeholder@2x.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-flat/bubble-stroked@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-flat/bubble-stroked@2x.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-flat/bubble-tailless.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-flat/bubble-tailless.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/input-bar-classic/send-button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/input-bar-classic/send-button.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/input-bar-flat/button-photo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/input-bar-flat/button-photo.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/input-bar-flat/input-bar-flat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/input-bar-flat/input-bar-flat.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-flat/bubble-min-tailless.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-flat/bubble-min-tailless.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-flat/bubble-tailless@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-flat/bubble-tailless@2x.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/input-bar-flat/button-photo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/input-bar-flat/button-photo@2x.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-classic/bubble-classic-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-classic/bubble-classic-blue.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-classic/bubble-classic-gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-classic/bubble-classic-gray.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-flat/bubble-min-tailless@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-flat/bubble-min-tailless@2x.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/input-bar-classic/send-button@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/input-bar-classic/send-button@2x.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/input-bar-flat/input-bar-flat@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/input-bar-flat/input-bar-flat@2x.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-classic/bubble-classic-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-classic/bubble-classic-green.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-classic/bubble-classic-typing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-classic/bubble-classic-typing.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-flat/bubble-stroked-tailless.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-flat/bubble-stroked-tailless.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/input-bar-classic/input-field-cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/input-bar-classic/input-field-cover.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-classic/bubble-classic-blue@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-classic/bubble-classic-blue@2x.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-classic/bubble-classic-gray@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-classic/bubble-classic-gray@2x.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-classic/bubble-classic-green@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-classic/bubble-classic-green@2x.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-classic/bubble-classic-selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-classic/bubble-classic-selected.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-classic/bubble-classic-typing@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-classic/bubble-classic-typing@2x.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-flat/bubble-stroked-tailless@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-flat/bubble-stroked-tailless@2x.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/input-bar-classic/input-bar-background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/input-bar-classic/input-bar-background.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/input-bar-classic/input-field-cover@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/input-bar-classic/input-field-cover@2x.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/input-bar-classic/send-button-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/input-bar-classic/send-button-pressed.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-classic/bubble-classic-selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-classic/bubble-classic-selected@2x.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/input-bar-classic/input-bar-background@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/input-bar-classic/input-bar-background@2x.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/input-bar-classic/send-button-pressed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/input-bar-classic/send-button-pressed@2x.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-classic-square/bubble-classic-square-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-classic-square/bubble-classic-square-blue.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-classic-square/bubble-classic-square-gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-classic-square/bubble-classic-square-gray.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-classic-square/bubble-classic-square-blue@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-classic-square/bubble-classic-square-blue@2x.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-classic-square/bubble-classic-square-gray@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-classic-square/bubble-classic-square-gray@2x.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-classic-square/bubble-classic-square-selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-classic-square/bubble-classic-square-selected.png -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-classic-square/bubble-classic-square-selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbutenko/simplechat/HEAD/Pods/JSMessagesViewController/JSMessagesViewController/Resources/Images/bubble-classic-square/bubble-classic-square-selected@2x.png -------------------------------------------------------------------------------- /SimpleChat/SimpleChat-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | #import 6 | #import 7 | #import 8 | #import -------------------------------------------------------------------------------- /SimpleChat/SimpleChat.xcdatamodeld/.xccurrentversion: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | _XCCurrentVersionName 6 | SimpleChat.xcdatamodel 7 | 8 | 9 | -------------------------------------------------------------------------------- /Pods/Pods-MagicalRecord-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-MagicalRecord.xcconfig" 2 | GCC_PREPROCESSOR_DEFINITIONS = COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/BuildHeaders" "${PODS_ROOT}/BuildHeaders/MagicalRecord" "${PODS_ROOT}/Headers" "${PODS_ROOT}/Headers/JSMessagesViewController" "${PODS_ROOT}/Headers/JSQSystemSoundPlayer" "${PODS_ROOT}/Headers/MagicalRecord" 4 | OTHER_LDFLAGS = -ObjC ${PODS_MAGICALRECORD_OTHER_LDFLAGS} 5 | PODS_ROOT = ${SRCROOT} -------------------------------------------------------------------------------- /SimpleChat/Message.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Message.swift 3 | // SimpleChat 4 | // 5 | // Created by alexbutenko on 7/15/14. 6 | // Copyright (c) 2014 alexbutenko. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import CoreData 11 | 12 | @objc(Message) 13 | class Message : NSManagedObject { 14 | @NSManaged var value:String 15 | @NSManaged var serverID:String 16 | @NSManaged var date:NSDate 17 | @NSManaged var owner:Buddy 18 | } -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+ShorthandSupport.h: -------------------------------------------------------------------------------- 1 | // 2 | // MagicalRecord+ShorthandSupport.h 3 | // Magical Record 4 | // 5 | // Created by Saul Mora on 3/6/12. 6 | // Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. 7 | // 8 | 9 | #import "MagicalRecord.h" 10 | 11 | @interface MagicalRecord (ShorthandSupport) 12 | 13 | #ifdef MR_SHORTHAND 14 | + (void) swizzleShorthandMethods; 15 | #endif 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /SimpleChat/Buddy.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Buddy.swift 3 | // SimpleChat 4 | // 5 | // Created by alexbutenko on 7/15/14. 6 | // Copyright (c) 2014 alexbutenko. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import CoreData 11 | 12 | @objc(Buddy) 13 | class Buddy : NSManagedObject { 14 | @NSManaged var name:String 15 | @NSManaged var serverID:String //refer to ID of iCloud user, not record at CloudKit 16 | @NSManaged var messages:NSSet 17 | } -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSString+MagicalDataImport.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+MagicalRecord_MagicalDataImport.h 3 | // Magical Record 4 | // 5 | // Created by Saul Mora on 12/10/11. 6 | // Copyright (c) 2011 Magical Panda Software LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSString (MagicalRecord_DataImport) 12 | 13 | - (NSString *) MR_capitalizedFirstCharacterString; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSRelationshipDescription+MagicalDataImport.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSRelationshipDescription+MagicalDataImport.h 3 | // Magical Record 4 | // 5 | // Created by Saul Mora on 9/4/11. 6 | // Copyright 2011 Magical Panda Software LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSRelationshipDescription (MagicalRecord_DataImport) 12 | 13 | - (NSString *) MR_primaryKey; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Pods/Pods-JSQSystemSoundPlayer-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-JSQSystemSoundPlayer.xcconfig" 2 | GCC_PREPROCESSOR_DEFINITIONS = COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/BuildHeaders" "${PODS_ROOT}/BuildHeaders/JSQSystemSoundPlayer" "${PODS_ROOT}/Headers" "${PODS_ROOT}/Headers/JSMessagesViewController" "${PODS_ROOT}/Headers/JSQSystemSoundPlayer" "${PODS_ROOT}/Headers/MagicalRecord" 4 | OTHER_LDFLAGS = -ObjC ${PODS_JSQSYSTEMSOUNDPLAYER_OTHER_LDFLAGS} 5 | PODS_ROOT = ${SRCROOT} -------------------------------------------------------------------------------- /SimpleChat/Images.xcassets/avatar_1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal" 5 | }, 6 | { 7 | "idiom" : "universal", 8 | "scale" : "1x", 9 | "filename" : "demo-avatar-cook.png" 10 | }, 11 | { 12 | "idiom" : "universal", 13 | "scale" : "2x", 14 | "filename" : "demo-avatar-cook@2x.png" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /SimpleChat/Images.xcassets/avatar_2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal" 5 | }, 6 | { 7 | "idiom" : "universal", 8 | "scale" : "1x", 9 | "filename" : "demo-avatar-jobs.png" 10 | }, 11 | { 12 | "idiom" : "universal", 13 | "scale" : "2x", 14 | "filename" : "demo-avatar-jobs@2x.png" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Classes/JSMessageTableView.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.hexedbits.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSMessagesViewController 8 | // 9 | // 10 | // The MIT License 11 | // Copyright (c) 2013 Jesse Squires 12 | // http://opensource.org/licenses/MIT 13 | // 14 | 15 | #import "JSMessageTableView.h" 16 | 17 | @implementation JSMessageTableView 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Pods/Pods-JSMessagesViewController-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-JSMessagesViewController.xcconfig" 2 | GCC_PREPROCESSOR_DEFINITIONS = COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/BuildHeaders" "${PODS_ROOT}/BuildHeaders/JSMessagesViewController" "${PODS_ROOT}/Headers" "${PODS_ROOT}/Headers/JSMessagesViewController" "${PODS_ROOT}/Headers/JSQSystemSoundPlayer" "${PODS_ROOT}/Headers/MagicalRecord" 4 | OTHER_LDFLAGS = -ObjC ${PODS_JSMESSAGESVIEWCONTROLLER_OTHER_LDFLAGS} 5 | PODS_ROOT = ${SRCROOT} -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSEntityDescription+MagicalDataImport.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSEntityDescription+MagicalDataImport.h 3 | // Magical Record 4 | // 5 | // Created by Saul Mora on 9/5/11. 6 | // Copyright 2011 Magical Panda Software LLC. All rights reserved. 7 | // 8 | 9 | 10 | @interface NSEntityDescription (MagicalRecord_DataImport) 11 | 12 | - (NSAttributeDescription *) MR_primaryAttributeToRelateBy; 13 | - (NSManagedObject *) MR_createInstanceInContext:(NSManagedObjectContext *)context; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalThreading.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSManagedObjectContext+MagicalThreading.h 3 | // Magical Record 4 | // 5 | // Created by Saul Mora on 3/9/12. 6 | // Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSManagedObjectContext (MagicalThreading) 12 | 13 | + (NSManagedObjectContext *) MR_contextForCurrentThread; 14 | + (void) MR_resetContextForCurrentThread; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSAttributeDescription+MagicalDataImport.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSAttributeDescription+MagicalDataImport.h 3 | // Magical Record 4 | // 5 | // Created by Saul Mora on 9/4/11. 6 | // Copyright 2011 Magical Panda Software LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSAttributeDescription (MagicalRecord_DataImport) 12 | 13 | - (NSString *) MR_primaryKey; 14 | - (id) MR_valueForKeyPath:(NSString *)keyPath fromObjectData:(id)objectData; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - JSMessagesViewController (4.0.4): 3 | - JSQSystemSoundPlayer 4 | - JSQSystemSoundPlayer (1.5.2) 5 | - MagicalRecord (2.2): 6 | - MagicalRecord/Core 7 | - MagicalRecord/Core (2.2) 8 | 9 | DEPENDENCIES: 10 | - JSMessagesViewController 11 | - MagicalRecord 12 | 13 | SPEC CHECKSUMS: 14 | JSMessagesViewController: 1083fdb9043e652a86b29bdfef526a9caef9f40e 15 | JSQSystemSoundPlayer: c24914bc96ff5365b5d28b59d7ecffd60d1c5587 16 | MagicalRecord: 2b471584fc9e3137f3d0a56967917baa4979e224 17 | 18 | COCOAPODS: 0.33.1 19 | -------------------------------------------------------------------------------- /SimpleChat/BuddyPlainObject.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BuddyPlainObject.swift 3 | // SimpleChat 4 | // 5 | // Created by alexbutenko on 7/15/14. 6 | // Copyright (c) 2014 alexbutenko. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class BuddyPlainObject { 12 | var name:String 13 | var serverID:String 14 | 15 | init(name:String, serverID:String) { 16 | self.name = name 17 | self.serverID = serverID 18 | } 19 | 20 | func description() -> String { 21 | return name + " ID: " + serverID 22 | } 23 | } -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - JSMessagesViewController (4.0.4): 3 | - JSQSystemSoundPlayer 4 | - JSQSystemSoundPlayer (1.5.2) 5 | - MagicalRecord (2.2): 6 | - MagicalRecord/Core 7 | - MagicalRecord/Core (2.2) 8 | 9 | DEPENDENCIES: 10 | - JSMessagesViewController 11 | - MagicalRecord 12 | 13 | SPEC CHECKSUMS: 14 | JSMessagesViewController: 1083fdb9043e652a86b29bdfef526a9caef9f40e 15 | JSQSystemSoundPlayer: c24914bc96ff5365b5d28b59d7ecffd60d1c5587 16 | MagicalRecord: 2b471584fc9e3137f3d0a56967917baa4979e224 17 | 18 | COCOAPODS: 0.33.1 19 | -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSNumber+MagicalDataImport.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSNumber+MagicalDataImport.h 3 | // Magical Record 4 | // 5 | // Created by Saul Mora on 9/4/11. 6 | // Copyright 2011 Magical Panda Software LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSNumber (MagicalRecord_DataImport) 12 | 13 | - (NSString *) MR_lookupKeyForAttribute:(NSAttributeDescription *)attributeInfo; 14 | - (id) MR_relatedValueForRelationship:(NSRelationshipDescription *)relationshipInfo; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Pods/Pods.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers" "${PODS_ROOT}/Headers/JSMessagesViewController" "${PODS_ROOT}/Headers/JSQSystemSoundPlayer" "${PODS_ROOT}/Headers/MagicalRecord" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers" -isystem "${PODS_ROOT}/Headers/JSMessagesViewController" -isystem "${PODS_ROOT}/Headers/JSQSystemSoundPlayer" -isystem "${PODS_ROOT}/Headers/MagicalRecord" 4 | OTHER_LDFLAGS = -ObjC -framework AudioToolbox -framework CoreData -framework QuartzCore 5 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+ErrorHandling.h: -------------------------------------------------------------------------------- 1 | // 2 | // MagicalRecord+ErrorHandling.h 3 | // Magical Record 4 | // 5 | // Created by Saul Mora on 3/6/12. 6 | // Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. 7 | // 8 | 9 | #import "MagicalRecord.h" 10 | 11 | @interface MagicalRecord (ErrorHandling) 12 | 13 | + (void) handleErrors:(NSError *)error; 14 | - (void) handleErrors:(NSError *)error; 15 | 16 | + (void) setErrorHandlerTarget:(id)target action:(SEL)action; 17 | + (SEL) errorHandlerAction; 18 | + (id) errorHandlerTarget; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Simplechat 2 | ========== 3 | 4 | ![alt tag](https://raw.githubusercontent.com/alexbutenko/simplechat/master/screenshot.png) 5 | 6 | Simple chat app using CloudKit. 7 | 8 | 1. Create App ID using Apple developer program 9 | 2. Create iCloud container using Apple developer program 10 | 3. enable iCloud in your project Capabilities section. (Key-Value storage & CloudKit) 11 | 4. enable Remote notifications in your project Capabilities section. 12 | 5. prepare provision profile with these features enabled. 13 | 14 | You should be able to run application. If not contact me with your questions. 15 | -------------------------------------------------------------------------------- /SimpleChat/SimpleChat.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.developer.icloud-container-identifiers 6 | 7 | iCloud.$(CFBundleIdentifier) 8 | 9 | com.apple.developer.icloud-services 10 | 11 | CloudKit 12 | 13 | com.apple.developer.ubiquity-kvstore-identifier 14 | $(TeamIdentifierPrefix)$(CFBundleIdentifier) 15 | 16 | 17 | -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+Setup.h: -------------------------------------------------------------------------------- 1 | // 2 | // MagicalRecord+Setup.h 3 | // Magical Record 4 | // 5 | // Created by Saul Mora on 3/7/12. 6 | // Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. 7 | // 8 | 9 | #import "MagicalRecord.h" 10 | 11 | @interface MagicalRecord (Setup) 12 | 13 | + (void) setupCoreDataStack; 14 | + (void) setupCoreDataStackWithInMemoryStore; 15 | + (void) setupAutoMigratingCoreDataStack; 16 | 17 | + (void) setupCoreDataStackWithStoreNamed:(NSString *)storeName; 18 | + (void) setupCoreDataStackWithAutoMigratingSqliteStoreNamed:(NSString *)storeName; 19 | 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Classes/JSMessageTableView.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.hexedbits.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSMessagesViewController 8 | // 9 | // 10 | // The MIT License 11 | // Copyright (c) 2013 Jesse Squires 12 | // http://opensource.org/licenses/MIT 13 | // 14 | 15 | #import 16 | 17 | /** 18 | * An instance of `JSMessageTableView` is a subclass of `UITableView` and is means for displaying a list of messages between a group of users. 19 | */ 20 | @interface JSMessageTableView : UITableView 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSNumber+MagicalDataImport.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSNumber+MagicalDataImport.m 3 | // Magical Record 4 | // 5 | // Created by Saul Mora on 9/4/11. 6 | // Copyright 2011 Magical Panda Software LLC. All rights reserved. 7 | // 8 | 9 | #import "NSNumber+MagicalDataImport.h" 10 | 11 | 12 | 13 | @implementation NSNumber (MagicalRecord_DataImport) 14 | 15 | - (id) MR_relatedValueForRelationship:(NSRelationshipDescription *)relationshipInfo 16 | { 17 | return self; 18 | } 19 | 20 | - (NSString *) MR_lookupKeyForAttribute:(NSAttributeDescription *)attributeInfo 21 | { 22 | return nil; 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSObject+MagicalDataImport.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSDictionary+MagicalDataImport.h 3 | // Magical Record 4 | // 5 | // Created by Saul Mora on 9/4/11. 6 | // Copyright 2011 Magical Panda Software LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSObject (MagicalRecord_DataImport) 12 | 13 | - (NSString *) MR_lookupKeyForAttribute:(NSAttributeDescription *)attributeInfo; 14 | - (id) MR_valueForAttribute:(NSAttributeDescription *)attributeInfo; 15 | 16 | - (NSString *) MR_lookupKeyForRelationship:(NSRelationshipDescription *)relationshipInfo; 17 | - (id) MR_relatedValueForRelationship:(NSRelationshipDescription *)relationshipInfo; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /SimpleChat/MessagePlainObject.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MessagePlainObject.swift 3 | // SimpleChat 4 | // 5 | // Created by alexbutenko on 7/16/14. 6 | // Copyright (c) 2014 alexbutenko. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class MessagePlainObject { 12 | var value:String 13 | var serverID:String 14 | var ownerID:String 15 | var date:NSDate 16 | 17 | init(value:String, serverID:String, ownerID:String, date:NSDate) { 18 | self.value = value; 19 | self.serverID = serverID 20 | self.ownerID = ownerID 21 | self.date = date 22 | } 23 | 24 | func description() -> String { 25 | return value + " ID: " + serverID + " date: " + date.description 26 | } 27 | } -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Classes/Categories/NSString+JSMessagesView.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.hexedbits.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSMessagesViewController 8 | // 9 | // 10 | // The MIT License 11 | // Copyright (c) 2013 Jesse Squires 12 | // http://opensource.org/licenses/MIT 13 | // 14 | 15 | #import "NSString+JSMessagesView.h" 16 | 17 | @implementation NSString (JSMessagesView) 18 | 19 | - (NSString *)js_stringByTrimingWhitespace 20 | { 21 | return [self stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; 22 | } 23 | 24 | - (NSUInteger)js_numberOfLines 25 | { 26 | return [[self componentsSeparatedByString:@"\n"] count] + 1; 27 | } 28 | 29 | @end -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Categories/NSPersistentStore+MagicalRecord.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSPersistentStore+MagicalRecord.h 3 | // 4 | // Created by Saul Mora on 3/11/10. 5 | // Copyright 2010 Magical Panda Software, LLC All rights reserved. 6 | // 7 | 8 | #import "MagicalRecord.h" 9 | 10 | // option to autodelete store if it already exists 11 | 12 | extern NSString * const kMagicalRecordDefaultStoreFileName; 13 | 14 | 15 | @interface NSPersistentStore (MagicalRecord) 16 | 17 | + (NSURL *) MR_defaultLocalStoreUrl; 18 | 19 | + (NSPersistentStore *) MR_defaultPersistentStore; 20 | + (void) MR_setDefaultPersistentStore:(NSPersistentStore *) store; 21 | 22 | + (NSURL *) MR_urlForStoreName:(NSString *)storeFileName; 23 | + (NSURL *) MR_cloudURLForUbiqutiousContainer:(NSString *)bucketName; 24 | 25 | @end 26 | 27 | 28 | -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSRelationshipDescription+MagicalDataImport.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSRelationshipDescription+MagicalDataImport.m 3 | // Magical Record 4 | // 5 | // Created by Saul Mora on 9/4/11. 6 | // Copyright 2011 Magical Panda Software LLC. All rights reserved. 7 | // 8 | 9 | #import "NSRelationshipDescription+MagicalDataImport.h" 10 | #import "NSManagedObject+MagicalDataImport.h" 11 | #import "MagicalImportFunctions.h" 12 | #import "MagicalRecord.h" 13 | 14 | @implementation NSRelationshipDescription (MagicalRecord_DataImport) 15 | 16 | - (NSString *) MR_primaryKey; 17 | { 18 | NSString *primaryKeyName = [[self userInfo] valueForKey:kMagicalRecordImportRelationshipLinkedByKey] ?: 19 | primaryKeyNameFromString([[self destinationEntity] name]); 20 | 21 | return primaryKeyName; 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalObserving.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSManagedObjectContext+MagicalObserving.h 3 | // Magical Record 4 | // 5 | // Created by Saul Mora on 3/9/12. 6 | // Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSManagedObjectContext (MagicalObserving) 12 | 13 | - (void) MR_observeContext:(NSManagedObjectContext *)otherContext; 14 | - (void) MR_stopObservingContext:(NSManagedObjectContext *)otherContext; 15 | - (void) MR_observeContextOnMainThread:(NSManagedObjectContext *)otherContext; 16 | 17 | - (void) MR_observeiCloudChangesInCoordinator:(NSPersistentStoreCoordinator *)coordinator; 18 | - (void) MR_stopObservingiCloudChangesInCoordinator:(NSPersistentStoreCoordinator *)coordinator; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /SimpleChatTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | alexbutenko.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Categories/DataImport/MagicalImportFunctions.h: -------------------------------------------------------------------------------- 1 | // 2 | // MagicalImportFunctions.h 3 | // Magical Record 4 | // 5 | // Created by Saul Mora on 3/7/12. 6 | // Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | NSDate * adjustDateForDST(NSDate *date); 13 | NSDate * dateFromString(NSString *value, NSString *format); 14 | NSNumber * numberFromString(NSString *value); 15 | NSString * attributeNameFromString(NSString *value); 16 | NSString * primaryKeyNameFromString(NSString *value); 17 | 18 | #if TARGET_OS_IPHONE 19 | #import 20 | UIColor * UIColorFromString(NSString *serializedColor); 21 | 22 | #else 23 | #import 24 | NSColor * NSColorFromString(NSString *serializedColor); 25 | 26 | #endif 27 | extern id (*colorFromString)(NSString *); 28 | 29 | -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectModel+MagicalRecord.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSManagedObjectModel+MagicalRecord.h 3 | // 4 | // Created by Saul Mora on 3/11/10. 5 | // Copyright 2010 Magical Panda Software, LLC All rights reserved. 6 | // 7 | 8 | #import 9 | #import "MagicalRecord.h" 10 | 11 | 12 | @interface NSManagedObjectModel (MagicalRecord) 13 | 14 | + (NSManagedObjectModel *) MR_defaultManagedObjectModel; 15 | 16 | + (void) MR_setDefaultManagedObjectModel:(NSManagedObjectModel *)newDefaultModel; 17 | 18 | + (NSManagedObjectModel *) MR_mergedObjectModelFromMainBundle; 19 | + (NSManagedObjectModel *) MR_newManagedObjectModelNamed:(NSString *)modelFileName NS_RETURNS_RETAINED; 20 | + (NSManagedObjectModel *) MR_managedObjectModelNamed:(NSString *)modelFileName; 21 | + (NSManagedObjectModel *) MR_newModelNamed:(NSString *) modelName inBundleNamed:(NSString *) bundleName NS_RETURNS_RETAINED; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+iCloud.h: -------------------------------------------------------------------------------- 1 | // 2 | // MagicalRecord+iCloud.h 3 | // Magical Record 4 | // 5 | // Created by Saul Mora on 3/7/12. 6 | // Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. 7 | // 8 | 9 | #import "MagicalRecord.h" 10 | 11 | @interface MagicalRecord (iCloud) 12 | 13 | + (BOOL) isICloudEnabled; 14 | 15 | + (void) setupCoreDataStackWithiCloudContainer:(NSString *)icloudBucket localStoreNamed:(NSString *)localStore; 16 | + (void) setupCoreDataStackWithiCloudContainer:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreNamed:(NSString *)localStoreName cloudStorePathComponent:(NSString *)pathSubcomponent; 17 | + (void) setupCoreDataStackWithiCloudContainer:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreNamed:(NSString *)localStoreName cloudStorePathComponent:(NSString *)pathSubcomponent completion:(void(^)(void))completion; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /SimpleChat/BuddiesCloudManager.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BuddiesCloudManager.swift 3 | // SimpleChat 4 | // 5 | // Created by alexbutenko on 7/15/14. 6 | // Copyright (c) 2014 alexbutenko. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class BuddiesCloudManager { 12 | class func fetchBuddies(#completion:([BuddyPlainObject]!, NSError!) -> Void) { 13 | CloudManager.sharedInstance.fetchBuddies{records, error in 14 | if error == nil { 15 | let plainRecords:[BuddyPlainObject] = records.map { 16 | return BuddyPlainObject(name: $0.objectForKey(CloudManager.ModelKeys.BuddyName) as! String, 17 | serverID: $0.objectForKey(CloudManager.ModelKeys.BuddyID) as! String) 18 | } 19 | 20 | completion(plainRecords, nil) 21 | } else { 22 | completion(nil, error) 23 | } 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSString+MagicalDataImport.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+MagicalRecord_MagicalDataImport.m 3 | // Magical Record 4 | // 5 | // Created by Saul Mora on 12/10/11. 6 | // Copyright (c) 2011 Magical Panda Software LLC. All rights reserved. 7 | // 8 | 9 | #import "NSString+MagicalDataImport.h" 10 | 11 | 12 | @implementation NSString (MagicalRecord_DataImport) 13 | 14 | - (NSString *) MR_capitalizedFirstCharacterString; 15 | { 16 | if ([self length] > 0) 17 | { 18 | NSString *firstChar = [[self substringToIndex:1] capitalizedString]; 19 | return [firstChar stringByAppendingString:[self substringFromIndex:1]]; 20 | } 21 | return self; 22 | } 23 | 24 | - (id) MR_relatedValueForRelationship:(NSRelationshipDescription *)relationshipInfo 25 | { 26 | return self; 27 | } 28 | 29 | - (NSString *) MR_lookupKeyForAttribute:(NSAttributeDescription *)attributeInfo 30 | { 31 | return nil; 32 | } 33 | 34 | @end 35 | 36 | -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Classes/Categories/NSString+JSMessagesView.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.hexedbits.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSMessagesViewController 8 | // 9 | // 10 | // The MIT License 11 | // Copyright (c) 2013 Jesse Squires 12 | // http://opensource.org/licenses/MIT 13 | // 14 | 15 | #import 16 | 17 | @interface NSString (JSMessagesView) 18 | 19 | /** 20 | * Returns a copy of the receiver with all whitespaced removed from the front and back. 21 | * 22 | * @return A copied string with all leading and trailing whitespace removed. 23 | */ 24 | - (NSString *)js_stringByTrimingWhitespace; 25 | 26 | /** 27 | * Returns the number of lines in the receiver by counting the number of occurences of the newline character, `\n`. 28 | * 29 | * @return An unsigned integer describing the number of lines in the string. 30 | */ 31 | - (NSUInteger)js_numberOfLines; 32 | 33 | @end -------------------------------------------------------------------------------- /SimpleChatTests/SimpleChatTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SimpleChatTests.swift 3 | // SimpleChatTests 4 | // 5 | // Created by alexbutenko on 6/10/14. 6 | // Copyright (c) 2014 alexbutenko. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class SimpleChatTests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | // Put setup code here. This method is called before the invocation of each test method in the class. 16 | } 17 | 18 | override func tearDown() { 19 | // Put teardown code here. This method is called after the invocation of each test method in the class. 20 | super.tearDown() 21 | } 22 | 23 | func testExample() { 24 | // This is an example of a functional test case. 25 | XCTAssert(true, "Pass") 26 | } 27 | 28 | func testPerformanceExample() { 29 | // This is an example of a performance test case. 30 | self.measureBlock() { 31 | // Put the code you want to measure the time of here. 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Classes/JSMessageData.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.hexedbits.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSMessagesViewController 8 | // 9 | // 10 | // The MIT License 11 | // Copyright (c) 2013 Jesse Squires 12 | // http://opensource.org/licenses/MIT 13 | // 14 | 15 | #import 16 | 17 | /** 18 | * The `JSMessageData` protocol defines the common interface through which `JSMessagesViewController` interacts with message model objects. 19 | * It declares the methods that a class must implement so that instances of that class can be displayed properly by a `JSMessagesViewController`. 20 | */ 21 | @protocol JSMessageData 22 | 23 | @required 24 | 25 | /** 26 | * @return The body text of the message. 27 | * @warning This value must not be `nil`. 28 | */ 29 | - (NSString *)text; 30 | 31 | @optional 32 | 33 | /** 34 | * @return The name of the user who sent the message. 35 | */ 36 | - (NSString *)sender; 37 | 38 | /** 39 | * @return The date that the message was sent. 40 | */ 41 | - (NSDate *)date; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Pods/MagicalRecord/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010, Magical Panda Software, LLC 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /SimpleChat/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.sush.SimpleChat 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UIBackgroundModes 26 | 27 | fetch 28 | remote-notification 29 | 30 | UIMainStoryboardFile 31 | Main 32 | UIRequiredDeviceCapabilities 33 | 34 | armv7 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /Pods/JSQSystemSoundPlayer/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | MIT License 3 | Copyright (c) 2013 Jesse Squires 4 | 5 | http://www.hexedbits.com 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 8 | associated documentation files (the "Software"), to deal in the Software without restriction, including 9 | without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 11 | following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 17 | LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 20 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/LICENSE.txt: -------------------------------------------------------------------------------- 1 | 2 | MIT License 3 | Copyright (c) 2013 Jesse Squires 4 | 5 | http://www.hexedbits.com 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 8 | associated documentation files (the "Software"), to deal in the Software without restriction, including 9 | without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 11 | following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 17 | LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 20 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalDataImport.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSManagedObject+JSONHelpers.h 3 | // 4 | // Created by Saul Mora on 6/28/11. 5 | // Copyright 2011 Magical Panda Software LLC. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | extern NSString * const kMagicalRecordImportCustomDateFormatKey; 11 | extern NSString * const kMagicalRecordImportDefaultDateFormatString; 12 | extern NSString * const kMagicalRecordImportAttributeKeyMapKey; 13 | extern NSString * const kMagicalRecordImportAttributeValueClassNameKey; 14 | 15 | extern NSString * const kMagicalRecordImportRelationshipMapKey; 16 | extern NSString * const kMagicalRecordImportRelationshipLinkedByKey; 17 | extern NSString * const kMagicalRecordImportRelationshipTypeKey; 18 | 19 | @interface NSManagedObject (MagicalRecord_DataImport) 20 | 21 | - (BOOL) MR_importValuesForKeysWithObject:(id)objectData; 22 | 23 | + (id) MR_importFromObject:(id)data; 24 | + (id) MR_importFromObject:(id)data inContext:(NSManagedObjectContext *)context; 25 | 26 | + (NSArray *) MR_importFromArray:(NSArray *)listOfObjectData; 27 | + (NSArray *) MR_importFromArray:(NSArray *)listOfObjectData inContext:(NSManagedObjectContext *)context; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSEntityDescription+MagicalDataImport.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSEntityDescription+MagicalDataImport.m 3 | // Magical Record 4 | // 5 | // Created by Saul Mora on 9/5/11. 6 | // Copyright 2011 Magical Panda Software LLC. All rights reserved. 7 | // 8 | 9 | #import "CoreData+MagicalRecord.h" 10 | 11 | @implementation NSEntityDescription (MagicalRecord_DataImport) 12 | 13 | - (NSAttributeDescription *) MR_primaryAttributeToRelateBy; 14 | { 15 | NSString *lookupKey = [[self userInfo] valueForKey:kMagicalRecordImportRelationshipLinkedByKey] ?: primaryKeyNameFromString([self name]); 16 | NSDictionary *attributesByName = [self attributesByName]; 17 | 18 | if ([attributesByName count] == 0) return nil; 19 | 20 | NSAttributeDescription *primaryAttribute = [attributesByName objectForKey:lookupKey]; 21 | 22 | return primaryAttribute; 23 | } 24 | 25 | - (NSManagedObject *) MR_createInstanceInContext:(NSManagedObjectContext *)context; 26 | { 27 | Class relatedClass = NSClassFromString([self managedObjectClassName]); 28 | NSManagedObject *newInstance = [relatedClass MR_createInContext:context]; 29 | 30 | return newInstance; 31 | } 32 | 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /SimpleChat/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "size" : "60x60", 15 | "idiom" : "iphone", 16 | "filename" : "Chat-icon-1106010101.png", 17 | "scale" : "2x" 18 | }, 19 | { 20 | "idiom" : "ipad", 21 | "size" : "29x29", 22 | "scale" : "1x" 23 | }, 24 | { 25 | "idiom" : "ipad", 26 | "size" : "29x29", 27 | "scale" : "2x" 28 | }, 29 | { 30 | "idiom" : "ipad", 31 | "size" : "40x40", 32 | "scale" : "1x" 33 | }, 34 | { 35 | "idiom" : "ipad", 36 | "size" : "40x40", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "76x76", 41 | "idiom" : "ipad", 42 | "filename" : "Chat-icon-1106010101-2.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "76x76", 47 | "idiom" : "ipad", 48 | "filename" : "Chat-icon-1106010101-1.png", 49 | "scale" : "2x" 50 | } 51 | ], 52 | "info" : { 53 | "version" : 1, 54 | "author" : "xcode" 55 | } 56 | } -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Classes/JSMessageSoundEffect.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.hexedbits.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSMessagesViewController 8 | // 9 | // 10 | // The MIT License 11 | // Copyright (c) 2013 Jesse Squires 12 | // http://opensource.org/licenses/MIT 13 | // 14 | 15 | #import 16 | 17 | /** 18 | * `JSMessageSoundEffect` is a class that encapsulates the playing of the default sound effects for sending and receiving messages in `JSMessagesViewController`. It is backed by an instance of `JSQSystemSoundPlayer`. 19 | */ 20 | @interface JSMessageSoundEffect : NSObject 21 | 22 | /** 23 | * Plays the default sound for received messages. 24 | */ 25 | + (void)playMessageReceivedSound; 26 | 27 | /** 28 | * Plays the default sound for received messages *as an alert*, invoking device vibration if available. 29 | */ 30 | + (void)playMessageReceivedAlert; 31 | 32 | /** 33 | * Plays the default sound for sent messages. 34 | */ 35 | + (void)playMessageSentSound; 36 | 37 | /** 38 | * Plays the default sound for sent messages *as an alert*, invoking device vibration if available. 39 | */ 40 | + (void)playMessageSentAlert; 41 | 42 | @end -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalRecord.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSManagedObjectContext+MagicalRecord.h 3 | // 4 | // Created by Saul Mora on 11/23/09. 5 | // Copyright 2010 Magical Panda Software, LLC All rights reserved. 6 | // 7 | 8 | #import "MagicalRecord.h" 9 | 10 | extern NSString * const kMagicalRecordDidMergeChangesFromiCloudNotification; 11 | 12 | @interface NSManagedObjectContext (MagicalRecord) 13 | 14 | + (void) MR_initializeDefaultContextWithCoordinator:(NSPersistentStoreCoordinator *)coordinator; 15 | 16 | + (NSManagedObjectContext *) MR_context NS_RETURNS_RETAINED; 17 | + (NSManagedObjectContext *) MR_contextWithParent:(NSManagedObjectContext *)parentContext NS_RETURNS_RETAINED; 18 | + (NSManagedObjectContext *) MR_newMainQueueContext NS_RETURNS_RETAINED; 19 | + (NSManagedObjectContext *) MR_contextWithStoreCoordinator:(NSPersistentStoreCoordinator *)coordinator NS_RETURNS_RETAINED; 20 | 21 | + (void) MR_resetDefaultContext; 22 | + (NSManagedObjectContext *) MR_rootSavingContext; 23 | + (NSManagedObjectContext *) MR_defaultContext; 24 | 25 | - (NSString *) MR_description; 26 | - (NSString *) MR_parentChain; 27 | 28 | @property (nonatomic, copy, setter = MR_setWorkingName:) NSString *MR_workingName; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Pods/Pods-environment.h: -------------------------------------------------------------------------------- 1 | 2 | // To check if a library is compiled with CocoaPods you 3 | // can use the `COCOAPODS` macro definition which is 4 | // defined in the xcconfigs so it is available in 5 | // headers also when they are imported in the client 6 | // project. 7 | 8 | 9 | // JSMessagesViewController 10 | #define COCOAPODS_POD_AVAILABLE_JSMessagesViewController 11 | #define COCOAPODS_VERSION_MAJOR_JSMessagesViewController 4 12 | #define COCOAPODS_VERSION_MINOR_JSMessagesViewController 0 13 | #define COCOAPODS_VERSION_PATCH_JSMessagesViewController 4 14 | 15 | // JSQSystemSoundPlayer 16 | #define COCOAPODS_POD_AVAILABLE_JSQSystemSoundPlayer 17 | #define COCOAPODS_VERSION_MAJOR_JSQSystemSoundPlayer 1 18 | #define COCOAPODS_VERSION_MINOR_JSQSystemSoundPlayer 5 19 | #define COCOAPODS_VERSION_PATCH_JSQSystemSoundPlayer 2 20 | 21 | // MagicalRecord 22 | #define COCOAPODS_POD_AVAILABLE_MagicalRecord 23 | #define COCOAPODS_VERSION_MAJOR_MagicalRecord 2 24 | #define COCOAPODS_VERSION_MINOR_MagicalRecord 2 25 | #define COCOAPODS_VERSION_PATCH_MagicalRecord 0 26 | 27 | // MagicalRecord/Core 28 | #define COCOAPODS_POD_AVAILABLE_MagicalRecord_Core 29 | #define COCOAPODS_VERSION_MAJOR_MagicalRecord_Core 2 30 | #define COCOAPODS_VERSION_MINOR_MagicalRecord_Core 2 31 | #define COCOAPODS_VERSION_PATCH_MagicalRecord_Core 0 32 | 33 | -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+Options.h: -------------------------------------------------------------------------------- 1 | // 2 | // MagicalRecord+Options.h 3 | // Magical Record 4 | // 5 | // Created by Saul Mora on 3/6/12. 6 | // Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. 7 | // 8 | 9 | #import "MagicalRecord.h" 10 | 11 | @interface MagicalRecord (Options) 12 | 13 | //global options 14 | // enable/disable logging 15 | // add logging provider 16 | // autocreate new PSC per Store 17 | // autoassign new instances to default store 18 | 19 | + (BOOL) shouldAutoCreateManagedObjectModel; 20 | + (void) setShouldAutoCreateManagedObjectModel:(BOOL)shouldAutoCreate; 21 | + (BOOL) shouldAutoCreateDefaultPersistentStoreCoordinator; 22 | + (void) setShouldAutoCreateDefaultPersistentStoreCoordinator:(BOOL)shouldAutoCreate; 23 | + (void) setShouldDeleteStoreOnModelMismatch:(BOOL)shouldDeleteStoreOnModelMismatch; 24 | 25 | /*! 26 | @method shouldDeleteStoreOnModelMistmatch 27 | @abstract If true, when configuring the persistant store coordinator, and Magical Record encounters a store that does not match the model, it will attempt to remove it and re-create a new store. 28 | This is extremely useful during development where every model change could potentially require a delete/reinstall of the app. 29 | */ 30 | + (BOOL) shouldDeleteStoreOnModelMismatch; 31 | 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /SimpleChat/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "orientation" : "portrait", 20 | "idiom" : "ipad", 21 | "extent" : "full-screen", 22 | "minimum-system-version" : "7.0", 23 | "scale" : "1x" 24 | }, 25 | { 26 | "orientation" : "landscape", 27 | "idiom" : "ipad", 28 | "extent" : "full-screen", 29 | "minimum-system-version" : "7.0", 30 | "scale" : "1x" 31 | }, 32 | { 33 | "orientation" : "portrait", 34 | "idiom" : "ipad", 35 | "extent" : "full-screen", 36 | "minimum-system-version" : "7.0", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "orientation" : "landscape", 41 | "idiom" : "ipad", 42 | "extent" : "full-screen", 43 | "minimum-system-version" : "7.0", 44 | "scale" : "2x" 45 | } 46 | ], 47 | "info" : { 48 | "version" : 1, 49 | "author" : "xcode" 50 | } 51 | } -------------------------------------------------------------------------------- /SimpleChat/SenderBuddyDataManager.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BuddyDataManager.swift 3 | // SimpleChat 4 | // 5 | // Created by alexbutenko on 7/15/14. 6 | // Copyright (c) 2014 alexbutenko. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class SenderBuddyDataManager { 12 | 13 | struct SingleInstance { 14 | static let sharedUserDataManager: SenderBuddyDataManager = { 15 | let userDataManager = SenderBuddyDataManager() 16 | 17 | return userDataManager 18 | }() 19 | } 20 | 21 | class var sharedInstance: SenderBuddyDataManager { 22 | return SingleInstance.sharedUserDataManager 23 | } 24 | 25 | var persistedBuddy:Buddy? 26 | 27 | func setup(#buddy:BuddyPlainObject) { 28 | //check persisted current user 29 | 30 | persistedBuddy = Buddy.MR_findFirstByAttribute("serverID", withValue: buddy.serverID) as? Buddy 31 | 32 | if persistedBuddy == nil { 33 | 34 | println("persisting user \(buddy.name) \(buddy.serverID)") 35 | persistedBuddy = Buddy.MR_createEntity() as? Buddy 36 | 37 | persistedBuddy!.name = buddy.name 38 | persistedBuddy!.serverID = buddy.serverID 39 | 40 | NSManagedObjectContext.MR_contextForCurrentThread().MR_saveToPersistentStoreAndWait() 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalThreading.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSManagedObjectContext+MagicalThreading.m 3 | // Magical Record 4 | // 5 | // Created by Saul Mora on 3/9/12. 6 | // Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. 7 | // 8 | 9 | #import "NSManagedObjectContext+MagicalThreading.h" 10 | #import "NSManagedObject+MagicalRecord.h" 11 | #import "NSManagedObjectContext+MagicalRecord.h" 12 | 13 | static NSString const * kMagicalRecordManagedObjectContextKey = @"MagicalRecord_NSManagedObjectContextForThreadKey"; 14 | 15 | @implementation NSManagedObjectContext (MagicalThreading) 16 | 17 | + (void)MR_resetContextForCurrentThread 18 | { 19 | [[NSManagedObjectContext MR_contextForCurrentThread] reset]; 20 | } 21 | 22 | + (NSManagedObjectContext *) MR_contextForCurrentThread; 23 | { 24 | if ([NSThread isMainThread]) 25 | { 26 | return [self MR_defaultContext]; 27 | } 28 | else 29 | { 30 | NSMutableDictionary *threadDict = [[NSThread currentThread] threadDictionary]; 31 | NSManagedObjectContext *threadContext = [threadDict objectForKey:kMagicalRecordManagedObjectContextKey]; 32 | if (threadContext == nil) 33 | { 34 | threadContext = [self MR_contextWithParent:[NSManagedObjectContext MR_defaultContext]]; 35 | [threadDict setObject:threadContext forKey:kMagicalRecordManagedObjectContextKey]; 36 | } 37 | return threadContext; 38 | } 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /Pods/MagicalRecord/README.md: -------------------------------------------------------------------------------- 1 | # ![Awesome](https://github.com/magicalpanda/magicalpanda.github.com/blob/master/images/awesome_logo_small.png?raw=true) MagicalRecord 2 | 3 | In software engineering, the active record pattern is a design pattern found in software that stores its data in relational databases. It was named by Martin Fowler in his book Patterns of Enterprise Application Architecture. The interface to such an object would include functions such as Insert, Update, and Delete, plus properties that correspond more-or-less directly to the columns in the underlying database table. 4 | 5 | > Active record is an approach to accessing data in a database. A database table or view is wrapped into a class; thus an object instance is tied to a single row in the table. After creation of an object, a new row is added to the table upon save. Any object loaded gets its information from the database; when an object is updated, the corresponding row in the table is also updated. The wrapper class implements accessor methods or properties for each column in the table or view. 6 | 7 | > *- [Wikipedia]("http://en.wikipedia.org/wiki/Active_record_pattern")* 8 | 9 | MagicalRecord was inspired by the ease of Ruby on Rails' Active Record fetching. The goals of this code are: 10 | 11 | * Clean up my Core Data related code 12 | * Allow for clear, simple, one-line fetches 13 | * Still allow the modification of the NSFetchRequest when request optimizations are needed 14 | 15 | 16 | -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+Options.m: -------------------------------------------------------------------------------- 1 | // 2 | // MagicalRecord+Options.m 3 | // Magical Record 4 | // 5 | // Created by Saul Mora on 3/6/12. 6 | // Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. 7 | // 8 | 9 | #import "MagicalRecord+Options.h" 10 | 11 | static BOOL shouldAutoCreateManagedObjectModel_; 12 | static BOOL shouldAutoCreateDefaultPersistentStoreCoordinator_; 13 | static BOOL shouldDeleteStoreOnModelMismatch_; 14 | 15 | @implementation MagicalRecord (Options) 16 | 17 | #pragma mark - Options 18 | 19 | + (BOOL) shouldAutoCreateManagedObjectModel; 20 | { 21 | return shouldAutoCreateManagedObjectModel_; 22 | } 23 | 24 | + (void) setShouldAutoCreateManagedObjectModel:(BOOL)shouldAutoCreate; 25 | { 26 | shouldAutoCreateManagedObjectModel_ = shouldAutoCreate; 27 | } 28 | 29 | + (BOOL) shouldAutoCreateDefaultPersistentStoreCoordinator; 30 | { 31 | return shouldAutoCreateDefaultPersistentStoreCoordinator_; 32 | } 33 | 34 | + (void) setShouldAutoCreateDefaultPersistentStoreCoordinator:(BOOL)shouldAutoCreate; 35 | { 36 | shouldAutoCreateDefaultPersistentStoreCoordinator_ = shouldAutoCreate; 37 | } 38 | 39 | + (BOOL) shouldDeleteStoreOnModelMismatch; 40 | { 41 | return shouldDeleteStoreOnModelMismatch_; 42 | } 43 | 44 | + (void) setShouldDeleteStoreOnModelMismatch:(BOOL)shouldDeleteStoreOnModelMismatch 45 | { 46 | shouldDeleteStoreOnModelMismatch_ = shouldDeleteStoreOnModelMismatch; 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord.h: -------------------------------------------------------------------------------- 1 | // 2 | // MagicalRecord.h 3 | // 4 | // Created by Saul Mora on 3/11/10. 5 | // Copyright 2010 Magical Panda Software, LLC All rights reserved. 6 | // 7 | 8 | #if TARGET_OS_IPHONE == 0 9 | #define MAC_PLATFORM_ONLY YES 10 | #endif 11 | 12 | // enable to use caches for the fetchedResultsControllers (iOS only) 13 | // #define STORE_USE_CACHE 14 | 15 | #ifndef MR_ENABLE_ACTIVE_RECORD_LOGGING 16 | #ifdef DEBUG 17 | #define MR_ENABLE_ACTIVE_RECORD_LOGGING 0 18 | #else 19 | #define MR_ENABLE_ACTIVE_RECORD_LOGGING 0 20 | #endif 21 | #endif 22 | 23 | #if MR_ENABLE_ACTIVE_RECORD_LOGGING != 0 24 | // First, check if we can use Cocoalumberjack for logging 25 | #ifdef LOG_VERBOSE 26 | extern int ddLogLevel; 27 | #define MRLog(...) DDLogVerbose(__VA_ARGS__) 28 | #else 29 | #define MRLog(...) NSLog(@"%s(%p) %@", __PRETTY_FUNCTION__, self, [NSString stringWithFormat:__VA_ARGS__]) 30 | #endif 31 | #else 32 | #define MRLog(...) ((void)0) 33 | #endif 34 | 35 | #ifdef NS_BLOCKS_AVAILABLE 36 | 37 | @class NSManagedObjectContext; 38 | typedef void (^CoreDataBlock)(NSManagedObjectContext *context); 39 | 40 | #endif 41 | 42 | @interface MagicalRecord : NSObject 43 | 44 | + (NSString *) currentStack; 45 | 46 | + (void) cleanUp; 47 | 48 | + (void) setDefaultModelFromClass:(Class)klass; 49 | + (void) setDefaultModelNamed:(NSString *)modelName; 50 | + (NSString *) defaultStoreName; 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Classes/JSMessageSoundEffect.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.hexedbits.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSMessagesViewController 8 | // 9 | // 10 | // The MIT License 11 | // Copyright (c) 2013 Jesse Squires 12 | // http://opensource.org/licenses/MIT 13 | // 14 | 15 | #import "JSMessageSoundEffect.h" 16 | #import 17 | 18 | static NSString * const kJSMessageReceived = @"message-received"; 19 | static NSString * const kJSMessageSent = @"message-sent"; 20 | 21 | @implementation JSMessageSoundEffect 22 | 23 | + (void)playMessageReceivedSound 24 | { 25 | [[JSQSystemSoundPlayer sharedPlayer] playSoundWithName:kJSMessageReceived 26 | extension:kJSQSystemSoundTypeAIFF]; 27 | } 28 | 29 | + (void)playMessageReceivedAlert 30 | { 31 | [[JSQSystemSoundPlayer sharedPlayer] playAlertSoundWithName:kJSMessageReceived 32 | extension:kJSQSystemSoundTypeAIFF]; 33 | } 34 | 35 | + (void)playMessageSentSound 36 | { 37 | [[JSQSystemSoundPlayer sharedPlayer] playSoundWithName:kJSMessageSent 38 | extension:kJSQSystemSoundTypeAIFF]; 39 | } 40 | 41 | + (void)playMessageSentAlert 42 | { 43 | [[JSQSystemSoundPlayer sharedPlayer] playAlertSoundWithName:kJSMessageSent 44 | extension:kJSQSystemSoundTypeAIFF]; 45 | } 46 | 47 | @end -------------------------------------------------------------------------------- /SimpleChat/SimpleChat.xcdatamodeld/SimpleChat.xcdatamodel/contents: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalAggregation.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSManagedObject+MagicalAggregation.h 3 | // Magical Record 4 | // 5 | // Created by Saul Mora on 3/7/12. 6 | // Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSManagedObject (MagicalAggregation) 12 | 13 | + (NSNumber *) MR_numberOfEntities; 14 | + (NSNumber *) MR_numberOfEntitiesWithContext:(NSManagedObjectContext *)context; 15 | + (NSNumber *) MR_numberOfEntitiesWithPredicate:(NSPredicate *)searchTerm; 16 | + (NSNumber *) MR_numberOfEntitiesWithPredicate:(NSPredicate *)searchTerm inContext:(NSManagedObjectContext *)context; 17 | 18 | + (NSUInteger) MR_countOfEntities; 19 | + (NSUInteger) MR_countOfEntitiesWithContext:(NSManagedObjectContext *)context; 20 | + (NSUInteger) MR_countOfEntitiesWithPredicate:(NSPredicate *)searchFilter; 21 | + (NSUInteger) MR_countOfEntitiesWithPredicate:(NSPredicate *)searchFilter inContext:(NSManagedObjectContext *)context; 22 | 23 | + (BOOL) MR_hasAtLeastOneEntity; 24 | + (BOOL) MR_hasAtLeastOneEntityInContext:(NSManagedObjectContext *)context; 25 | 26 | + (NSNumber *)MR_aggregateOperation:(NSString *)function onAttribute:(NSString *)attributeName withPredicate:(NSPredicate *)predicate inContext:(NSManagedObjectContext *)context; 27 | + (NSNumber *)MR_aggregateOperation:(NSString *)function onAttribute:(NSString *)attributeName withPredicate:(NSPredicate *)predicate; 28 | 29 | - (id) MR_objectWithMinValueFor:(NSString *)property; 30 | - (id) MR_objectWithMinValueFor:(NSString *)property inContext:(NSManagedObjectContext *)context; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Classes/Factories/JSAvatarImageFactory.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.hexedbits.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSMessagesViewController 8 | // 9 | // 10 | // The MIT License 11 | // Copyright (c) 2013 Jesse Squires 12 | // http://opensource.org/licenses/MIT 13 | // 14 | 15 | #import "JSAvatarImageFactory.h" 16 | #import "UIImage+JSMessagesView.h" 17 | 18 | CGFloat const kJSAvatarImageSize = 50.0f; 19 | 20 | @implementation JSAvatarImageFactory 21 | 22 | + (UIImage *)avatarImageNamed:(NSString *)filename 23 | croppedToCircle:(BOOL)croppedToCircle 24 | { 25 | UIImage *image = [UIImage imageNamed:filename]; 26 | return [self avatarImage:image croppedToCircle:croppedToCircle]; 27 | } 28 | 29 | + (UIImage *)avatarImage:(UIImage *)originalImage 30 | croppedToCircle:(BOOL)croppedToCircle 31 | { 32 | return [originalImage js_imageAsCircle:croppedToCircle 33 | withDiamter:kJSAvatarImageSize 34 | borderColor:nil 35 | borderWidth:0.0f 36 | shadowOffSet:CGSizeZero]; 37 | } 38 | 39 | + (UIImage *)classicAvatarImageNamed:(NSString *)filename 40 | croppedToCircle:(BOOL)croppedToCircle 41 | { 42 | UIImage *image = [UIImage imageNamed:filename]; 43 | return [image js_imageAsCircle:croppedToCircle 44 | withDiamter:kJSAvatarImageSize 45 | borderColor:[UIColor colorWithHue:0.0f saturation:0.0f brightness:0.8f alpha:1.0f] 46 | borderWidth:1.0f 47 | shadowOffSet:CGSizeMake(0.0f, 1.0f)]; 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /SimpleChat.xcworkspace/xcshareddata/SimpleChat.xcscmblueprint: -------------------------------------------------------------------------------- 1 | { 2 | "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "74D4683E27FD12F15D3B6D61320699DA21B1847A", 3 | "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { 4 | 5 | }, 6 | "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { 7 | "78441B81894877150C908A2B0E75D4ED010AD965" : 0, 8 | "74D4683E27FD12F15D3B6D61320699DA21B1847A" : 0 9 | }, 10 | "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "3510AFBC-3A96-4A71-A975-F3AAD9A7354B", 11 | "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { 12 | "78441B81894877150C908A2B0E75D4ED010AD965" : "ios-8-testing-code", 13 | "74D4683E27FD12F15D3B6D61320699DA21B1847A" : "SimpleChat" 14 | }, 15 | "DVTSourceControlWorkspaceBlueprintNameKey" : "SimpleChat", 16 | "DVTSourceControlWorkspaceBlueprintVersion" : 203, 17 | "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "SimpleChat.xcworkspace", 18 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ 19 | { 20 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/alexbutenko\/simplechat.git", 21 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 22 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "74D4683E27FD12F15D3B6D61320699DA21B1847A" 23 | }, 24 | { 25 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/bitbucket.org\/sushnz\/ios-8-testing-code.git", 26 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 27 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "78441B81894877150C908A2B0E75D4ED010AD965" 28 | } 29 | ] 30 | } -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Classes/JSMessage.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.hexedbits.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSMessagesViewController 8 | // 9 | // 10 | // The MIT License 11 | // Copyright (c) 2013 Jesse Squires 12 | // http://opensource.org/licenses/MIT 13 | // 14 | 15 | #import 16 | #import "JSMessageData.h" 17 | 18 | /** 19 | * A `JSMessage` object represents a single user message. This is a concrete class that implements the `JSMessageData` protocol. It contains the message text, its sender, and the date that the message was sent. 20 | */ 21 | @interface JSMessage : NSObject 22 | 23 | /** 24 | * The body text of the message. The default value is the empty string `@" "`. This value must not be `nil`. 25 | */ 26 | @property (copy, nonatomic) NSString *text; 27 | 28 | /** 29 | * The name of user who sent the message. The default value is `nil`. 30 | */ 31 | @property (copy, nonatomic) NSString *sender; 32 | 33 | /** 34 | * The date that the message was sent. The default value is `nil`. 35 | */ 36 | @property (strong, nonatomic) NSDate *date; 37 | 38 | #pragma mark - Initialization 39 | 40 | /** 41 | * Initializes and returns a message object having the given text, sender, and date. 42 | * 43 | * @param text The body text of the message. 44 | * @param sender The name of the user who sent the message. 45 | * @param date The date that the message was sent. 46 | * 47 | * @return An initialized `JSMessage` object or `nil` if the object could not be successfully initialized. 48 | */ 49 | - (instancetype)initWithText:(NSString *)text 50 | sender:(NSString *)sender 51 | date:(NSDate *)date; 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Classes/JSMessage.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.hexedbits.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSMessagesViewController 8 | // 9 | // 10 | // The MIT License 11 | // Copyright (c) 2013 Jesse Squires 12 | // http://opensource.org/licenses/MIT 13 | // 14 | 15 | #import "JSMessage.h" 16 | 17 | @implementation JSMessage 18 | 19 | #pragma mark - Initialization 20 | 21 | - (instancetype)initWithText:(NSString *)text 22 | sender:(NSString *)sender 23 | date:(NSDate *)date 24 | { 25 | self = [super init]; 26 | if (self) { 27 | _text = text ? text : @" "; 28 | _sender = sender; 29 | _date = date; 30 | } 31 | return self; 32 | } 33 | 34 | - (void)dealloc 35 | { 36 | _text = nil; 37 | _sender = nil; 38 | _date = nil; 39 | } 40 | 41 | #pragma mark - NSCoding 42 | 43 | - (id)initWithCoder:(NSCoder *)aDecoder 44 | { 45 | self = [super init]; 46 | if (self) { 47 | _text = [aDecoder decodeObjectForKey:@"text"]; 48 | _sender = [aDecoder decodeObjectForKey:@"sender"]; 49 | _date = [aDecoder decodeObjectForKey:@"date"]; 50 | } 51 | return self; 52 | } 53 | 54 | - (void)encodeWithCoder:(NSCoder *)aCoder 55 | { 56 | [aCoder encodeObject:self.text forKey:@"text"]; 57 | [aCoder encodeObject:self.sender forKey:@"sender"]; 58 | [aCoder encodeObject:self.date forKey:@"date"]; 59 | } 60 | 61 | #pragma mark - NSCopying 62 | 63 | - (id)copyWithZone:(NSZone *)zone 64 | { 65 | return [[[self class] allocWithZone:zone] initWithText:[self.text copy] 66 | sender:[self.sender copy] 67 | date:[self.date copy]]; 68 | } 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Classes/Categories/UIColor+JSMessagesView.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.hexedbits.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSMessagesViewController 8 | // 9 | // 10 | // The MIT License 11 | // Copyright (c) 2013 Jesse Squires 12 | // http://opensource.org/licenses/MIT 13 | // 14 | 15 | #import 16 | 17 | @interface UIColor (JSMessagesView) 18 | 19 | #pragma mark - Colors 20 | 21 | /** 22 | * @return A color object containing the RGB values for the iOS 6 messages app background color. 23 | */ 24 | + (UIColor *)js_backgroundColorClassic; 25 | 26 | /** 27 | * @return A color object containing the RGB values iOS 6 messages app timestamp text color. 28 | */ 29 | + (UIColor *)js_messagesTimestampColorClassic; 30 | 31 | #pragma mark - Bubble colors 32 | 33 | /** 34 | * @return A color object containing the HSB values iOS 7 messages app green bubble color. 35 | */ 36 | + (UIColor *)js_bubbleGreenColor; 37 | 38 | /** 39 | * @return A color object containing the HSB values iOS 7 messages app blue bubble color. 40 | */ 41 | + (UIColor *)js_bubbleBlueColor; 42 | 43 | /** 44 | * @return A color object containing the HSB values iOS 7 messages app light gray bubble color. 45 | */ 46 | + (UIColor *)js_bubbleLightGrayColor; 47 | 48 | #pragma mark - Utilities 49 | 50 | /** 51 | * Creates and returns a new color object whose brightness component is decreased by the given value, using the initial color values of the receiver. 52 | * 53 | * @param value A floating point value describing the amount by which to decrease the brightness of the receiver. 54 | * 55 | * @return A new color object whose brightness is decreased by the given values. The other color values remain the same as the receiver. 56 | */ 57 | - (UIColor *)js_darkenColorWithValue:(CGFloat)value; 58 | 59 | @end -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Classes/JSMessageTextView.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.hexedbits.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSMessagesViewController 8 | // 9 | // 10 | // The MIT License 11 | // Copyright (c) 2013 Jesse Squires 12 | // http://opensource.org/licenses/MIT 13 | // 14 | 15 | #import "JSDismissiveTextView.h" 16 | 17 | /** 18 | * An instance of `JSMessageTextView` is a means for displaying an input text view above a keyboard as a subview of a keyboard's `inputAccessoryView`. It is used for composing messages and adds support for a placeholder like UITextField. 19 | */ 20 | @interface JSMessageTextView : JSDismissiveTextView 21 | 22 | /** 23 | * The text to be displayed when the text view is empty. The default value is `nil`. 24 | */ 25 | @property (copy, nonatomic) NSString *placeHolder; 26 | 27 | /** 28 | * The color of the place holder text. The default value is `[UIColor lightGrayColor]`. 29 | */ 30 | @property (strong, nonatomic) UIColor *placeHolderTextColor; 31 | 32 | /** 33 | * Returns an unsigned integer describing the number of lines of text contained in the text view. 34 | * 35 | * @return The number of lines of text in the text view. 36 | */ 37 | - (NSUInteger)numberOfLinesOfText; 38 | 39 | /** 40 | * Returns a constant describing the maximum number of characters that can fit on a single line of the text view. 41 | * 42 | * @return The maximum number of characters per line in the text view. 43 | */ 44 | + (NSUInteger)maxCharactersPerLine; 45 | 46 | /** 47 | * Returns an unsigned integer describing the number of lines necessary to display the given text in the text view. 48 | * 49 | * @param text The text to be displayed in the text view. 50 | * 51 | * @return The number of lines needed to display the given text. 52 | */ 53 | + (NSUInteger)numberOfLinesForMessage:(NSString *)text; 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalRecord.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Created by Saul Mora on 11/15/09. 4 | // Copyright 2010 Magical Panda Software, LLC All rights reserved. 5 | // 6 | 7 | #import 8 | #import "MagicalRecord.h" 9 | 10 | #define kMagicalRecordDefaultBatchSize 20 11 | 12 | @interface NSManagedObject (MagicalRecord) 13 | 14 | + (NSUInteger) MR_defaultBatchSize; 15 | + (void) MR_setDefaultBatchSize:(NSUInteger)newBatchSize; 16 | 17 | + (NSArray *) MR_executeFetchRequest:(NSFetchRequest *)request; 18 | + (NSArray *) MR_executeFetchRequest:(NSFetchRequest *)request inContext:(NSManagedObjectContext *)context; 19 | + (id) MR_executeFetchRequestAndReturnFirstObject:(NSFetchRequest *)request; 20 | + (id) MR_executeFetchRequestAndReturnFirstObject:(NSFetchRequest *)request inContext:(NSManagedObjectContext *)context; 21 | 22 | #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR 23 | 24 | + (void) MR_performFetch:(NSFetchedResultsController *)controller; 25 | 26 | #endif 27 | 28 | + (NSEntityDescription *) MR_entityDescription; 29 | + (NSEntityDescription *) MR_entityDescriptionInContext:(NSManagedObjectContext *)context; 30 | + (NSArray *) MR_propertiesNamed:(NSArray *)properties; 31 | 32 | + (id) MR_createEntity; 33 | + (id) MR_createInContext:(NSManagedObjectContext *)context; 34 | - (BOOL) MR_deleteEntity; 35 | - (BOOL) MR_deleteInContext:(NSManagedObjectContext *)context; 36 | 37 | + (BOOL) MR_deleteAllMatchingPredicate:(NSPredicate *)predicate; 38 | + (BOOL) MR_deleteAllMatchingPredicate:(NSPredicate *)predicate inContext:(NSManagedObjectContext *)context; 39 | 40 | + (BOOL) MR_truncateAll; 41 | + (BOOL) MR_truncateAllInContext:(NSManagedObjectContext *)context; 42 | 43 | + (NSArray *) MR_ascendingSortDescriptors:(NSArray *)attributesToSortBy; 44 | + (NSArray *) MR_descendingSortDescriptors:(NSArray *)attributesToSortBy; 45 | 46 | - (id) MR_inContext:(NSManagedObjectContext *)otherContext; 47 | - (id) MR_inThreadContext; 48 | 49 | @end 50 | 51 | -------------------------------------------------------------------------------- /SimpleChat/BuddiesViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // SimpleChat 4 | // 5 | // Created by alexbutenko on 6/10/14. 6 | // Copyright (c) 2014 alexbutenko. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class BuddiesViewController: JSMessagesViewController { 12 | 13 | lazy var viewModel:BuddiesViewModel = BuddiesViewModel() 14 | 15 | @IBOutlet var activityIndicator: UIActivityIndicatorView? 16 | 17 | override func viewDidLoad() { 18 | viewModel.onDidLoadData = {isInitial in 19 | if isInitial { 20 | self.activityIndicator!.stopAnimating() 21 | self.tableView.reloadData() 22 | } 23 | 24 | self.scrollToBottomAnimated(false) 25 | } 26 | 27 | viewModel.onDidSendMessage = { 28 | self.finishSend() 29 | self.scrollToBottomAnimated(true) 30 | } 31 | 32 | self.delegate = viewModel 33 | self.dataSource = viewModel 34 | 35 | super.viewDidLoad() 36 | 37 | viewModel.tableView = tableView 38 | 39 | view.bringSubviewToFront(activityIndicator!) 40 | 41 | JSBubbleView.appearance().font = UIFont.systemFontOfSize(16.0) 42 | 43 | title = "Messages"; 44 | messageInputView.textView.placeHolder = "New Message"; 45 | 46 | setBackgroundColor(UIColor.whiteColor()) 47 | } 48 | 49 | override func didReceiveMemoryWarning() { 50 | super.didReceiveMemoryWarning() 51 | // Dispose of any resources that can be recreated. 52 | } 53 | 54 | // MARK: UITableViewDataSource 55 | 56 | override func tableView(_: UITableView, numberOfRowsInSection section: Int) -> Int { 57 | // Don't show anything if the document hasn't been loaded. 58 | // We show the items in a list, plus a separate row that lets users enter a new item. 59 | return viewModel.messages.count 60 | } 61 | } 62 | 63 | -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalRequests.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSManagedObject+MagicalRequests.h 3 | // Magical Record 4 | // 5 | // Created by Saul Mora on 3/7/12. 6 | // Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSManagedObject (MagicalRequests) 12 | 13 | + (NSFetchRequest *) MR_createFetchRequest; 14 | + (NSFetchRequest *) MR_createFetchRequestInContext:(NSManagedObjectContext *)context; 15 | 16 | + (NSFetchRequest *) MR_requestAll; 17 | + (NSFetchRequest *) MR_requestAllInContext:(NSManagedObjectContext *)context; 18 | + (NSFetchRequest *) MR_requestAllWithPredicate:(NSPredicate *)searchTerm; 19 | + (NSFetchRequest *) MR_requestAllWithPredicate:(NSPredicate *)searchTerm inContext:(NSManagedObjectContext *)context; 20 | + (NSFetchRequest *) MR_requestAllWhere:(NSString *)property isEqualTo:(id)value; 21 | + (NSFetchRequest *) MR_requestAllWhere:(NSString *)property isEqualTo:(id)value inContext:(NSManagedObjectContext *)context; 22 | + (NSFetchRequest *) MR_requestFirstWithPredicate:(NSPredicate *)searchTerm; 23 | + (NSFetchRequest *) MR_requestFirstWithPredicate:(NSPredicate *)searchTerm inContext:(NSManagedObjectContext *)context; 24 | + (NSFetchRequest *) MR_requestFirstByAttribute:(NSString *)attribute withValue:(id)searchValue; 25 | + (NSFetchRequest *) MR_requestFirstByAttribute:(NSString *)attribute withValue:(id)searchValue inContext:(NSManagedObjectContext *)context; 26 | + (NSFetchRequest *) MR_requestAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending; 27 | + (NSFetchRequest *) MR_requestAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending inContext:(NSManagedObjectContext *)context; 28 | + (NSFetchRequest *) MR_requestAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending withPredicate:(NSPredicate *)searchTerm; 29 | + (NSFetchRequest *) MR_requestAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending withPredicate:(NSPredicate *)searchTerm inContext:(NSManagedObjectContext *)context; 30 | 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+Setup.m: -------------------------------------------------------------------------------- 1 | // 2 | // MagicalRecord+Setup.m 3 | // Magical Record 4 | // 5 | // Created by Saul Mora on 3/7/12. 6 | // Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. 7 | // 8 | 9 | #import "MagicalRecord+Setup.h" 10 | #import "NSManagedObject+MagicalRecord.h" 11 | #import "NSPersistentStoreCoordinator+MagicalRecord.h" 12 | #import "NSManagedObjectContext+MagicalRecord.h" 13 | 14 | @implementation MagicalRecord (Setup) 15 | 16 | + (void) setupCoreDataStack 17 | { 18 | [self setupCoreDataStackWithStoreNamed:[self defaultStoreName]]; 19 | } 20 | 21 | + (void) setupAutoMigratingCoreDataStack 22 | { 23 | [self setupCoreDataStackWithAutoMigratingSqliteStoreNamed:[self defaultStoreName]]; 24 | } 25 | 26 | + (void) setupCoreDataStackWithStoreNamed:(NSString *)storeName 27 | { 28 | if ([NSPersistentStoreCoordinator MR_defaultStoreCoordinator] != nil) return; 29 | 30 | NSPersistentStoreCoordinator *coordinator = [NSPersistentStoreCoordinator MR_coordinatorWithSqliteStoreNamed:storeName]; 31 | [NSPersistentStoreCoordinator MR_setDefaultStoreCoordinator:coordinator]; 32 | 33 | [NSManagedObjectContext MR_initializeDefaultContextWithCoordinator:coordinator]; 34 | } 35 | 36 | + (void) setupCoreDataStackWithAutoMigratingSqliteStoreNamed:(NSString *)storeName 37 | { 38 | if ([NSPersistentStoreCoordinator MR_defaultStoreCoordinator] != nil) return; 39 | 40 | NSPersistentStoreCoordinator *coordinator = [NSPersistentStoreCoordinator MR_coordinatorWithAutoMigratingSqliteStoreNamed:storeName]; 41 | [NSPersistentStoreCoordinator MR_setDefaultStoreCoordinator:coordinator]; 42 | 43 | [NSManagedObjectContext MR_initializeDefaultContextWithCoordinator:coordinator]; 44 | } 45 | 46 | + (void) setupCoreDataStackWithInMemoryStore; 47 | { 48 | if ([NSPersistentStoreCoordinator MR_defaultStoreCoordinator] != nil) return; 49 | 50 | NSPersistentStoreCoordinator *coordinator = [NSPersistentStoreCoordinator MR_coordinatorWithInMemoryStore]; 51 | [NSPersistentStoreCoordinator MR_setDefaultStoreCoordinator:coordinator]; 52 | 53 | [NSManagedObjectContext MR_initializeDefaultContextWithCoordinator:coordinator]; 54 | } 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+Actions.h: -------------------------------------------------------------------------------- 1 | // 2 | // MagicalRecord+Actions.h 3 | // 4 | // Created by Saul Mora on 2/24/11. 5 | // Copyright 2011 Magical Panda Software. All rights reserved. 6 | // 7 | 8 | #import 9 | #import "NSManagedObjectContext+MagicalRecord.h" 10 | #import "NSManagedObjectContext+MagicalSaves.h" 11 | 12 | @interface MagicalRecord (Actions) 13 | 14 | /* For all background saving operations. These calls will be sent to a different thread/queue. 15 | */ 16 | + (void) saveWithBlock:(void(^)(NSManagedObjectContext *localContext))block; 17 | + (void) saveWithBlock:(void(^)(NSManagedObjectContext *localContext))block completion:(MRSaveCompletionHandler)completion; 18 | 19 | /* For saving on the current thread as the caller, only with a seperate context. Useful when you're managing your own threads/queues and need a serial call to create or change data 20 | */ 21 | + (void) saveWithBlockAndWait:(void(^)(NSManagedObjectContext *localContext))block; 22 | 23 | /* 24 | If you want to reuse the context on the current thread, use these methods. 25 | */ 26 | + (void) saveUsingCurrentThreadContextWithBlock:(void (^)(NSManagedObjectContext *localContext))block completion:(MRSaveCompletionHandler)completion; 27 | + (void) saveUsingCurrentThreadContextWithBlockAndWait:(void (^)(NSManagedObjectContext *localContext))block; 28 | 29 | 30 | /* DEPRECATION NOTICE: 31 | * The following methods are deprecated, but remain in place for backwards compatibility until the next major version (3.x) 32 | */ 33 | 34 | /* For all background saving operations. These calls will be sent to a different thread/queue. 35 | */ 36 | + (void) saveInBackgroundWithBlock:(void(^)(NSManagedObjectContext *localContext))block __attribute__((deprecated)); 37 | + (void) saveInBackgroundWithBlock:(void(^)(NSManagedObjectContext *localContext))block completion:(void(^)(void))completion __attribute__((deprecated)); 38 | 39 | /* 40 | If you want to reuse the context on the current thread, use this method. 41 | */ 42 | + (void) saveInBackgroundUsingCurrentContextWithBlock:(void (^)(NSManagedObjectContext *localContext))block completion:(void (^)(void))completion errorHandler:(void (^)(NSError *error))errorHandler __attribute__((deprecated)); 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /SimpleChat.xcworkspace/xcshareddata/SimpleChat.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 3510AFBC-3A96-4A71-A975-F3AAD9A7354B 9 | IDESourceControlProjectName 10 | SimpleChat 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 74D4683E27FD12F15D3B6D61320699DA21B1847A 14 | https://github.com/alexbutenko/simplechat.git 15 | 78441B81894877150C908A2B0E75D4ED010AD965 16 | https://bitbucket.org/sushnz/ios-8-testing-code.git 17 | 18 | IDESourceControlProjectPath 19 | SimpleChat.xcworkspace 20 | IDESourceControlProjectRelativeInstallPathDictionary 21 | 22 | 74D4683E27FD12F15D3B6D61320699DA21B1847A 23 | .. 24 | 78441B81894877150C908A2B0E75D4ED010AD965 25 | ../../ios-8-testing-code 26 | 27 | IDESourceControlProjectURL 28 | https://github.com/alexbutenko/simplechat.git 29 | IDESourceControlProjectVersion 30 | 111 31 | IDESourceControlProjectWCCIdentifier 32 | 74D4683E27FD12F15D3B6D61320699DA21B1847A 33 | IDESourceControlProjectWCConfigurations 34 | 35 | 36 | IDESourceControlRepositoryExtensionIdentifierKey 37 | public.vcs.git 38 | IDESourceControlWCCIdentifierKey 39 | 78441B81894877150C908A2B0E75D4ED010AD965 40 | IDESourceControlWCCName 41 | ios-8-testing-code 42 | 43 | 44 | IDESourceControlRepositoryExtensionIdentifierKey 45 | public.vcs.git 46 | IDESourceControlWCCIdentifierKey 47 | 74D4683E27FD12F15D3B6D61320699DA21B1847A 48 | IDESourceControlWCCName 49 | SimpleChat 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSAttributeDescription+MagicalDataImport.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSAttributeDescription+MagicalDataImport.m 3 | // Magical Record 4 | // 5 | // Created by Saul Mora on 9/4/11. 6 | // Copyright 2011 Magical Panda Software LLC. All rights reserved. 7 | // 8 | 9 | #import "NSAttributeDescription+MagicalDataImport.h" 10 | #import "NSManagedObject+MagicalDataImport.h" 11 | #import "MagicalImportFunctions.h" 12 | 13 | @implementation NSAttributeDescription (MagicalRecord_DataImport) 14 | 15 | - (NSString *) MR_primaryKey; 16 | { 17 | return nil; 18 | } 19 | 20 | - (id) MR_valueForKeyPath:(NSString *)keyPath fromObjectData:(id)objectData; 21 | { 22 | id value = [objectData valueForKeyPath:keyPath]; 23 | 24 | NSAttributeType attributeType = [self attributeType]; 25 | NSString *desiredAttributeType = [[self userInfo] valueForKey:kMagicalRecordImportAttributeValueClassNameKey]; 26 | if (desiredAttributeType) 27 | { 28 | if ([desiredAttributeType hasSuffix:@"Color"]) 29 | { 30 | value = colorFromString(value); 31 | } 32 | } 33 | else 34 | { 35 | if (attributeType == NSDateAttributeType) 36 | { 37 | if (![value isKindOfClass:[NSDate class]]) 38 | { 39 | NSString *dateFormat = [[self userInfo] valueForKey:kMagicalRecordImportCustomDateFormatKey]; 40 | value = dateFromString([value description], dateFormat ?: kMagicalRecordImportDefaultDateFormatString); 41 | } 42 | // value = adjustDateForDST(value); 43 | } 44 | else if (attributeType == NSInteger16AttributeType || 45 | attributeType == NSInteger32AttributeType || 46 | attributeType == NSInteger64AttributeType || 47 | attributeType == NSDecimalAttributeType || 48 | attributeType == NSDoubleAttributeType || 49 | attributeType == NSFloatAttributeType) { 50 | if (![value isKindOfClass:[NSNumber class]] && value != [NSNull null]) { 51 | value = numberFromString([value description]); 52 | } 53 | } 54 | } 55 | 56 | return value == [NSNull null] ? nil : value; 57 | } 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Classes/JSDismissiveTextView.h: -------------------------------------------------------------------------------- 1 | // 2 | // Taken from MADismissiveTextView 3 | // https://github.com/mikeahmarani/MADismissiveTextView 4 | // 5 | // Created by Mike Ahmarani on 12-02-18. 6 | // Copyright (c) 2012 Mike Ahmarani. All rights reserved. 7 | // 8 | // 9 | // Documentation 10 | // http://cocoadocs.org/docsets/JSMessagesViewController 11 | // 12 | // 13 | // The MIT License 14 | // Copyright (c) 2013 Jesse Squires 15 | // http://opensource.org/licenses/MIT 16 | // 17 | 18 | #import 19 | 20 | /** 21 | * The delegate of a `JSDismissiveTextView` object must adopt the `JSDismissiveTextViewDelegate` protocol. 22 | */ 23 | @protocol JSDismissiveTextViewDelegate 24 | 25 | @optional 26 | /** 27 | * Tells the delegate that the keyboard has full appeared on screen. 28 | */ 29 | - (void)keyboardDidShow; 30 | 31 | /** 32 | * Tells the delegate that the keyboard origin has moved to the specified point. 33 | * 34 | * @param point The origin of the keyboard's frame in its superview's coordinate system. 35 | */ 36 | - (void)keyboardDidScrollToPoint:(CGPoint)point; 37 | 38 | /** 39 | * Tells the delegate that the keyboard is about to be dismissed. The keyboard will be removed from from its superview and resign first responder. 40 | */ 41 | - (void)keyboardWillBeDismissed; 42 | 43 | /** 44 | * Tells the delegate that the keyboard origin is about to move back to the specified point. 45 | * 46 | * @param point The new origin of the keyboard's frame after it has completed animation. 47 | */ 48 | - (void)keyboardWillSnapBackToPoint:(CGPoint)point; 49 | 50 | @end 51 | 52 | 53 | /** 54 | * An instance of `JSDismissiveTextView` is a means for displaying a text view that is contained as a subview of the keyboard's `inputAccessoryView` and responds to a pan gesture to dismiss the keyboard and end editing. 55 | */ 56 | @interface JSDismissiveTextView : UITextView 57 | 58 | /** 59 | * The object that acts as the delegate of the receiving text view. 60 | */ 61 | @property (weak, nonatomic) id keyboardDelegate; 62 | 63 | /** 64 | * The pan gesture recognizer for the text view. 65 | */ 66 | @property (strong, nonatomic) UIPanGestureRecognizer *dismissivePanGestureRecognizer; 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/alexbutenko.xcuserdatad/xcschemes/Pods.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 42 | 43 | 44 | 45 | 51 | 52 | 54 | 55 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/alexbutenko.xcuserdatad/xcschemes/Pods-MagicalRecord.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 42 | 43 | 44 | 45 | 51 | 52 | 54 | 55 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/alexbutenko.xcuserdatad/xcschemes/Pods-JSQSystemSoundPlayer.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 42 | 43 | 44 | 45 | 51 | 52 | 54 | 55 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/CoreData+MagicalRecord.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef NS_BLOCKS_AVAILABLE 3 | #warning MagicalRecord requires blocks 4 | #endif 5 | 6 | #ifdef __OBJC__ 7 | // #if !( __has_feature(objc_arc) && __has_feature(objc_arc_weak) ) 8 | // #error MagicalRecord now requires ARC to be enabled 9 | // #endif 10 | 11 | #import 12 | #import 13 | 14 | #ifdef MR_SHORTHAND 15 | #import "MagicalRecordShorthand.h" 16 | #endif 17 | 18 | #import "MagicalRecord.h" 19 | #import "MagicalRecord+Actions.h" 20 | #import "MagicalRecord+ErrorHandling.h" 21 | #import "MagicalRecord+Options.h" 22 | #import "MagicalRecord+ShorthandSupport.h" 23 | #import "MagicalRecord+Setup.h" 24 | #import "MagicalRecord+iCloud.h" 25 | 26 | #import "NSManagedObject+MagicalRecord.h" 27 | #import "NSManagedObject+MagicalRequests.h" 28 | #import "NSManagedObject+MagicalFinders.h" 29 | #import "NSManagedObject+MagicalAggregation.h" 30 | #import "NSManagedObjectContext+MagicalRecord.h" 31 | #import "NSManagedObjectContext+MagicalObserving.h" 32 | #import "NSManagedObjectContext+MagicalSaves.h" 33 | #import "NSManagedObjectContext+MagicalThreading.h" 34 | #import "NSPersistentStoreCoordinator+MagicalRecord.h" 35 | #import "NSManagedObjectModel+MagicalRecord.h" 36 | #import "NSPersistentStore+MagicalRecord.h" 37 | 38 | #import "MagicalImportFunctions.h" 39 | #import "NSManagedObject+MagicalDataImport.h" 40 | #import "NSNumber+MagicalDataImport.h" 41 | #import "NSObject+MagicalDataImport.h" 42 | #import "NSString+MagicalDataImport.h" 43 | #import "NSAttributeDescription+MagicalDataImport.h" 44 | #import "NSRelationshipDescription+MagicalDataImport.h" 45 | #import "NSEntityDescription+MagicalDataImport.h" 46 | 47 | #endif 48 | 49 | // @see https://github.com/ccgus/fmdb/commit/aef763eeb64e6fa654e7d121f1df4c16a98d9f4f 50 | #define MRDispatchQueueRelease(q) (dispatch_release(q)) 51 | 52 | #if TARGET_OS_IPHONE 53 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000 54 | #undef MRDispatchQueueRelease 55 | #define MRDispatchQueueRelease(q) 56 | #endif 57 | #else 58 | #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 59 | #undef MRDispatchQueueRelease 60 | #define MRDispatchQueueRelease(q) 61 | #endif 62 | #endif 63 | -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectModel+MagicalRecord.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSManagedObjectModel+MagicalRecord.m 3 | // 4 | // Created by Saul Mora on 3/11/10. 5 | // Copyright 2010 Magical Panda Software, LLC All rights reserved. 6 | // 7 | 8 | //#import "NSManagedObjectModel+MagicalRecord.h" 9 | #import "CoreData+MagicalRecord.h" 10 | 11 | 12 | static NSManagedObjectModel *defaultManagedObjectModel_ = nil; 13 | 14 | @implementation NSManagedObjectModel (MagicalRecord) 15 | 16 | + (NSManagedObjectModel *) MR_defaultManagedObjectModel 17 | { 18 | if (defaultManagedObjectModel_ == nil && [MagicalRecord shouldAutoCreateManagedObjectModel]) 19 | { 20 | [self MR_setDefaultManagedObjectModel:[self MR_mergedObjectModelFromMainBundle]]; 21 | } 22 | return defaultManagedObjectModel_; 23 | } 24 | 25 | + (void) MR_setDefaultManagedObjectModel:(NSManagedObjectModel *)newDefaultModel 26 | { 27 | defaultManagedObjectModel_ = newDefaultModel; 28 | } 29 | 30 | + (NSManagedObjectModel *) MR_mergedObjectModelFromMainBundle; 31 | { 32 | return [self mergedModelFromBundles:nil]; 33 | } 34 | 35 | + (NSManagedObjectModel *) MR_newModelNamed:(NSString *) modelName inBundleNamed:(NSString *) bundleName 36 | { 37 | NSString *path = [[NSBundle mainBundle] pathForResource:[modelName stringByDeletingPathExtension] 38 | ofType:[modelName pathExtension] 39 | inDirectory:bundleName]; 40 | NSURL *modelUrl = [NSURL fileURLWithPath:path]; 41 | 42 | NSManagedObjectModel *mom = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelUrl]; 43 | 44 | return mom; 45 | } 46 | 47 | + (NSManagedObjectModel *) MR_newManagedObjectModelNamed:(NSString *)modelFileName 48 | { 49 | NSString *path = [[NSBundle mainBundle] pathForResource:[modelFileName stringByDeletingPathExtension] 50 | ofType:[modelFileName pathExtension]]; 51 | NSURL *momURL = [NSURL fileURLWithPath:path]; 52 | 53 | NSManagedObjectModel *model = [[NSManagedObjectModel alloc] initWithContentsOfURL:momURL]; 54 | return model; 55 | } 56 | 57 | + (NSManagedObjectModel *) MR_managedObjectModelNamed:(NSString *)modelFileName 58 | { 59 | NSManagedObjectModel *model = [self MR_newManagedObjectModelNamed:modelFileName]; 60 | return model; 61 | } 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Categories/NSPersistentStoreCoordinator+MagicalRecord.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSPersistentStoreCoordinator+MagicalRecord.h 3 | // 4 | // Created by Saul Mora on 3/11/10. 5 | // Copyright 2010 Magical Panda Software, LLC All rights reserved. 6 | // 7 | 8 | #import "MagicalRecord.h" 9 | #import "NSPersistentStore+MagicalRecord.h" 10 | 11 | extern NSString * const kMagicalRecordPSCDidCompleteiCloudSetupNotification; 12 | 13 | @interface NSPersistentStoreCoordinator (MagicalRecord) 14 | 15 | + (NSPersistentStoreCoordinator *) MR_defaultStoreCoordinator; 16 | + (void) MR_setDefaultStoreCoordinator:(NSPersistentStoreCoordinator *)coordinator; 17 | 18 | + (NSPersistentStoreCoordinator *) MR_coordinatorWithInMemoryStore; 19 | 20 | + (NSPersistentStoreCoordinator *) MR_newPersistentStoreCoordinator NS_RETURNS_RETAINED; 21 | 22 | + (NSPersistentStoreCoordinator *) MR_coordinatorWithSqliteStoreNamed:(NSString *)storeFileName; 23 | + (NSPersistentStoreCoordinator *) MR_coordinatorWithAutoMigratingSqliteStoreNamed:(NSString *)storeFileName; 24 | + (NSPersistentStoreCoordinator *) MR_coordinatorWithPersistentStore:(NSPersistentStore *)persistentStore; 25 | + (NSPersistentStoreCoordinator *) MR_coordinatorWithiCloudContainerID:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreNamed:(NSString *)localStoreName cloudStorePathComponent:(NSString *)subPathComponent; 26 | 27 | + (NSPersistentStoreCoordinator *) MR_coordinatorWithiCloudContainerID:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreNamed:(NSString *)localStoreName cloudStorePathComponent:(NSString *)subPathComponent completion:(void(^)(void))completionHandler; 28 | 29 | - (NSPersistentStore *) MR_addInMemoryStore; 30 | - (NSPersistentStore *) MR_addAutoMigratingSqliteStoreNamed:(NSString *) storeFileName; 31 | - (NSPersistentStore *) MR_addSqliteStoreNamed:(id)storeFileName withOptions:(__autoreleasing NSDictionary *)options; 32 | 33 | - (void) MR_addiCloudContainerID:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreNamed:(NSString *)localStoreName cloudStorePathComponent:(NSString *)subPathComponent; 34 | - (void) MR_addiCloudContainerID:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreNamed:(NSString *)localStoreName cloudStorePathComponent:(NSString *)subPathComponent completion:(void(^)(void))completionBlock; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/alexbutenko.xcuserdatad/xcschemes/Pods-JSMessagesViewController.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 42 | 43 | 44 | 45 | 51 | 52 | 54 | 55 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /SimpleChat/SenderBuddyCloudManager.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UserCloudManager.swift 3 | // SimpleChat 4 | // 5 | // Created by alexbutenko on 7/15/14. 6 | // Copyright (c) 2014 alexbutenko. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class SenderBuddyCloudManager { 12 | class func setup(#completion:(BuddyPlainObject!, NSError!)->Void) { 13 | CloudManager.sharedInstance.requestDiscoverabilityPermission({discoverable, error in 14 | println("Discoverable: \(discoverable)") 15 | 16 | if discoverable { 17 | 18 | //TODO: could be better to validate if there are persisted values 19 | CloudManager.sharedInstance.discoverUserInfo(){userInfo, error in 20 | 21 | if userInfo != nil { 22 | // NSLog("firstname %@ lastname %@ ID %@", userInfo.firstName, userInfo.lastName, userInfo.userRecordID.recordName) 23 | 24 | CloudManager.sharedInstance.fetchUserWithID(userInfo.userRecordID.recordName) {buddy in 25 | // println("buddy \(buddy) userInfo \(userInfo)") 26 | if buddy == nil { 27 | println("need to create \(userInfo.firstName)") 28 | 29 | CloudManager.sharedInstance.addBuddy(userInfo.firstName, ID:userInfo.userRecordID.recordName) {record, error in 30 | 31 | if error == nil { 32 | println("created \(userInfo.firstName)") 33 | completion(BuddyPlainObject(name:userInfo.firstName, serverID:userInfo.userRecordID.recordName), error) 34 | } 35 | } 36 | } else { 37 | completion(BuddyPlainObject(name:userInfo.firstName, serverID:userInfo.userRecordID.recordName), error) 38 | } 39 | } 40 | } else { 41 | println("No user info") 42 | completion(nil, error) 43 | } 44 | } 45 | } else if error != nil { 46 | completion(nil, error) 47 | } 48 | }) 49 | } 50 | } -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Classes/Categories/UIImage+JSMessagesView.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.hexedbits.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSMessagesViewController 8 | // 9 | // 10 | // The MIT License 11 | // Copyright (c) 2013 Jesse Squires 12 | // http://opensource.org/licenses/MIT 13 | // 14 | 15 | #import 16 | 17 | @interface UIImage (JSMessagesView) 18 | 19 | /** 20 | * Creates and returns an image object that is a copy of the receiver and flipped horizontally. 21 | * 22 | * @return A new image object. 23 | */ 24 | - (UIImage *)js_imageFlippedHorizontal; 25 | 26 | /** 27 | * Creates and returns a new stretchable image object with the specified cap insets. 28 | * 29 | * @param capInsets The values to use for the cap insets. 30 | * 31 | * @return A new image object with the specified cap insets and mode `UIImageResizingModeStretch`. 32 | */ 33 | - (UIImage *)js_stretchableImageWithCapInsets:(UIEdgeInsets)capInsets; 34 | 35 | /** 36 | * Creates and returns a new image object with the specified attributes. 37 | * 38 | * @param clipToCircle A boolean value indicating whether or not the returned image should be cropped to a circle. Pass `YES` to crop the returned image to a circle, and `NO` to crop as a square. 39 | * @param diameter A floating point value indicating the diamater of the returned image. 40 | * @param borderColor The color with which to stroke the returned image. 41 | * @param borderWidth The width of the border of the returned image. 42 | * @param shadowOffset The values for the shadow offset of the returned image. 43 | * 44 | * @return A new image object with the specified attributes. 45 | * 46 | * @warning This method crops a copy of the receiver into a perfect square centered on the center point of the image before applying the other attributes. 47 | */ 48 | - (UIImage *)js_imageAsCircle:(BOOL)clipToCircle 49 | withDiamter:(CGFloat)diameter 50 | borderColor:(UIColor *)borderColor 51 | borderWidth:(CGFloat)borderWidth 52 | shadowOffSet:(CGSize)shadowOffset; 53 | 54 | /** 55 | * Creates and returns a new image object that is masked with the specified mask color. 56 | * 57 | * @param maskColor The color value for the mask. 58 | * 59 | * @return A new image object masked with the specified color. 60 | */ 61 | - (UIImage *)js_imageMaskWithColor:(UIColor *)maskColor; 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /SimpleChat/BuddiesDataManager.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BuddiesDataManager.swift 3 | // SimpleChat 4 | // 5 | // Created by alexbutenko on 7/16/14. 6 | // Copyright (c) 2014 alexbutenko. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class BuddiesDataManager { 12 | 13 | struct SingleInstance { 14 | static let sharedUserDataManager: BuddiesDataManager = { 15 | let userDataManager = BuddiesDataManager() 16 | 17 | return userDataManager 18 | }() 19 | } 20 | 21 | class var sharedInstance: BuddiesDataManager { 22 | return SingleInstance.sharedUserDataManager 23 | } 24 | 25 | var persistedBuddies:[Buddy]? 26 | 27 | func setup(#buddies:[BuddyPlainObject]) { 28 | 29 | persistedBuddies = Buddy.MR_findAll() as? [Buddy] 30 | 31 | if persistedBuddies != nil { 32 | 33 | var processingBuddies = persistedBuddies!.filter{$0.serverID != SenderBuddyDataManager.sharedInstance.persistedBuddy!.serverID} 34 | 35 | if processingBuddies.count > 0 { 36 | var persistedBuddiesIDs:[String] = [] 37 | 38 | for buddy in persistedBuddies! { 39 | persistedBuddiesIDs.append(buddy.serverID) 40 | } 41 | 42 | var buddiesToPersist:[BuddyPlainObject] = [] 43 | 44 | for buddy in buddies { 45 | if !contains(persistedBuddiesIDs, buddy.serverID) { 46 | buddiesToPersist.append(buddy) 47 | } 48 | } 49 | 50 | for buddyToPersist in buddiesToPersist { 51 | println("persisting user \(buddyToPersist.name) \(buddyToPersist.serverID)") 52 | var persistedBuddy = Buddy.MR_createEntity() as! Buddy 53 | 54 | persistedBuddy.name = buddyToPersist.name 55 | persistedBuddy.serverID = buddyToPersist.serverID 56 | 57 | processingBuddies.append(persistedBuddy) 58 | } 59 | 60 | processingBuddies.append(SenderBuddyDataManager.sharedInstance.persistedBuddy!) 61 | 62 | persistedBuddies = processingBuddies 63 | 64 | NSManagedObjectContext.MR_contextForCurrentThread().MR_saveToPersistentStoreAndWait() 65 | } 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Categories/NSPersistentStore+MagicalRecord.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSPersistentStore+MagicalRecord.m 3 | // 4 | // Created by Saul Mora on 3/11/10. 5 | // Copyright 2010 Magical Panda Software, LLC All rights reserved. 6 | // 7 | 8 | //#import "NSPersistentStore+MagicalRecord.h" 9 | #import "CoreData+MagicalRecord.h" 10 | 11 | NSString * const kMagicalRecordDefaultStoreFileName = @"CoreDataStore.sqlite"; 12 | 13 | static NSPersistentStore *defaultPersistentStore_ = nil; 14 | 15 | 16 | @implementation NSPersistentStore (MagicalRecord) 17 | 18 | + (NSPersistentStore *) MR_defaultPersistentStore 19 | { 20 | return defaultPersistentStore_; 21 | } 22 | 23 | + (void) MR_setDefaultPersistentStore:(NSPersistentStore *) store 24 | { 25 | defaultPersistentStore_ = store; 26 | } 27 | 28 | + (NSString *) MR_directory:(int) type 29 | { 30 | return [NSSearchPathForDirectoriesInDomains(type, NSUserDomainMask, YES) lastObject]; 31 | } 32 | 33 | + (NSString *)MR_applicationDocumentsDirectory 34 | { 35 | return [self MR_directory:NSDocumentDirectory]; 36 | } 37 | 38 | + (NSString *)MR_applicationStorageDirectory 39 | { 40 | NSString *applicationName = [[[NSBundle mainBundle] infoDictionary] valueForKey:(NSString *)kCFBundleNameKey]; 41 | return [[self MR_directory:NSApplicationSupportDirectory] stringByAppendingPathComponent:applicationName]; 42 | } 43 | 44 | + (NSURL *) MR_urlForStoreName:(NSString *)storeFileName 45 | { 46 | NSArray *paths = [NSArray arrayWithObjects:[self MR_applicationDocumentsDirectory], [self MR_applicationStorageDirectory], nil]; 47 | NSFileManager *fm = [[NSFileManager alloc] init]; 48 | 49 | for (NSString *path in paths) 50 | { 51 | NSString *filepath = [path stringByAppendingPathComponent:storeFileName]; 52 | if ([fm fileExistsAtPath:filepath]) 53 | { 54 | return [NSURL fileURLWithPath:filepath]; 55 | } 56 | } 57 | 58 | //set default url 59 | return [NSURL fileURLWithPath:[[self MR_applicationStorageDirectory] stringByAppendingPathComponent:storeFileName]]; 60 | } 61 | 62 | + (NSURL *) MR_cloudURLForUbiqutiousContainer:(NSString *)bucketName; 63 | { 64 | NSFileManager *fileManager = [[NSFileManager alloc] init]; 65 | NSURL *cloudURL = nil; 66 | if ([fileManager respondsToSelector:@selector(URLForUbiquityContainerIdentifier:)]) 67 | { 68 | cloudURL = [fileManager URLForUbiquityContainerIdentifier:bucketName]; 69 | } 70 | 71 | return cloudURL; 72 | } 73 | 74 | + (NSURL *) MR_defaultLocalStoreUrl 75 | { 76 | return [self MR_urlForStoreName:kMagicalRecordDefaultStoreFileName]; 77 | } 78 | 79 | @end 80 | -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+ErrorHandling.m: -------------------------------------------------------------------------------- 1 | // 2 | // MagicalRecord+ErrorHandling.m 3 | // Magical Record 4 | // 5 | // Created by Saul Mora on 3/6/12. 6 | // Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. 7 | // 8 | 9 | #import "MagicalRecord+ErrorHandling.h" 10 | 11 | 12 | static id errorHandlerTarget = nil; 13 | static SEL errorHandlerAction = nil; 14 | 15 | 16 | @implementation MagicalRecord (ErrorHandling) 17 | 18 | + (void) cleanUpErrorHanding; 19 | { 20 | errorHandlerTarget = nil; 21 | errorHandlerAction = nil; 22 | } 23 | 24 | + (void) defaultErrorHandler:(NSError *)error 25 | { 26 | NSDictionary *userInfo = [error userInfo]; 27 | for (NSArray *detailedError in [userInfo allValues]) 28 | { 29 | if ([detailedError isKindOfClass:[NSArray class]]) 30 | { 31 | for (NSError *e in detailedError) 32 | { 33 | if ([e respondsToSelector:@selector(userInfo)]) 34 | { 35 | MRLog(@"Error Details: %@", [e userInfo]); 36 | } 37 | else 38 | { 39 | MRLog(@"Error Details: %@", e); 40 | } 41 | } 42 | } 43 | else 44 | { 45 | MRLog(@"Error: %@", detailedError); 46 | } 47 | } 48 | MRLog(@"Error Message: %@", [error localizedDescription]); 49 | MRLog(@"Error Domain: %@", [error domain]); 50 | MRLog(@"Recovery Suggestion: %@", [error localizedRecoverySuggestion]); 51 | } 52 | 53 | + (void) handleErrors:(NSError *)error 54 | { 55 | if (error) 56 | { 57 | // If a custom error handler is set, call that 58 | if (errorHandlerTarget != nil && errorHandlerAction != nil) 59 | { 60 | #pragma clang diagnostic push 61 | #pragma clang diagnostic ignored "-Warc-performSelector-leaks" 62 | [errorHandlerTarget performSelector:errorHandlerAction withObject:error]; 63 | #pragma clang diagnostic pop 64 | } 65 | else 66 | { 67 | // Otherwise, fall back to the default error handling 68 | [self defaultErrorHandler:error]; 69 | } 70 | } 71 | } 72 | 73 | + (id) errorHandlerTarget 74 | { 75 | return errorHandlerTarget; 76 | } 77 | 78 | + (SEL) errorHandlerAction 79 | { 80 | return errorHandlerAction; 81 | } 82 | 83 | + (void) setErrorHandlerTarget:(id)target action:(SEL)action 84 | { 85 | errorHandlerTarget = target; /* Deliberately don't retain to avoid potential retain cycles */ 86 | errorHandlerAction = action; 87 | } 88 | 89 | - (void) handleErrors:(NSError *)error 90 | { 91 | [[self class] handleErrors:error]; 92 | } 93 | 94 | @end 95 | -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+iCloud.m: -------------------------------------------------------------------------------- 1 | // 2 | // MagicalRecord+iCloud.m 3 | // Magical Record 4 | // 5 | // Created by Saul Mora on 3/7/12. 6 | // Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. 7 | // 8 | 9 | #import "MagicalRecord+iCloud.h" 10 | #import "NSPersistentStoreCoordinator+MagicalRecord.h" 11 | #import "NSManagedObjectContext+MagicalRecord.h" 12 | 13 | static BOOL _iCloudEnabled = NO; 14 | 15 | @implementation MagicalRecord (iCloud) 16 | 17 | #pragma mark - iCloud Methods 18 | 19 | + (BOOL) isICloudEnabled; 20 | { 21 | return _iCloudEnabled; 22 | } 23 | 24 | + (void) setICloudEnabled:(BOOL)enabled; 25 | { 26 | @synchronized(self) 27 | { 28 | _iCloudEnabled = enabled; 29 | } 30 | } 31 | 32 | + (void) setupCoreDataStackWithiCloudContainer:(NSString *)icloudBucket localStoreNamed:(NSString *)localStore; 33 | { 34 | NSString *contentNameKey = [[[NSBundle mainBundle] infoDictionary] objectForKey:(id)kCFBundleIdentifierKey]; 35 | [self setupCoreDataStackWithiCloudContainer:icloudBucket 36 | contentNameKey:contentNameKey 37 | localStoreNamed:localStore 38 | cloudStorePathComponent:nil]; 39 | } 40 | 41 | + (void) setupCoreDataStackWithiCloudContainer:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreNamed:(NSString *)localStoreName cloudStorePathComponent:(NSString *)pathSubcomponent; 42 | { 43 | [self setupCoreDataStackWithiCloudContainer:containerID 44 | contentNameKey:contentNameKey 45 | localStoreNamed:localStoreName 46 | cloudStorePathComponent:pathSubcomponent 47 | completion:nil]; 48 | } 49 | 50 | + (void) setupCoreDataStackWithiCloudContainer:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreNamed:(NSString *)localStoreName cloudStorePathComponent:(NSString *)pathSubcomponent completion:(void(^)(void))completion; 51 | { 52 | NSPersistentStoreCoordinator *coordinator = [NSPersistentStoreCoordinator MR_coordinatorWithiCloudContainerID:containerID 53 | contentNameKey:contentNameKey 54 | localStoreNamed:localStoreName 55 | cloudStorePathComponent:pathSubcomponent 56 | completion:completion]; 57 | [NSPersistentStoreCoordinator MR_setDefaultStoreCoordinator:coordinator]; 58 | [NSManagedObjectContext MR_initializeDefaultContextWithCoordinator:coordinator]; 59 | } 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSObject+MagicalDataImport.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSDictionary+MagicalDataImport.m 3 | // Magical Record 4 | // 5 | // Created by Saul Mora on 9/4/11. 6 | // Copyright 2011 Magical Panda Software LLC. All rights reserved. 7 | // 8 | 9 | #import "NSObject+MagicalDataImport.h" 10 | #import "NSManagedObject+MagicalDataImport.h" 11 | #import "MagicalRecord.h" 12 | #import "CoreData+MagicalRecord.h" 13 | 14 | NSUInteger const kMagicalRecordImportMaximumAttributeFailoverDepth = 10; 15 | 16 | 17 | @implementation NSObject (MagicalRecord_DataImport) 18 | 19 | //#warning If you implement valueForUndefinedKey: in any NSObject in your code, this may be the problem if something broke 20 | - (id) MR_valueForUndefinedKey:(NSString *)key 21 | { 22 | return nil; 23 | } 24 | 25 | - (NSString *) MR_lookupKeyForAttribute:(NSAttributeDescription *)attributeInfo; 26 | { 27 | NSString *attributeName = [attributeInfo name]; 28 | NSString *lookupKey = [[attributeInfo userInfo] valueForKey:kMagicalRecordImportAttributeKeyMapKey] ?: attributeName; 29 | 30 | id value = [self valueForKeyPath:lookupKey]; 31 | 32 | for (NSUInteger i = 1; i < kMagicalRecordImportMaximumAttributeFailoverDepth && value == nil; i++) 33 | { 34 | attributeName = [NSString stringWithFormat:@"%@.%lu", kMagicalRecordImportAttributeKeyMapKey, (unsigned long)i]; 35 | lookupKey = [[attributeInfo userInfo] valueForKey:attributeName]; 36 | if (lookupKey == nil) 37 | { 38 | return nil; 39 | } 40 | value = [self valueForKeyPath:lookupKey]; 41 | } 42 | 43 | return value != nil ? lookupKey : nil; 44 | } 45 | 46 | - (id) MR_valueForAttribute:(NSAttributeDescription *)attributeInfo 47 | { 48 | NSString *lookupKey = [self MR_lookupKeyForAttribute:attributeInfo]; 49 | return lookupKey ? [self valueForKeyPath:lookupKey] : nil; 50 | } 51 | 52 | - (NSString *) MR_lookupKeyForRelationship:(NSRelationshipDescription *)relationshipInfo 53 | { 54 | NSEntityDescription *destinationEntity = [relationshipInfo destinationEntity]; 55 | if (destinationEntity == nil) 56 | { 57 | MRLog(@"Unable to find entity for type '%@'", [self valueForKey:kMagicalRecordImportRelationshipTypeKey]); 58 | return nil; 59 | } 60 | 61 | NSString *primaryKeyName = [relationshipInfo MR_primaryKey]; 62 | 63 | NSAttributeDescription *primaryKeyAttribute = [[destinationEntity attributesByName] valueForKey:primaryKeyName]; 64 | NSString *lookupKey = [[primaryKeyAttribute userInfo] valueForKey:kMagicalRecordImportAttributeKeyMapKey] ?: [primaryKeyAttribute name]; 65 | 66 | return lookupKey; 67 | } 68 | 69 | - (id) MR_relatedValueForRelationship:(NSRelationshipDescription *)relationshipInfo 70 | { 71 | NSString *lookupKey = [self MR_lookupKeyForRelationship:relationshipInfo]; 72 | return lookupKey ? [self valueForKeyPath:lookupKey] : nil; 73 | } 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Classes/Categories/UIColor+JSMessagesView.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.hexedbits.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSMessagesViewController 8 | // 9 | // 10 | // The MIT License 11 | // Copyright (c) 2013 Jesse Squires 12 | // http://opensource.org/licenses/MIT 13 | // 14 | 15 | #import "UIColor+JSMessagesView.h" 16 | 17 | @implementation UIColor (JSMessagesView) 18 | 19 | #pragma mark - Colors 20 | 21 | + (UIColor *)js_backgroundColorClassic 22 | { 23 | return [UIColor colorWithRed:0.859f green:0.886f blue:0.929f alpha:1.0f]; 24 | } 25 | 26 | + (UIColor *)js_messagesTimestampColorClassic 27 | { 28 | return [UIColor colorWithRed:0.533f green:0.573f blue:0.647f alpha:1.0f]; 29 | } 30 | 31 | #pragma mark - Bubble colors 32 | 33 | + (UIColor *)js_bubbleGreenColor 34 | { 35 | return [UIColor colorWithHue:130.0f / 360.0f 36 | saturation:0.68f 37 | brightness:0.80f 38 | alpha:1.0f]; 39 | } 40 | 41 | + (UIColor *)js_bubbleBlueColor 42 | { 43 | return [UIColor colorWithHue:210.0f / 360.0f 44 | saturation:0.94f 45 | brightness:1.0f 46 | alpha:1.0f]; 47 | } 48 | 49 | + (UIColor *)js_bubbleLightGrayColor 50 | { 51 | return [UIColor colorWithHue:240.0f / 360.0f 52 | saturation:0.02f 53 | brightness:0.92f 54 | alpha:1.0f]; 55 | } 56 | 57 | #pragma mark - Utilities 58 | 59 | - (UIColor *)js_darkenColorWithValue:(CGFloat)value 60 | { 61 | NSUInteger totalComponents = CGColorGetNumberOfComponents(self.CGColor); 62 | BOOL isGreyscale = (totalComponents == 2) ? YES : NO; 63 | 64 | CGFloat *oldComponents = (CGFloat *)CGColorGetComponents(self.CGColor); 65 | CGFloat newComponents[4]; 66 | 67 | if (isGreyscale) { 68 | newComponents[0] = oldComponents[0] - value < 0.0f ? 0.0f : oldComponents[0] - value; 69 | newComponents[1] = oldComponents[0] - value < 0.0f ? 0.0f : oldComponents[0] - value; 70 | newComponents[2] = oldComponents[0] - value < 0.0f ? 0.0f : oldComponents[0] - value; 71 | newComponents[3] = oldComponents[1]; 72 | } 73 | else { 74 | newComponents[0] = oldComponents[0] - value < 0.0f ? 0.0f : oldComponents[0] - value; 75 | newComponents[1] = oldComponents[1] - value < 0.0f ? 0.0f : oldComponents[1] - value; 76 | newComponents[2] = oldComponents[2] - value < 0.0f ? 0.0f : oldComponents[2] - value; 77 | newComponents[3] = oldComponents[3]; 78 | } 79 | 80 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); 81 | CGColorRef newColor = CGColorCreate(colorSpace, newComponents); 82 | CGColorSpaceRelease(colorSpace); 83 | 84 | UIColor *retColor = [UIColor colorWithCGColor:newColor]; 85 | CGColorRelease(newColor); 86 | 87 | return retColor; 88 | } 89 | 90 | @end -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 60 | 61 | 67 | 68 | 69 | 70 | 72 | 73 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods-MagicalRecord.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 60 | 61 | 67 | 68 | 69 | 70 | 72 | 73 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods-JSQSystemSoundPlayer.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 60 | 61 | 67 | 68 | 69 | 70 | 72 | 73 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods-JSMessagesViewController.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 60 | 61 | 67 | 68 | 69 | 70 | 72 | 73 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Classes/Factories/JSBubbleImageViewFactory.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.hexedbits.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSMessagesViewController 8 | // 9 | // 10 | // The MIT License 11 | // Copyright (c) 2013 Jesse Squires 12 | // http://opensource.org/licenses/MIT 13 | // 14 | 15 | #import 16 | 17 | /** 18 | * The type of bubble for a `JSBubbleMessageCell` object. 19 | */ 20 | typedef NS_ENUM(NSUInteger, JSBubbleMessageType) { 21 | /** 22 | * Specifies an incoming, or received message. 23 | */ 24 | JSBubbleMessageTypeIncoming, 25 | /** 26 | * Specifies an outgoing, or sent message. 27 | */ 28 | JSBubbleMessageTypeOutgoing 29 | }; 30 | 31 | /** 32 | * The style of a classic bubble image with an iOS 6 appearance. 33 | */ 34 | typedef NS_ENUM(NSUInteger, JSBubbleImageViewStyle) { 35 | /** 36 | * Specifies a glossy gray messsage bubble. 37 | */ 38 | JSBubbleImageViewStyleClassicGray, 39 | /** 40 | * Specifies a glossy blue messsage bubble. 41 | */ 42 | JSBubbleImageViewStyleClassicBlue, 43 | /** 44 | * Specifies a glossy green messsage bubble. 45 | */ 46 | JSBubbleImageViewStyleClassicGreen, 47 | /** 48 | * Specifies a glossy gray square messsage bubble. 49 | */ 50 | JSBubbleImageViewStyleClassicSquareGray, 51 | /** 52 | * Specifies a glossy blue square messsage bubble. 53 | */ 54 | JSBubbleImageViewStyleClassicSquareBlue 55 | }; 56 | 57 | /** 58 | * `JSBubbleImageViewFactory` is a factory that provides a means for styling bubble image views to be displayed in a `JSBubbleMessageCell` of a `JSMessagesViewController`. 59 | */ 60 | @interface JSBubbleImageViewFactory : NSObject 61 | 62 | /** 63 | * Creates and returns an image view object with the specified type and color. The `image` property of the image view is configured with a flat, iOS7-style bubble image, masked with the given color. The `highlightedImage` property is configured similarly, but with a slightly darkened version of the given color. 64 | * 65 | * @param type The type of the bubble image view. 66 | * @param color The color of the bubble image in the image view. 67 | * 68 | * @return An initialized image view object if created successfully, `nil` otherwise. 69 | */ 70 | + (UIImageView *)bubbleImageViewForType:(JSBubbleMessageType)type 71 | color:(UIColor *)color; 72 | 73 | /** 74 | * Creates and returns an image view object with the specified type and style. The `image` property of the image view is configured with a glossy, iOS6-style bubble image, corresponding to the given style. The `highlightedImage` property is configured similarly, but with a selected version of the bubble image. 75 | * 76 | * @param type The type of the bubble image view. 77 | * @param style The style of the bubble image in the image view. 78 | * 79 | * @see `JSBubbleImageViewStyle`. 80 | * 81 | * @return An initialized image view object if created successfully, `nil` otherwise. 82 | */ 83 | + (UIImageView *)classicBubbleImageViewForType:(JSBubbleMessageType)type 84 | style:(JSBubbleImageViewStyle)style; 85 | 86 | @end 87 | -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord.m: -------------------------------------------------------------------------------- 1 | // 2 | // MagicalRecord.m 3 | // 4 | // Created by Saul Mora on 3/11/10. 5 | // Copyright 2010 Magical Panda Software, LLC All rights reserved. 6 | // 7 | 8 | #import "CoreData+MagicalRecord.h" 9 | 10 | @interface MagicalRecord (Internal) 11 | 12 | + (void) cleanUpStack; 13 | + (void) cleanUpErrorHanding; 14 | 15 | @end 16 | 17 | @interface NSManagedObjectContext (MagicalRecordInternal) 18 | 19 | + (void) MR_cleanUp; 20 | 21 | @end 22 | 23 | 24 | @implementation MagicalRecord 25 | 26 | + (void) cleanUp 27 | { 28 | [self cleanUpErrorHanding]; 29 | [self cleanUpStack]; 30 | } 31 | 32 | + (void) cleanUpStack; 33 | { 34 | [NSManagedObjectContext MR_cleanUp]; 35 | [NSManagedObjectModel MR_setDefaultManagedObjectModel:nil]; 36 | [NSPersistentStoreCoordinator MR_setDefaultStoreCoordinator:nil]; 37 | [NSPersistentStore MR_setDefaultPersistentStore:nil]; 38 | } 39 | 40 | + (NSString *) currentStack 41 | { 42 | NSMutableString *status = [NSMutableString stringWithString:@"Current Default Core Data Stack: ---- \n"]; 43 | 44 | [status appendFormat:@"Model: %@\n", [[NSManagedObjectModel MR_defaultManagedObjectModel] entityVersionHashesByName]]; 45 | [status appendFormat:@"Coordinator: %@\n", [NSPersistentStoreCoordinator MR_defaultStoreCoordinator]]; 46 | [status appendFormat:@"Store: %@\n", [NSPersistentStore MR_defaultPersistentStore]]; 47 | [status appendFormat:@"Default Context: %@\n", [[NSManagedObjectContext MR_defaultContext] MR_description]]; 48 | [status appendFormat:@"Context Chain: \n%@\n", [[NSManagedObjectContext MR_defaultContext] MR_parentChain]]; 49 | 50 | return status; 51 | } 52 | 53 | + (void) setDefaultModelNamed:(NSString *)modelName; 54 | { 55 | NSManagedObjectModel *model = [NSManagedObjectModel MR_managedObjectModelNamed:modelName]; 56 | [NSManagedObjectModel MR_setDefaultManagedObjectModel:model]; 57 | } 58 | 59 | + (void) setDefaultModelFromClass:(Class)klass; 60 | { 61 | NSBundle *bundle = [NSBundle bundleForClass:klass]; 62 | NSManagedObjectModel *model = [NSManagedObjectModel mergedModelFromBundles:[NSArray arrayWithObject:bundle]]; 63 | [NSManagedObjectModel MR_setDefaultManagedObjectModel:model]; 64 | } 65 | 66 | + (NSString *) defaultStoreName; 67 | { 68 | NSString *defaultName = [[[NSBundle mainBundle] infoDictionary] valueForKey:(id)kCFBundleNameKey]; 69 | if (defaultName == nil) 70 | { 71 | defaultName = kMagicalRecordDefaultStoreFileName; 72 | } 73 | if (![defaultName hasSuffix:@"sqlite"]) 74 | { 75 | defaultName = [defaultName stringByAppendingPathExtension:@"sqlite"]; 76 | } 77 | 78 | return defaultName; 79 | } 80 | 81 | 82 | #pragma mark - initialize 83 | 84 | + (void) initialize; 85 | { 86 | if (self == [MagicalRecord class]) 87 | { 88 | #ifdef MR_SHORTHAND 89 | [self swizzleShorthandMethods]; 90 | #endif 91 | [self setShouldAutoCreateManagedObjectModel:YES]; 92 | [self setShouldAutoCreateDefaultPersistentStoreCoordinator:NO]; 93 | #ifdef DEBUG 94 | [self setShouldDeleteStoreOnModelMismatch:YES]; 95 | #else 96 | [self setShouldDeleteStoreOnModelMismatch:NO]; 97 | #endif 98 | } 99 | } 100 | 101 | @end 102 | 103 | 104 | -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Classes/Factories/JSAvatarImageFactory.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.hexedbits.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSMessagesViewController 8 | // 9 | // 10 | // The MIT License 11 | // Copyright (c) 2013 Jesse Squires 12 | // http://opensource.org/licenses/MIT 13 | // 14 | 15 | #import 16 | 17 | /** 18 | * A constant defining the size of an avatar image. 19 | */ 20 | extern CGFloat const kJSAvatarImageSize; 21 | 22 | /** 23 | * `JSAvatarImageFactory` is a factory that provides a means for styling avatar images to be displayed in a `JSBubbleMessageCell` of a `JSMessagesViewController`. 24 | */ 25 | @interface JSAvatarImageFactory : NSObject 26 | 27 | /** 28 | * Returns the image object associated with the specified filename. The image is cropped to a circle if the value of croppedToCircle is `YES`, otherwise the image is cropped to a square. The image has a flat, iOS 7 appearance. 29 | * 30 | * @param filename The name of the file. If this is the first time the image is being loaded, the method looks for an image with the specified name in the application’s main bundle. 31 | * @param croppedToCircle A boolean value indicating whether or not the image should be cropped as a circle or square. Pass `YES` to crop to a circle, and `NO` to crop to a square. 32 | * 33 | * @return The image object for the specified file (cropped as specified), or `nil` if the method could not find the specified image. 34 | */ 35 | + (UIImage *)avatarImageNamed:(NSString *)filename 36 | croppedToCircle:(BOOL)croppedToCircle; 37 | 38 | /** 39 | * Returns a copy of the image object associated with the specified originalImage. The image is cropped to a circle if the value of croppedToCircle is `YES`, otherwise the image is cropped to a square. The image has a flat, iOS 7 appearance. 40 | * 41 | * @param originalImage The origin image object to be styled for an avatar. 42 | * @param croppedToCircle A boolean value indicating whether or not the image should be cropped as a circle or square. Pass `YES` to crop to a circle, and `NO` to crop to a square. 43 | * 44 | * @return A new image object for the specified originalImage (cropped as specified), or `nil` if originalImage is not a valid, initialized image object. 45 | */ 46 | + (UIImage *)avatarImage:(UIImage *)originalImage 47 | croppedToCircle:(BOOL)croppedToCircle; 48 | 49 | /** 50 | * Returns the image object associated with the specified filename. The image is cropped to a circle if the value of croppedToCircle is `YES`, otherwise the image is cropped to a square. The image has a glossy, iOS 6 appearance. 51 | * 52 | * @param filename The name of the file. If this is the first time the image is being loaded, the method looks for an image with the specified name in the application’s main bundle. 53 | * @param croppedToCircle A boolean value indicating whether or not the image should be cropped as a circle or square. Pass `YES` to crop to a circle, and `NO` to crop to a square. 54 | * 55 | * @return The image object for the specified file (cropped as specified), or `nil` if the method could not find the specified image. 56 | */ 57 | + (UIImage *)classicAvatarImageNamed:(NSString *)filename 58 | croppedToCircle:(BOOL)croppedToCircle; 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Classes/JSBubbleView.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.hexedbits.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSMessagesViewController 8 | // 9 | // 10 | // The MIT License 11 | // Copyright (c) 2013 Jesse Squires 12 | // http://opensource.org/licenses/MIT 13 | // 14 | 15 | #import 16 | #import "JSBubbleImageViewFactory.h" 17 | 18 | /** 19 | * An instance of JSBubbleView is a means for displaying text in a speech bubble image to be placed in a JSBubbleMessageCell. 20 | * @see JSBubbleMessageCell. 21 | */ 22 | @interface JSBubbleView : UIView 23 | 24 | /** 25 | * Returns the message type for this bubble view. 26 | * @see JSBubbleMessageType for descriptions of the constants used to specify bubble message type. 27 | */ 28 | @property (assign, nonatomic, readonly) JSBubbleMessageType type; 29 | 30 | /** 31 | * Returns the image view containing the bubble image for this bubble view. 32 | */ 33 | @property (weak, nonatomic, readonly) UIImageView *bubbleImageView; 34 | 35 | /** 36 | * Returns the text view containing the message text for this bubble view. 37 | * 38 | * @warning You may customize the propeties of textView, however you *must not* change its `font` property directly. Please use the `JSBubbleView` font property instead. 39 | */ 40 | @property (weak, nonatomic, readonly) UITextView *textView; 41 | 42 | /** 43 | * The font for the text contained in the bubble view. The default value is `[UIFont systemFontOfSize:16.0f]`. 44 | * 45 | * @warning You must set this propety via `UIAppearance` only. *DO NOT set this property directly*. 46 | * @bug Setting this property directly, rather than via `UIAppearance` will cause the message bubbles and text to be laid out incorrectly. 47 | */ 48 | @property (strong, nonatomic) UIFont *font UI_APPEARANCE_SELECTOR; 49 | 50 | #pragma mark - Initialization 51 | 52 | /** 53 | * Initializes and returns a bubble view object having the given frame, bubble type, and bubble image view. 54 | * 55 | * @param frame A rectangle specifying the initial location and size of the bubble view in its superview's coordinates. 56 | * @param bubleType A constant that specifies the type of the bubble view. @see JSBubbleMessageType. 57 | * @param bubbleImageView An image view initialized with an image and highlighted image for this bubble view. @see JSBubbleImageViewFactory. 58 | * 59 | * @return An initialized `JSBubbleView` object or `nil` if the object could not be successfully initialized. 60 | */ 61 | - (instancetype)initWithFrame:(CGRect)frame 62 | bubbleType:(JSBubbleMessageType)bubleType 63 | bubbleImageView:(UIImageView *)bubbleImageView; 64 | 65 | #pragma mark - Getters 66 | 67 | /** 68 | * The bubble view's frame rectangle is computed and set based on the size of the text that it needs to display. 69 | * 70 | * @return The frame of the bubble view. 71 | */ 72 | - (CGRect)bubbleFrame; 73 | 74 | #pragma mark - Class methods 75 | 76 | /** 77 | * Computes and returns the minimum necessary height of a `JSBubbleView` needed to display the given text. 78 | * 79 | * @param text The text to display in the bubble view. 80 | * 81 | * @return The height required for the frame of the bubble view in order to display the given text. 82 | */ 83 | + (CGFloat)neededHeightForText:(NSString *)text; 84 | 85 | @end -------------------------------------------------------------------------------- /SimpleChat/MessagesCloudManager.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MessagesCloudManager.swift 3 | // SimpleChat 4 | // 5 | // Created by alexbutenko on 7/16/14. 6 | // Copyright (c) 2014 alexbutenko. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import CloudKit 11 | 12 | class MessagesCloudManager { 13 | class func fetchMessagesWithCompletionHandler(completionHandler:([MessagePlainObject]!, NSError!) -> Void) { 14 | CloudManager.sharedInstance.queryMessages(nil) { 15 | self.mapMessagesIntoPlainObjectsIfNeeded($0, error: $1, completionHandler: completionHandler) 16 | } 17 | } 18 | 19 | class func addMessage(text: String, completionHandler: (MessagePlainObject!, NSError!) -> Void) { 20 | CloudManager.sharedInstance.addMessage(text, buddyRecordName: SenderBuddyDataManager.sharedInstance.persistedBuddy!.serverID) { 21 | 22 | if ($1 == nil) { 23 | println("added message \($0.objectForKey(CloudManager.ModelKeys.MessageValue))") 24 | 25 | let ownerReference:CKReference = $0.objectForKey(CloudManager.ModelKeys.MessageOwner) as! CKReference 26 | 27 | let messagePlainObject = MessagePlainObject(value: $0.objectForKey(CloudManager.ModelKeys.MessageValue) as! String, 28 | serverID: $0.recordID.recordName, 29 | ownerID: ownerReference.recordID.recordName, 30 | date: $0.creationDate) 31 | 32 | completionHandler(messagePlainObject, nil) 33 | } else { 34 | completionHandler(nil, $1) 35 | } 36 | } 37 | } 38 | 39 | class func fetchUpdatedMessages(containmentValidationHandler: (serverID:String) -> Bool, completionHandler: ([MessagePlainObject]!, NSError!) -> Void) { 40 | CloudManager.sharedInstance.queryUpdatedRecordIDs{recordIDs, error in 41 | 42 | if error == nil { 43 | let filteredIDs = recordIDs.filter {return containmentValidationHandler(serverID: $0.recordName)} 44 | 45 | println("recordIDs to fetch data \(filteredIDs)") 46 | 47 | CloudManager.sharedInstance.queryMessagesWithIDs(filteredIDs) { 48 | self.mapMessagesIntoPlainObjectsIfNeeded($0, error: $1, completionHandler: completionHandler) 49 | } 50 | } 51 | } 52 | } 53 | 54 | class func mapMessagesIntoPlainObjectsIfNeeded(records:[CKRecord]!, error:NSError!, completionHandler:([MessagePlainObject]!, NSError!) -> Void) { 55 | if error == nil { 56 | let plainRecords:[MessagePlainObject] = records.map { 57 | 58 | let ownerReference:CKReference = $0.objectForKey(CloudManager.ModelKeys.MessageOwner) as! CKReference 59 | 60 | return MessagePlainObject(value: $0.objectForKey(CloudManager.ModelKeys.MessageValue) as! String, 61 | serverID: $0.recordID.recordName, 62 | ownerID: ownerReference.recordID.recordName, 63 | date: $0.creationDate) 64 | } 65 | 66 | completionHandler(plainRecords, nil) 67 | } else { 68 | completionHandler(nil, error) 69 | } 70 | } 71 | } -------------------------------------------------------------------------------- /SimpleChat/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SimpleChat 4 | // 5 | // Created by alexbutenko on 6/10/14. 6 | // Copyright (c) 2014 alexbutenko. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import CoreData 11 | 12 | @UIApplicationMain 13 | class AppDelegate: UIResponder, UIApplicationDelegate, UIAlertViewDelegate { 14 | 15 | var window: UIWindow? 16 | 17 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool { 18 | // Override point for customization after application launch. 19 | application.registerForRemoteNotifications() 20 | MagicalRecord.setupCoreDataStack() 21 | 22 | return true 23 | } 24 | 25 | func applicationWillResignActive(application: UIApplication) { 26 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 27 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 28 | } 29 | 30 | func applicationDidEnterBackground(application: UIApplication) { 31 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | func applicationWillEnterForeground(application: UIApplication) { 36 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 37 | } 38 | 39 | func applicationDidBecomeActive(application: UIApplication) { 40 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 41 | } 42 | 43 | func applicationWillTerminate(application: UIApplication) { 44 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 45 | // Saves changes in the application's managed object context before the application terminates. 46 | } 47 | func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) { 48 | println("Registered for remote notifications with token \(deviceToken)") 49 | } 50 | 51 | func application(application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: NSError) { 52 | println("Failed to register for remote notifications \(error)") 53 | } 54 | 55 | func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject], fetchCompletionHandler completionHandler: (UIBackgroundFetchResult) -> Void) { 56 | println("Received remote notification \(userInfo)") 57 | 58 | SyncManager.fetchUpdatedMessages {error in 59 | if error == nil { 60 | println("------\nSYNCED SUCCESSFULLY\n------") 61 | completionHandler(.NewData) 62 | } else { 63 | 64 | println("SYNC FAILED \(error!)") 65 | completionHandler(.Failed) 66 | } 67 | } 68 | } 69 | } 70 | 71 | -------------------------------------------------------------------------------- /Pods/Pods-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## JSMessagesViewController 5 | 6 | 7 | MIT License 8 | Copyright (c) 2013 Jesse Squires 9 | 10 | http://www.hexedbits.com 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 13 | associated documentation files (the "Software"), to deal in the Software without restriction, including 14 | without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 16 | following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included in 19 | all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 22 | LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 24 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 25 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | 27 | 28 | ## JSQSystemSoundPlayer 29 | 30 | 31 | MIT License 32 | Copyright (c) 2013 Jesse Squires 33 | 34 | http://www.hexedbits.com 35 | 36 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 37 | associated documentation files (the "Software"), to deal in the Software without restriction, including 38 | without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 39 | copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 40 | following conditions: 41 | 42 | The above copyright notice and this permission notice shall be included in 43 | all copies or substantial portions of the Software. 44 | 45 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 46 | LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 47 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 48 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 49 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 50 | 51 | 52 | ## MagicalRecord 53 | 54 | Copyright (c) 2010, Magical Panda Software, LLC 55 | 56 | Permission is hereby granted, free of charge, to any person 57 | obtaining a copy of this software and associated documentation 58 | files (the "Software"), to deal in the Software without 59 | restriction, including without limitation the rights to use, 60 | copy, modify, merge, publish, distribute, sublicense, and/or sell 61 | copies of the Software, and to permit persons to whom the 62 | Software is furnished to do so, subject to the following 63 | conditions: 64 | 65 | The above copyright notice and this permission notice shall be 66 | included in all copies or substantial portions of the Software. 67 | 68 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 69 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 70 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 71 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 72 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 73 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 74 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 75 | OTHER DEALINGS IN THE SOFTWARE. 76 | 77 | Generated by CocoaPods - http://cocoapods.org 78 | -------------------------------------------------------------------------------- /SimpleChat/MessagesDataManager.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MessagesDataManager.swift 3 | // SimpleChat 4 | // 5 | // Created by alexbutenko on 7/16/14. 6 | // Copyright (c) 2014 alexbutenko. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class MessagesDataManager { 12 | 13 | struct SingleInstance { 14 | static let sharedUserDataManager: MessagesDataManager = { 15 | let userDataManager = MessagesDataManager() 16 | 17 | return userDataManager 18 | }() 19 | } 20 | 21 | class var sharedInstance: MessagesDataManager { 22 | return SingleInstance.sharedUserDataManager 23 | } 24 | 25 | lazy var persistedMessages:[Message]? = Message.MR_findAll() as? [Message] 26 | 27 | func setupWithMessages(plainMessages:[MessagePlainObject]) { 28 | persistedMessages = Message.MR_findAll() as? [Message] 29 | 30 | if persistedMessages != nil { 31 | 32 | var processingMessages = persistedMessages! 33 | 34 | var persistedMessagesIDs:[String] = [String]() 35 | 36 | for message in processingMessages { 37 | persistedMessagesIDs.append(message.serverID) 38 | } 39 | 40 | var messagesToPersist:[MessagePlainObject] = [MessagePlainObject]() 41 | 42 | for plainMessage in plainMessages { 43 | if (!contains(persistedMessagesIDs, plainMessage.serverID)) { 44 | messagesToPersist.append(plainMessage) 45 | } 46 | } 47 | 48 | for messageToPersist in messagesToPersist { 49 | processingMessages.append(createMessage(messageToPersist)) 50 | } 51 | 52 | persistedMessages = processingMessages 53 | 54 | NSManagedObjectContext.MR_contextForCurrentThread().MR_saveToPersistentStoreAndWait() 55 | } 56 | } 57 | 58 | func createMessage(messagePlainObject:MessagePlainObject) -> Message { 59 | println("persisting message \(messagePlainObject.value) \(messagePlainObject.serverID) \(messagePlainObject.ownerID)") 60 | var persistedMessage = Message.MR_createEntity() as! Message 61 | 62 | persistedMessage.value = messagePlainObject.value 63 | persistedMessage.serverID = messagePlainObject.serverID 64 | persistedMessage.date = messagePlainObject.date 65 | 66 | 67 | if let buddiesToFilter = BuddiesDataManager.sharedInstance.persistedBuddies 68 | { 69 | let filteredBuddies = buddiesToFilter.filter{$0.serverID == messagePlainObject.ownerID}; 70 | 71 | if (filteredBuddies.count > 0) { 72 | persistedMessage.owner = filteredBuddies[0] 73 | 74 | println("message owner \(persistedMessage.owner.name) with ID \(messagePlainObject.ownerID)") 75 | } else { 76 | persistedMessage.owner = Buddy.MR_createEntity() as! Buddy 77 | 78 | persistedMessage.owner.name = "Test" 79 | persistedMessage.owner.serverID = "0" 80 | } 81 | } 82 | return persistedMessage 83 | } 84 | 85 | func addMessage(messagePlainObject:MessagePlainObject) { 86 | var processingMessages = [Message]() 87 | 88 | if persistedMessages != nil { 89 | processingMessages = persistedMessages! 90 | } 91 | 92 | processingMessages.append(createMessage(messagePlainObject)) 93 | persistedMessages = processingMessages 94 | 95 | NSManagedObjectContext.MR_contextForCurrentThread().MR_saveToPersistentStoreAndWait() 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /Pods/JSMessagesViewController/JSMessagesViewController/Classes/JSMessageInputView.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.hexedbits.com 4 | // 5 | // 6 | // Documentation 7 | // http://cocoadocs.org/docsets/JSMessagesViewController 8 | // 9 | // 10 | // The MIT License 11 | // Copyright (c) 2013 Jesse Squires 12 | // http://opensource.org/licenses/MIT 13 | // 14 | 15 | #import 16 | #import "JSMessageTextView.h" 17 | 18 | /** 19 | * The appearance style of the input bar view for composing a new message. 20 | */ 21 | typedef NS_ENUM(NSUInteger, JSMessageInputViewStyle) { 22 | /** 23 | * An input view style that has the appearance as seen in iOS 6 and before. 24 | */ 25 | JSMessageInputViewStyleClassic, 26 | /** 27 | * An input view style that has the appearance as seen in iOS 7 and later. 28 | */ 29 | JSMessageInputViewStyleFlat 30 | }; 31 | 32 | 33 | /** 34 | * An instance of `JSMessageInputView` defines the input toolbar for composing a new message that is to be displayed above the keyboard. 35 | */ 36 | @interface JSMessageInputView : UIImageView 37 | 38 | /** 39 | * Returns the style appearance for the input view. 40 | * @see JSMessageInputViewStyle. 41 | */ 42 | @property (assign, nonatomic, readonly) JSMessageInputViewStyle style; 43 | 44 | /** 45 | * Returns the textView into which a new message is composed. This property is never `nil`. 46 | */ 47 | @property (weak, nonatomic, readonly) JSMessageTextView *textView; 48 | 49 | /** 50 | * The send button for the input view. The default value is an initialized `UIButton` whose appearance is styled according to the value of style during initialization. 51 | * @see JSMessageInputViewStyle. 52 | */ 53 | @property (weak, nonatomic) UIButton *sendButton; 54 | 55 | #pragma mark - Initialization 56 | 57 | /** 58 | * Initializes and returns an input view having the given frame, style, delegate, and panGestureRecognizer. 59 | * 60 | * @param frame A rectangle specifying the initial location and size of the bubble view in its superview's coordinates. 61 | * @param style The style of the input view. @see JSMessageInputViewStyle. 62 | * @param delegate An object that conforms to the `UITextViewDelegate` protocol and `JSDismissiveTextViewDelegate` protocol. 63 | * @see JSDismissiveTextViewDelegate. 64 | * @param panGestureRecognizer A `UIPanGestureRecognizer` used to dismiss the input view by dragging down. 65 | * 66 | * @return An initialized `JSMessageInputView` object or `nil` if the object could not be successfully initialized. 67 | */ 68 | - (instancetype)initWithFrame:(CGRect)frame 69 | style:(JSMessageInputViewStyle)style 70 | delegate:(id)delegate 71 | panGestureRecognizer:(UIPanGestureRecognizer *)panGestureRecognizer; 72 | 73 | #pragma mark - Message input view 74 | 75 | /** 76 | * Adjusts the input view's frame height by the given value. 77 | * 78 | * @param changeInHeight The delta value by which to increase or decrease the existing height for the input view. 79 | */ 80 | - (void)adjustTextViewHeightBy:(CGFloat)changeInHeight; 81 | 82 | /** 83 | * @return A constant indicating the height of one line of text in the input view. 84 | */ 85 | + (CGFloat)textViewLineHeight; 86 | 87 | /** 88 | * @return A contant indicating the maximum number of lines of text that can be displayed in the textView. 89 | */ 90 | + (CGFloat)maxLines; 91 | 92 | /** 93 | * @return The maximum height of the input view as determined by `maxLines` and `textViewLineHeight`. This value is used for controlling the animation of the growing and shrinking of the input view as the text changes in the textView. 94 | */ 95 | + (CGFloat)maxHeight; 96 | 97 | @end -------------------------------------------------------------------------------- /Pods/MagicalRecord/MagicalRecord/Categories/DataImport/MagicalImportFunctions.m: -------------------------------------------------------------------------------- 1 | // 2 | // MagicalImportFunctions.m 3 | // Magical Record 4 | // 5 | // Created by Saul Mora on 3/7/12. 6 | // Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. 7 | // 8 | 9 | #import "MagicalImportFunctions.h" 10 | 11 | 12 | #pragma mark - Data import helper functions 13 | 14 | NSString * attributeNameFromString(NSString *value) 15 | { 16 | NSString *firstCharacter = [[value substringToIndex:1] capitalizedString]; 17 | return [firstCharacter stringByAppendingString:[value substringFromIndex:1]]; 18 | } 19 | 20 | NSString * primaryKeyNameFromString(NSString *value) 21 | { 22 | NSString *firstCharacter = [[value substringToIndex:1] lowercaseString]; 23 | return [firstCharacter stringByAppendingFormat:@"%@ID", [value substringFromIndex:1]]; 24 | } 25 | 26 | NSDate * adjustDateForDST(NSDate *date) 27 | { 28 | NSTimeInterval dstOffset = [[NSTimeZone localTimeZone] daylightSavingTimeOffsetForDate:date]; 29 | NSDate *actualDate = [date dateByAddingTimeInterval:dstOffset]; 30 | 31 | return actualDate; 32 | } 33 | 34 | NSDate * dateFromString(NSString *value, NSString *format) 35 | { 36 | NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; 37 | [formatter setTimeZone:[NSTimeZone localTimeZone]]; 38 | [formatter setLocale:[NSLocale currentLocale]]; 39 | [formatter setDateFormat:format]; 40 | 41 | NSDate *parsedDate = [formatter dateFromString:value]; 42 | 43 | return parsedDate; 44 | } 45 | 46 | NSNumber * numberFromString(NSString *value) { 47 | return [NSNumber numberWithDouble:[value doubleValue]]; 48 | } 49 | 50 | NSInteger* newColorComponentsFromString(NSString *serializedColor); 51 | NSInteger* newColorComponentsFromString(NSString *serializedColor) 52 | { 53 | NSScanner *colorScanner = [NSScanner scannerWithString:serializedColor]; 54 | NSString *colorType; 55 | [colorScanner scanUpToString:@"(" intoString:&colorType]; 56 | 57 | NSInteger *componentValues = malloc(4 * sizeof(NSInteger)); 58 | if ([colorType hasPrefix:@"rgba"]) 59 | { 60 | NSCharacterSet *rgbaCharacterSet = [NSCharacterSet characterSetWithCharactersInString:@"(,)"]; 61 | 62 | NSInteger *componentValue = componentValues; 63 | while (![colorScanner isAtEnd]) 64 | { 65 | [colorScanner scanCharactersFromSet:rgbaCharacterSet intoString:nil]; 66 | [colorScanner scanInteger:componentValue]; 67 | componentValue++; 68 | } 69 | } 70 | //else if ([colorType hasPrefix:@"hsba"]) 71 | //else if ([colorType hasPrefix:@""]) 72 | return componentValues; 73 | } 74 | 75 | #if TARGET_OS_IPHONE 76 | 77 | UIColor * UIColorFromString(NSString *serializedColor) 78 | { 79 | NSInteger *componentValues = newColorComponentsFromString(serializedColor); 80 | UIColor *color = [UIColor colorWithRed:(componentValues[0] / 255.0f) 81 | green:(componentValues[1] / 255.0f) 82 | blue:(componentValues[2] / 255.0f) 83 | alpha:componentValues[3]]; 84 | 85 | free(componentValues); 86 | return color; 87 | } 88 | id (*colorFromString)(NSString *) = UIColorFromString; 89 | 90 | #else 91 | 92 | NSColor * NSColorFromString(NSString *serializedColor) 93 | { 94 | NSInteger *componentValues = newColorComponentsFromString(serializedColor); 95 | NSColor *color = [NSColor colorWithDeviceRed:(componentValues[0] / 255.0f) 96 | green:(componentValues[1] / 255.0f) 97 | blue:(componentValues[2] / 255.0f) 98 | alpha:componentValues[3]]; 99 | free(componentValues); 100 | return color; 101 | } 102 | id (*colorFromString)(NSString *) = NSColorFromString; 103 | 104 | 105 | #endif 106 | --------------------------------------------------------------------------------