├── .gitignore ├── LICENSE.txt ├── Readme.md ├── Sketch Toolbox.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ └── shahruzshaukat.xcuserdatad │ └── xcschemes │ ├── Sketch Toolbox.xcscheme │ └── xcschememanagement.plist ├── Sketch Toolbox ├── Base.lproj │ └── MainMenu.xib ├── Constants.h ├── Constants.m ├── Images.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ └── sketch-toolbox-icon.png │ ├── Download.imageset │ │ ├── Cloud_Download.png │ │ ├── Cloud_Download@2x.png │ │ └── Contents.json │ ├── Github.imageset │ │ ├── Contents.json │ │ ├── Github.png │ │ └── Github@2x.png │ ├── Refresh.imageset │ │ ├── Contents.json │ │ └── icon_4985.png │ ├── Star.imageset │ │ ├── Contents.json │ │ ├── Star.png │ │ └── Star@2x.png │ ├── Trash.imageset │ │ ├── Contents.json │ │ ├── Trash.png │ │ └── Trash@2x.png │ └── User.imageset │ │ ├── Contents.json │ │ ├── User.png │ │ └── User@2x.png ├── MagicalRecord │ ├── Categories │ │ ├── DataImport │ │ │ ├── MagicalImportFunctions.h │ │ │ ├── MagicalImportFunctions.m │ │ │ ├── NSAttributeDescription+MagicalDataImport.h │ │ │ ├── NSAttributeDescription+MagicalDataImport.m │ │ │ ├── NSEntityDescription+MagicalDataImport.h │ │ │ ├── NSEntityDescription+MagicalDataImport.m │ │ │ ├── NSNumber+MagicalDataImport.h │ │ │ ├── NSNumber+MagicalDataImport.m │ │ │ ├── NSObject+MagicalDataImport.h │ │ │ ├── NSObject+MagicalDataImport.m │ │ │ ├── NSRelationshipDescription+MagicalDataImport.h │ │ │ ├── NSRelationshipDescription+MagicalDataImport.m │ │ │ ├── NSString+MagicalDataImport.h │ │ │ └── NSString+MagicalDataImport.m │ │ ├── NSManagedObject │ │ │ ├── NSManagedObject+MagicalAggregation.h │ │ │ ├── NSManagedObject+MagicalAggregation.m │ │ │ ├── NSManagedObject+MagicalDataImport.h │ │ │ ├── NSManagedObject+MagicalDataImport.m │ │ │ ├── NSManagedObject+MagicalFinders.h │ │ │ ├── NSManagedObject+MagicalFinders.m │ │ │ ├── NSManagedObject+MagicalRecord.h │ │ │ ├── NSManagedObject+MagicalRecord.m │ │ │ ├── NSManagedObject+MagicalRequests.h │ │ │ └── NSManagedObject+MagicalRequests.m │ │ ├── NSManagedObjectContext │ │ │ ├── NSManagedObjectContext+MagicalObserving.h │ │ │ ├── NSManagedObjectContext+MagicalObserving.m │ │ │ ├── NSManagedObjectContext+MagicalRecord.h │ │ │ ├── NSManagedObjectContext+MagicalRecord.m │ │ │ ├── NSManagedObjectContext+MagicalSaves.h │ │ │ ├── NSManagedObjectContext+MagicalSaves.m │ │ │ ├── NSManagedObjectContext+MagicalThreading.h │ │ │ └── NSManagedObjectContext+MagicalThreading.m │ │ ├── NSManagedObjectModel+MagicalRecord.h │ │ ├── NSManagedObjectModel+MagicalRecord.m │ │ ├── NSPersistentStore+MagicalRecord.h │ │ ├── NSPersistentStore+MagicalRecord.m │ │ ├── NSPersistentStoreCoordinator+MagicalRecord.h │ │ └── NSPersistentStoreCoordinator+MagicalRecord.m │ ├── Core │ │ ├── MagicalRecord+Actions.h │ │ ├── MagicalRecord+Actions.m │ │ ├── MagicalRecord+ErrorHandling.h │ │ ├── MagicalRecord+ErrorHandling.m │ │ ├── MagicalRecord+Options.h │ │ ├── MagicalRecord+Options.m │ │ ├── MagicalRecord+Setup.h │ │ ├── MagicalRecord+Setup.m │ │ ├── MagicalRecord+ShorthandSupport.h │ │ ├── MagicalRecord+ShorthandSupport.m │ │ ├── MagicalRecord+iCloud.h │ │ ├── MagicalRecord+iCloud.m │ │ ├── MagicalRecord.h │ │ ├── MagicalRecord.m │ │ ├── MagicalRecordDeprecated.h │ │ ├── MagicalRecordLogging.h │ │ └── MagicalRecordShorthand.h │ └── CoreData+MagicalRecord.h ├── Plugin.h ├── Plugin.m ├── PluginManager.h ├── PluginManager.m ├── SSZipArchive │ ├── SSZipArchive.h │ ├── SSZipArchive.m │ └── minizip │ │ ├── crypt.h │ │ ├── ioapi.c │ │ ├── ioapi.h │ │ ├── mztools.c │ │ ├── mztools.h │ │ ├── unzip.c │ │ ├── unzip.h │ │ ├── zip.c │ │ └── zip.h ├── STAppDelegate.h ├── STAppDelegate.m ├── STPluginCellView.h ├── STPluginCellView.m ├── Sketch Toolbox-Info.plist ├── Sketch Toolbox-Prefix.pch ├── Sketch_Toolbox.xcdatamodeld │ ├── .xccurrentversion │ └── Sketch_Toolbox.xcdatamodel │ │ └── contents ├── dsa_pub.pem ├── en.lproj │ ├── Credits.rtf │ └── InfoPlist.strings └── main.m └── Sparkle.framework ├── Headers ├── Resources ├── Sparkle └── Versions ├── A ├── Headers │ ├── SUAppcast.h │ ├── SUAppcastItem.h │ ├── SUUpdater.h │ ├── SUVersionComparisonProtocol.h │ └── Sparkle.h ├── Resources │ ├── Info.plist │ ├── License.txt │ ├── SUModelTranslation.plist │ ├── SUStatus.nib │ │ ├── classes.nib │ │ ├── info.nib │ │ └── keyedobjects.nib │ ├── de.lproj │ │ ├── SUAutomaticUpdateAlert.nib │ │ │ ├── classes.nib │ │ │ ├── info.nib │ │ │ └── keyedobjects.nib │ │ ├── SUUpdateAlert.nib │ │ │ ├── classes.nib │ │ │ ├── info.nib │ │ │ └── keyedobjects.nib │ │ ├── SUUpdatePermissionPrompt.nib │ │ │ ├── classes.nib │ │ │ ├── info.nib │ │ │ └── keyedobjects.nib │ │ └── Sparkle.strings │ ├── en.lproj │ │ ├── SUAutomaticUpdateAlert.nib │ │ │ ├── classes.nib │ │ │ ├── info.nib │ │ │ └── keyedobjects.nib │ │ ├── SUUpdateAlert.nib │ │ │ ├── classes.nib │ │ │ ├── info.nib │ │ │ └── keyedobjects.nib │ │ ├── SUUpdatePermissionPrompt.nib │ │ │ ├── classes.nib │ │ │ ├── info.nib │ │ │ └── keyedobjects.nib │ │ └── Sparkle.strings │ ├── es.lproj │ │ ├── SUAutomaticUpdateAlert.nib │ │ │ ├── classes.nib │ │ │ ├── info.nib │ │ │ └── keyedobjects.nib │ │ ├── SUUpdateAlert.nib │ │ │ ├── classes.nib │ │ │ ├── info.nib │ │ │ └── keyedobjects.nib │ │ ├── SUUpdatePermissionPrompt.nib │ │ │ ├── classes.nib │ │ │ ├── info.nib │ │ │ └── keyedobjects.nib │ │ └── Sparkle.strings │ ├── fr.lproj │ │ ├── SUAutomaticUpdateAlert.nib │ │ │ ├── classes.nib │ │ │ ├── info.nib │ │ │ └── keyedobjects.nib │ │ ├── SUUpdateAlert.nib │ │ │ ├── classes.nib │ │ │ ├── info.nib │ │ │ └── keyedobjects.nib │ │ ├── SUUpdatePermissionPrompt.nib │ │ │ ├── classes.nib │ │ │ ├── info.nib │ │ │ └── keyedobjects.nib │ │ ├── Sparkle.strings │ │ └── fr.lproj │ ├── fr_CA.lproj │ ├── it.lproj │ │ ├── SUAutomaticUpdateAlert.nib │ │ │ ├── classes.nib │ │ │ ├── info.nib │ │ │ └── keyedobjects.nib │ │ ├── SUUpdateAlert.nib │ │ │ ├── classes.nib │ │ │ ├── info.nib │ │ │ └── keyedobjects.nib │ │ ├── SUUpdatePermissionPrompt.nib │ │ │ ├── classes.nib │ │ │ ├── info.nib │ │ │ └── keyedobjects.nib │ │ └── Sparkle.strings │ ├── nl.lproj │ │ ├── SUAutomaticUpdateAlert.nib │ │ │ ├── classes.nib │ │ │ ├── info.nib │ │ │ └── keyedobjects.nib │ │ ├── SUUpdateAlert.nib │ │ │ ├── classes.nib │ │ │ ├── info.nib │ │ │ └── keyedobjects.nib │ │ ├── SUUpdatePermissionPrompt.nib │ │ │ ├── classes.nib │ │ │ ├── info.nib │ │ │ └── keyedobjects.nib │ │ └── Sparkle.strings │ ├── relaunch │ ├── ru.lproj │ │ ├── SUAutomaticUpdateAlert.nib │ │ │ ├── classes.nib │ │ │ ├── info.nib │ │ │ └── keyedobjects.nib │ │ ├── SUUpdateAlert.nib │ │ │ ├── classes.nib │ │ │ ├── info.nib │ │ │ └── keyedobjects.nib │ │ ├── SUUpdatePermissionPrompt.nib │ │ │ ├── classes.nib │ │ │ ├── info.nib │ │ │ └── keyedobjects.nib │ │ └── Sparkle.strings │ └── sv.lproj │ │ ├── SUAutomaticUpdateAlert.nib │ │ ├── classes.nib │ │ ├── info.nib │ │ └── keyedobjects.nib │ │ ├── SUUpdateAlert.nib │ │ ├── classes.nib │ │ ├── info.nib │ │ └── keyedobjects.nib │ │ ├── SUUpdatePermissionPrompt.nib │ │ ├── classes.nib │ │ ├── info.nib │ │ └── keyedobjects.nib │ │ └── Sparkle.strings └── Sparkle └── Current /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | *.pbxuser 3 | !default.pbxuser 4 | *.mode1v3 5 | !default.mode1v3 6 | *.mode2v3 7 | !default.mode2v3 8 | *.perspectivev3 9 | !default.perspectivev3 10 | xcuserdata 11 | *.xccheckout 12 | *.moved-aside 13 | DerivedData 14 | *.hmap 15 | *.ipa 16 | *.xcuserstate -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Shahruz Shaukat 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # _DEPRECATED: This project is no longer maintained by BuzzFeed._ 2 | 3 | The maintainers of this project no longer work at BuzzFeed and so we are no longer supporting this repository. Check out a more updated fork of the project [here](https://github.com/shahruz/Sketch-Toolbox). 4 | 5 | [![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/) 6 | 7 | --- 8 | 9 | ![Header](https://i.cloudup.com/XTLlL1-Stt-3000x3000.png) 10 | 11 | A super simple plugin manager for Sketch.app. 12 | 13 | If you just want to download and use the latest stable version of the app, visit [sketchtoolbox.com](http://sketchtoolbox.com). 14 | 15 | Note: If you experience any crashes after having previously used a version from GitHub, try clearing out the contents of ```~/Library/Application Support/Sketch Toolbox/``` and restarting. 16 | 17 | If you want to run the latest (potentially unstable) code, you can do so by opening this project, and clicking the Run button in the upper left corner. If you run into any problems, or have any kind of feedback or suggestions, please create a GitHub issue. 18 | 19 | Current priorities are to add in some more basic functionality and getting the UI to look a lot nicer. 20 | 21 | Please feel free to get involved if you're interested. You can email me at me @ shahr.uz or find me on [Twitter](http://twitter.com/shahruz). 22 | 23 | Special thanks to: 24 | * [Clark Wimberly](http://twitter.com/clarklab) 25 | * [Ale Munoz](http://github.com/sketchplugins) 26 | * [Timur Carpeev](http://github.com/timuric) 27 | * [The Bohemian Coding Team](https://twitter.com/bohemiancoding) 28 | -------------------------------------------------------------------------------- /Sketch Toolbox.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Sketch Toolbox.xcodeproj/xcuserdata/shahruzshaukat.xcuserdatad/xcschemes/Sketch Toolbox.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /Sketch Toolbox.xcodeproj/xcuserdata/shahruzshaukat.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Sketch Toolbox.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | EA86F5C9192AB55F00B834ED 16 | 17 | primary 18 | 19 | 20 | EA86F5ED192AB55F00B834ED 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Sketch Toolbox/Constants.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | extern NSString * const kSketch3AppStorePluginPath; 4 | extern NSString * const kSketch3PluginPath; 5 | extern NSString * const kSketch3BetaPluginPath; 6 | extern NSString * const kSketch2AppStorePluginPath; 7 | extern NSString * const kSketch2PluginPath; 8 | 9 | extern NSString * const kPluginCatalogURL; -------------------------------------------------------------------------------- /Sketch Toolbox/Constants.m: -------------------------------------------------------------------------------- 1 | 2 | 3 | NSString *const kSketch3AppStorePluginPath = @"~/Library/Containers/com.bohemiancoding.sketch3/Data/Library/Application Support/com.bohemiancoding.sketch3/Plugins/"; 4 | NSString *const kSketch3PluginPath = @"~/Library/Application Support/com.bohemiancoding.sketch3/Plugins/"; 5 | NSString *const kSketch3BetaPluginPath = @"~/Library/Containers/com.bohemiancoding.sketch3.beta/Data/Library/Application Support/com.bohemiancoding.sketch3/Plugins/"; 6 | 7 | NSString *const kSketch2AppStorePluginPath = @"~/Library/Containers/com.bohemiancoding.sketch/Data/Library/Application Support/sketch/Plugins/"; 8 | 9 | NSString *const kSketch2PluginPath = @"~/Library/Application Support/sketch/Plugins/"; 10 | NSString *const kPluginCatalogURL = @"https://raw.githubusercontent.com/sketchplugins/plugin-directory/master/plugins.json"; 11 | -------------------------------------------------------------------------------- /Sketch Toolbox/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "size" : "128x128", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "size" : "256x256", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "size" : "256x256", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "size" : "512x512", 45 | "idiom" : "mac", 46 | "filename" : "sketch-toolbox-icon.png", 47 | "scale" : "1x" 48 | }, 49 | { 50 | "idiom" : "mac", 51 | "size" : "512x512", 52 | "scale" : "2x" 53 | } 54 | ], 55 | "info" : { 56 | "version" : 1, 57 | "author" : "xcode" 58 | } 59 | } -------------------------------------------------------------------------------- /Sketch Toolbox/Images.xcassets/AppIcon.appiconset/sketch-toolbox-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sketch Toolbox/Images.xcassets/AppIcon.appiconset/sketch-toolbox-icon.png -------------------------------------------------------------------------------- /Sketch Toolbox/Images.xcassets/Download.imageset/Cloud_Download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sketch Toolbox/Images.xcassets/Download.imageset/Cloud_Download.png -------------------------------------------------------------------------------- /Sketch Toolbox/Images.xcassets/Download.imageset/Cloud_Download@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sketch Toolbox/Images.xcassets/Download.imageset/Cloud_Download@2x.png -------------------------------------------------------------------------------- /Sketch Toolbox/Images.xcassets/Download.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "Cloud_Download.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "Cloud_Download@2x.png" 12 | } 13 | ], 14 | "info" : { 15 | "version" : 1, 16 | "author" : "xcode" 17 | } 18 | } -------------------------------------------------------------------------------- /Sketch Toolbox/Images.xcassets/Github.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "Github.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "Github@2x.png" 12 | } 13 | ], 14 | "info" : { 15 | "version" : 1, 16 | "author" : "xcode" 17 | } 18 | } -------------------------------------------------------------------------------- /Sketch Toolbox/Images.xcassets/Github.imageset/Github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sketch Toolbox/Images.xcassets/Github.imageset/Github.png -------------------------------------------------------------------------------- /Sketch Toolbox/Images.xcassets/Github.imageset/Github@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sketch Toolbox/Images.xcassets/Github.imageset/Github@2x.png -------------------------------------------------------------------------------- /Sketch Toolbox/Images.xcassets/Refresh.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "icon_4985.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | } 12 | ], 13 | "info" : { 14 | "version" : 1, 15 | "author" : "xcode" 16 | } 17 | } -------------------------------------------------------------------------------- /Sketch Toolbox/Images.xcassets/Refresh.imageset/icon_4985.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sketch Toolbox/Images.xcassets/Refresh.imageset/icon_4985.png -------------------------------------------------------------------------------- /Sketch Toolbox/Images.xcassets/Star.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "Star.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "Star@2x.png" 12 | } 13 | ], 14 | "info" : { 15 | "version" : 1, 16 | "author" : "xcode" 17 | } 18 | } -------------------------------------------------------------------------------- /Sketch Toolbox/Images.xcassets/Star.imageset/Star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sketch Toolbox/Images.xcassets/Star.imageset/Star.png -------------------------------------------------------------------------------- /Sketch Toolbox/Images.xcassets/Star.imageset/Star@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sketch Toolbox/Images.xcassets/Star.imageset/Star@2x.png -------------------------------------------------------------------------------- /Sketch Toolbox/Images.xcassets/Trash.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "Trash.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "Trash@2x.png" 12 | } 13 | ], 14 | "info" : { 15 | "version" : 1, 16 | "author" : "xcode" 17 | } 18 | } -------------------------------------------------------------------------------- /Sketch Toolbox/Images.xcassets/Trash.imageset/Trash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sketch Toolbox/Images.xcassets/Trash.imageset/Trash.png -------------------------------------------------------------------------------- /Sketch Toolbox/Images.xcassets/Trash.imageset/Trash@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sketch Toolbox/Images.xcassets/Trash.imageset/Trash@2x.png -------------------------------------------------------------------------------- /Sketch Toolbox/Images.xcassets/User.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "User.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "User@2x.png" 12 | } 13 | ], 14 | "info" : { 15 | "version" : 1, 16 | "author" : "xcode" 17 | } 18 | } -------------------------------------------------------------------------------- /Sketch Toolbox/Images.xcassets/User.imageset/User.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sketch Toolbox/Images.xcassets/User.imageset/User.png -------------------------------------------------------------------------------- /Sketch Toolbox/Images.xcassets/User.imageset/User@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sketch Toolbox/Images.xcassets/User.imageset/User@2x.png -------------------------------------------------------------------------------- /Sketch Toolbox/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 * MR_adjustDateForDST(NSDate *date); 13 | NSDate * MR_dateFromString(NSString *value, NSString *format); 14 | NSDate * MR_dateFromNumber(NSNumber *value, BOOL milliseconds); 15 | NSNumber * MR_numberFromString(NSString *value); 16 | NSString * MR_attributeNameFromString(NSString *value); 17 | NSString * MR_primaryKeyNameFromString(NSString *value); 18 | 19 | #if TARGET_OS_IPHONE 20 | #import 21 | UIColor * MR_colorFromString(NSString *serializedColor); 22 | #else 23 | #import 24 | NSColor * MR_colorFromString(NSString *serializedColor); 25 | #endif 26 | 27 | NSInteger* MR_newColorComponentsFromString(NSString *serializedColor); 28 | extern id (*colorFromString)(NSString *); 29 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 * MR_attributeNameFromString(NSString *value) 15 | { 16 | NSString *firstCharacter = [[value substringToIndex:1] capitalizedString]; 17 | return [firstCharacter stringByAppendingString:[value substringFromIndex:1]]; 18 | } 19 | 20 | NSString * MR_primaryKeyNameFromString(NSString *value) 21 | { 22 | NSString *firstCharacter = [[value substringToIndex:1] lowercaseString]; 23 | return [firstCharacter stringByAppendingFormat:@"%@ID", [value substringFromIndex:1]]; 24 | } 25 | 26 | NSDate * MR_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 * MR_dateFromString(NSString *value, NSString *format) 35 | { 36 | NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; 37 | [formatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]]; 38 | [formatter setLocale:[NSLocale currentLocale]]; 39 | [formatter setDateFormat:format]; 40 | 41 | NSDate *parsedDate = [formatter dateFromString:value]; 42 | 43 | return parsedDate; 44 | } 45 | 46 | NSDate * MR_dateFromNumber(NSNumber *value, BOOL milliseconds) 47 | { 48 | NSTimeInterval timeInterval = [value doubleValue]; 49 | if (milliseconds) { 50 | timeInterval = timeInterval / 1000.00; 51 | } 52 | return [NSDate dateWithTimeIntervalSince1970:timeInterval]; 53 | } 54 | 55 | NSNumber * MR_numberFromString(NSString *value) { 56 | return [NSNumber numberWithDouble:[value doubleValue]]; 57 | } 58 | 59 | NSInteger* MR_newColorComponentsFromString(NSString *serializedColor) 60 | { 61 | NSScanner *colorScanner = [NSScanner scannerWithString:serializedColor]; 62 | NSString *colorType; 63 | [colorScanner scanUpToString:@"(" intoString:&colorType]; 64 | 65 | NSInteger *componentValues = malloc(4 * sizeof(NSInteger)); 66 | if (componentValues == NULL) 67 | { 68 | return NULL; 69 | } 70 | 71 | if ([colorType hasPrefix:@"rgba"]) 72 | { 73 | NSCharacterSet *rgbaCharacterSet = [NSCharacterSet characterSetWithCharactersInString:@"(,)"]; 74 | 75 | NSInteger *componentValue = componentValues; 76 | while (![colorScanner isAtEnd]) 77 | { 78 | [colorScanner scanCharactersFromSet:rgbaCharacterSet intoString:nil]; 79 | [colorScanner scanInteger:componentValue]; 80 | componentValue++; 81 | } 82 | } 83 | 84 | return componentValues; 85 | } 86 | 87 | #if TARGET_OS_IPHONE 88 | 89 | UIColor * MR_colorFromString(NSString *serializedColor) 90 | { 91 | NSInteger *componentValues = MR_newColorComponentsFromString(serializedColor); 92 | if (componentValues == NULL) 93 | { 94 | return nil; 95 | } 96 | 97 | UIColor *color = [UIColor colorWithRed:(componentValues[0] / 255.0f) 98 | green:(componentValues[1] / 255.0f) 99 | blue:(componentValues[2] / 255.0f) 100 | alpha:componentValues[3]]; 101 | 102 | free(componentValues); 103 | return color; 104 | } 105 | 106 | #else 107 | 108 | NSColor * MR_colorFromString(NSString *serializedColor) 109 | { 110 | NSInteger *componentValues = MR_newColorComponentsFromString(serializedColor); 111 | if (componentValues == NULL) 112 | { 113 | return nil; 114 | } 115 | 116 | NSColor *color = [NSColor colorWithDeviceRed:(componentValues[0] / 255.0f) 117 | green:(componentValues[1] / 255.0f) 118 | blue:(componentValues[2] / 255.0f) 119 | alpha:componentValues[3]]; 120 | free(componentValues); 121 | return color; 122 | } 123 | 124 | #endif 125 | 126 | id (*colorFromString)(NSString *) = MR_colorFromString; 127 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 | if ([value isKindOfClass:[NSNumber class]]) { 41 | value = MR_dateFromNumber(value, [dateFormat isEqualToString:kMagicalRecordImportUnixTimeString]); 42 | } 43 | else { 44 | value = MR_dateFromString([value description], dateFormat ?: kMagicalRecordImportDefaultDateFormatString); 45 | } 46 | } 47 | } 48 | else if (attributeType == NSInteger16AttributeType || 49 | attributeType == NSInteger32AttributeType || 50 | attributeType == NSInteger64AttributeType || 51 | attributeType == NSDecimalAttributeType || 52 | attributeType == NSDoubleAttributeType || 53 | attributeType == NSFloatAttributeType) { 54 | if (![value isKindOfClass:[NSNumber class]] && value != [NSNull null]) { 55 | value = MR_numberFromString([value description]); 56 | } 57 | } 58 | else if (attributeType == NSBooleanAttributeType) { 59 | if (![value isKindOfClass:[NSNumber class]] && value != [NSNull null]) { 60 | value = [NSNumber numberWithBool:[value boolValue]]; 61 | } 62 | } 63 | else if (attributeType == NSStringAttributeType) { 64 | if (![value isKindOfClass:[NSString class]] && value != [NSNull null]) { 65 | value = [value description]; 66 | } 67 | } 68 | } 69 | 70 | return value == [NSNull null] ? nil : value; 71 | } 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 | /** 16 | * Safely returns an attribute description for the given name, otherwise returns nil. In certain circumstances, the keys of the dictionary returned by `attributesByName` are not standard NSStrings and won't match using object subscripting or standard `objectForKey:` lookups. 17 | * 18 | * There may be performance implications to using this method if your entity has hundreds or thousands of attributes. 19 | * 20 | * @param name Name of the attribute description in the `attributesByName` dictionary on this instance 21 | * 22 | * @return The attribute description for the given name, otherwise nil 23 | */ 24 | - (NSAttributeDescription *) MR_attributeDescriptionForName:(NSString *)name; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 | #import "NSEntityDescription+MagicalDataImport.h" 11 | 12 | @implementation NSEntityDescription (MagicalRecord_DataImport) 13 | 14 | - (NSAttributeDescription *) MR_primaryAttributeToRelateBy; 15 | { 16 | NSString *lookupKey = [[self userInfo] valueForKey:kMagicalRecordImportRelationshipLinkedByKey] ?: MR_primaryKeyNameFromString([self name]); 17 | 18 | return [self MR_attributeDescriptionForName:lookupKey]; 19 | } 20 | 21 | - (NSManagedObject *) MR_createInstanceInContext:(NSManagedObjectContext *)context; 22 | { 23 | Class relatedClass = NSClassFromString([self managedObjectClassName]); 24 | NSManagedObject *newInstance = [relatedClass MR_createEntityInContext:context]; 25 | 26 | return newInstance; 27 | } 28 | 29 | - (NSAttributeDescription *) MR_attributeDescriptionForName:(NSString *)name; 30 | { 31 | __block NSAttributeDescription *attributeDescription; 32 | 33 | NSDictionary *attributesByName = [self attributesByName]; 34 | 35 | if ([attributesByName count] == 0) { 36 | return nil; 37 | } 38 | 39 | [attributesByName enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { 40 | if ([key isEqualToString:name]) { 41 | attributeDescription = obj; 42 | 43 | *stop = YES; 44 | } 45 | }]; 46 | 47 | return attributeDescription; 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 | #import 11 | 12 | @interface NSNumber (MagicalRecord_DataImport) 13 | 14 | - (NSString *) MR_lookupKeyForAttribute:(NSAttributeDescription *)attributeInfo; 15 | - (id) MR_relatedValueForRelationship:(NSRelationshipDescription *)relationshipInfo; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 | #import 11 | 12 | @interface NSObject (MagicalRecord_DataImport) 13 | 14 | - (NSString *) MR_lookupKeyForAttribute:(NSAttributeDescription *)attributeInfo; 15 | - (id) MR_valueForAttribute:(NSAttributeDescription *)attributeInfo; 16 | 17 | - (NSString *) MR_lookupKeyForRelationship:(NSRelationshipDescription *)relationshipInfo; 18 | - (id) MR_relatedValueForRelationship:(NSRelationshipDescription *)relationshipInfo; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 "NSEntityDescription+MagicalDataImport.h" 11 | #import "NSManagedObject+MagicalDataImport.h" 12 | #import "MagicalRecord.h" 13 | #import "CoreData+MagicalRecord.h" 14 | #import "MagicalRecordLogging.h" 15 | 16 | NSUInteger const kMagicalRecordImportMaximumAttributeFailoverDepth = 10; 17 | 18 | 19 | @implementation NSObject (MagicalRecord_DataImport) 20 | 21 | //#warning If you implement valueForUndefinedKey: in any NSObject in your code, this may be the problem if something broke 22 | - (id) MR_valueForUndefinedKey:(NSString *)key 23 | { 24 | return nil; 25 | } 26 | 27 | - (NSString *) MR_lookupKeyForAttribute:(NSAttributeDescription *)attributeInfo; 28 | { 29 | NSString *attributeName = [attributeInfo name]; 30 | NSString *lookupKey = [[attributeInfo userInfo] valueForKey:kMagicalRecordImportAttributeKeyMapKey] ?: attributeName; 31 | 32 | id value = [self valueForKeyPath:lookupKey]; 33 | 34 | for (NSUInteger i = 1; i < kMagicalRecordImportMaximumAttributeFailoverDepth && value == nil; i++) 35 | { 36 | attributeName = [NSString stringWithFormat:@"%@.%lu", kMagicalRecordImportAttributeKeyMapKey, (unsigned long)i]; 37 | lookupKey = [[attributeInfo userInfo] valueForKey:attributeName]; 38 | if (lookupKey == nil) 39 | { 40 | return nil; 41 | } 42 | value = [self valueForKeyPath:lookupKey]; 43 | } 44 | 45 | return value != nil ? lookupKey : nil; 46 | } 47 | 48 | - (id) MR_valueForAttribute:(NSAttributeDescription *)attributeInfo 49 | { 50 | NSString *lookupKey = [self MR_lookupKeyForAttribute:attributeInfo]; 51 | return lookupKey ? [self valueForKeyPath:lookupKey] : nil; 52 | } 53 | 54 | - (NSString *) MR_lookupKeyForRelationship:(NSRelationshipDescription *)relationshipInfo 55 | { 56 | NSEntityDescription *destinationEntity = [relationshipInfo destinationEntity]; 57 | if (destinationEntity == nil) 58 | { 59 | MRLogError(@"Unable to find entity for type '%@'", [self valueForKey:kMagicalRecordImportRelationshipTypeKey]); 60 | return nil; 61 | } 62 | 63 | NSString *primaryKeyName = [relationshipInfo MR_primaryKey]; 64 | NSAttributeDescription *primaryKeyAttribute = [destinationEntity MR_attributeDescriptionForName:primaryKeyName]; 65 | NSString *lookupKey = [self MR_lookupKeyForAttribute:primaryKeyAttribute] ?: [primaryKeyAttribute name]; 66 | 67 | return lookupKey; 68 | } 69 | 70 | - (id) MR_relatedValueForRelationship:(NSRelationshipDescription *)relationshipInfo 71 | { 72 | NSString *lookupKey = [self MR_lookupKeyForRelationship:relationshipInfo]; 73 | return lookupKey ? [self valueForKeyPath:lookupKey] : nil; 74 | } 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 | MR_primaryKeyNameFromString([[self destinationEntity] name]); 20 | 21 | return primaryKeyName; 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 | #import 11 | 12 | @interface NSString (MagicalRecord_DataImport) 13 | 14 | - (NSString *) MR_capitalizedFirstCharacterString; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 | - (id) MR_minValueFor:(NSString *)property; 27 | - (id) MR_maxValueFor:(NSString *)property; 28 | 29 | + (id) MR_aggregateOperation:(NSString *)function onAttribute:(NSString *)attributeName withPredicate:(NSPredicate *)predicate inContext:(NSManagedObjectContext *)context; 30 | + (id) MR_aggregateOperation:(NSString *)function onAttribute:(NSString *)attributeName withPredicate:(NSPredicate *)predicate; 31 | 32 | /** 33 | * Supports aggregating values using a key-value collection operator that can be grouped by an attribute. 34 | * See https://developer.apple.com/library/ios/documentation/cocoa/conceptual/KeyValueCoding/Articles/CollectionOperators.html for a list of valid collection operators. 35 | * 36 | * @since 2.3.0 37 | * 38 | * @param collectionOperator Collection operator 39 | * @param attributeName Entity attribute to apply the collection operator to 40 | * @param predicate Predicate to filter results 41 | * @param groupingKeyPath Key path to group results by 42 | * @param context Context to perform the request in 43 | * 44 | * @return Results of the collection operator, filtered by the provided predicate and grouped by the provided key path 45 | */ 46 | + (NSArray *) MR_aggregateOperation:(NSString *)collectionOperator onAttribute:(NSString *)attributeName withPredicate:(NSPredicate *)predicate groupBy:(NSString*)groupingKeyPath inContext:(NSManagedObjectContext *)context; 47 | 48 | /** 49 | * Supports aggregating values using a key-value collection operator that can be grouped by an attribute. 50 | * See https://developer.apple.com/library/ios/documentation/cocoa/conceptual/KeyValueCoding/Articles/CollectionOperators.html for a list of valid collection operators. 51 | * 52 | * This method is run against the default MagicalRecordStack's context. 53 | * 54 | * @since 2.3.0 55 | * 56 | * @param collectionOperator Collection operator 57 | * @param attributeName Entity attribute to apply the collection operator to 58 | * @param predicate Predicate to filter results 59 | * @param groupingKeyPath Key path to group results by 60 | * 61 | * @return Results of the collection operator, filtered by the provided predicate and grouped by the provided key path 62 | */ 63 | + (NSArray *) MR_aggregateOperation:(NSString *)collectionOperator onAttribute:(NSString *)attributeName withPredicate:(NSPredicate *)predicate groupBy:(NSString*)groupingKeyPath; 64 | 65 | - (instancetype) MR_objectWithMinValueFor:(NSString *)property; 66 | - (instancetype) MR_objectWithMinValueFor:(NSString *)property inContext:(NSManagedObjectContext *)context; 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 kMagicalRecordImportUnixTimeString; 13 | extern NSString * const kMagicalRecordImportAttributeKeyMapKey; 14 | extern NSString * const kMagicalRecordImportAttributeValueClassNameKey; 15 | 16 | extern NSString * const kMagicalRecordImportRelationshipMapKey; 17 | extern NSString * const kMagicalRecordImportRelationshipLinkedByKey; 18 | extern NSString * const kMagicalRecordImportRelationshipTypeKey; 19 | 20 | @interface NSManagedObject (MagicalRecord_DataImport) 21 | 22 | - (BOOL) MR_importValuesForKeysWithObject:(id)objectData; 23 | 24 | + (instancetype) MR_importFromObject:(id)data; 25 | + (instancetype) MR_importFromObject:(id)data inContext:(NSManagedObjectContext *)context; 26 | 27 | + (NSArray *) MR_importFromArray:(NSArray *)listOfObjectData; 28 | + (NSArray *) MR_importFromArray:(NSArray *)listOfObjectData inContext:(NSManagedObjectContext *)context; 29 | 30 | @end 31 | 32 | @interface NSManagedObject (MagicalRecord_DataImportControls) 33 | 34 | - (BOOL) shouldImport:(id)data; 35 | - (void) willImport:(id)data; 36 | - (void) didImport:(id)data; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 | #import "MagicalRecordDeprecated.h" 10 | 11 | #define kMagicalRecordDefaultBatchSize 20 12 | 13 | @interface NSManagedObject (MagicalRecord) 14 | 15 | /** 16 | * If the NSManagedObject subclass calling this method has implemented the `entityName` method, then the return value of that will be used. 17 | * If `entityName` is not implemented, then the name of the class is returned. 18 | * 19 | * @return String based name for the entity 20 | */ 21 | + (NSString *) MR_entityName; 22 | 23 | + (NSUInteger) MR_defaultBatchSize; 24 | + (void) MR_setDefaultBatchSize:(NSUInteger)newBatchSize; 25 | 26 | + (NSArray *) MR_executeFetchRequest:(NSFetchRequest *)request; 27 | + (NSArray *) MR_executeFetchRequest:(NSFetchRequest *)request inContext:(NSManagedObjectContext *)context; 28 | + (instancetype) MR_executeFetchRequestAndReturnFirstObject:(NSFetchRequest *)request; 29 | + (instancetype) MR_executeFetchRequestAndReturnFirstObject:(NSFetchRequest *)request inContext:(NSManagedObjectContext *)context; 30 | 31 | #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR 32 | 33 | + (void) MR_performFetch:(NSFetchedResultsController *)controller; 34 | 35 | #endif 36 | 37 | + (NSEntityDescription *) MR_entityDescription; 38 | + (NSEntityDescription *) MR_entityDescriptionInContext:(NSManagedObjectContext *)context; 39 | + (NSArray *) MR_propertiesNamed:(NSArray *)properties; 40 | 41 | + (instancetype) MR_createEntity; 42 | + (instancetype) MR_createEntityInContext:(NSManagedObjectContext *)context; 43 | 44 | - (BOOL) MR_deleteEntity; 45 | - (BOOL) MR_deleteEntityInContext:(NSManagedObjectContext *)context; 46 | 47 | + (BOOL) MR_deleteAllMatchingPredicate:(NSPredicate *)predicate; 48 | + (BOOL) MR_deleteAllMatchingPredicate:(NSPredicate *)predicate inContext:(NSManagedObjectContext *)context; 49 | 50 | + (BOOL) MR_truncateAll; 51 | + (BOOL) MR_truncateAllInContext:(NSManagedObjectContext *)context; 52 | 53 | + (NSArray *) MR_ascendingSortDescriptors:(NSArray *)attributesToSortBy; 54 | + (NSArray *) MR_descendingSortDescriptors:(NSArray *)attributesToSortBy; 55 | 56 | - (instancetype) MR_inContext:(NSManagedObjectContext *)otherContext; 57 | - (instancetype) MR_inThreadContext; 58 | 59 | @end 60 | 61 | @protocol MagicalRecord_MOGenerator 62 | 63 | @optional 64 | + (NSString *)entityName; 65 | - (instancetype) entityInManagedObjectContext:(NSManagedObjectContext *)object; 66 | - (instancetype) insertInManagedObjectContext:(NSManagedObjectContext *)object; 67 | 68 | @end 69 | 70 | #pragma mark - Deprecated Methods — DO NOT USE 71 | @interface NSManagedObject (MagicalRecordDeprecated) 72 | 73 | + (instancetype) MR_createInContext:(NSManagedObjectContext *)context __attribute__((deprecated("Please use +MR_createEntityInContext: instead."))); 74 | - (BOOL) MR_deleteInContext:(NSManagedObjectContext *)context __attribute__((deprecated("Please use -MR_deleteEntityInContext: instead."))); 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 | extern NSString * const kMagicalRecordDidMergeChangesFromiCloudNotification; 12 | 13 | @interface NSManagedObjectContext (MagicalObserving) 14 | 15 | - (void) MR_observeContext:(NSManagedObjectContext *)otherContext; 16 | - (void) MR_stopObservingContext:(NSManagedObjectContext *)otherContext; 17 | 18 | - (void) MR_observeContextOnMainThread:(NSManagedObjectContext *)otherContext; 19 | 20 | - (void) MR_observeiCloudChangesInCoordinator:(NSPersistentStoreCoordinator *)coordinator; 21 | - (void) MR_stopObservingiCloudChangesInCoordinator:(NSPersistentStoreCoordinator *)coordinator; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Sketch Toolbox/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalObserving.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSManagedObjectContext+MagicalObserving.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+MagicalObserving.h" 10 | #import "NSManagedObjectContext+MagicalRecord.h" 11 | #import "MagicalRecord.h" 12 | #import "MagicalRecord+iCloud.h" 13 | #import "MagicalRecordLogging.h" 14 | 15 | NSString * const kMagicalRecordDidMergeChangesFromiCloudNotification = @"kMagicalRecordDidMergeChangesFromiCloudNotification"; 16 | 17 | @implementation NSManagedObjectContext (MagicalObserving) 18 | 19 | #pragma mark - Context Observation Helpers 20 | 21 | - (void) MR_observeContext:(NSManagedObjectContext *)otherContext 22 | { 23 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 24 | [notificationCenter addObserver:self 25 | selector:@selector(MR_mergeChangesFromNotification:) 26 | name:NSManagedObjectContextDidSaveNotification 27 | object:otherContext]; 28 | } 29 | 30 | - (void) MR_stopObservingContext:(NSManagedObjectContext *)otherContext 31 | { 32 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 33 | 34 | [notificationCenter removeObserver:self 35 | name:NSManagedObjectContextDidSaveNotification 36 | object:otherContext]; 37 | } 38 | 39 | - (void) MR_observeContextOnMainThread:(NSManagedObjectContext *)otherContext 40 | { 41 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 42 | [notificationCenter addObserver:self 43 | selector:@selector(MR_mergeChangesOnMainThread:) 44 | name:NSManagedObjectContextDidSaveNotification 45 | object:otherContext]; 46 | } 47 | 48 | #pragma mark - Context iCloud Merge Helpers 49 | 50 | - (void) MR_mergeChangesFromiCloud:(NSNotification *)notification; 51 | { 52 | [self performBlock:^{ 53 | 54 | MRLogVerbose(@"Merging changes From iCloud %@context%@", 55 | self == [NSManagedObjectContext MR_defaultContext] ? @"*** DEFAULT *** " : @"", 56 | ([NSThread isMainThread] ? @" *** on Main Thread ***" : @"")); 57 | 58 | [self mergeChangesFromContextDidSaveNotification:notification]; 59 | 60 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 61 | 62 | [notificationCenter postNotificationName:kMagicalRecordDidMergeChangesFromiCloudNotification 63 | object:self 64 | userInfo:[notification userInfo]]; 65 | }]; 66 | } 67 | 68 | - (void) MR_mergeChangesFromNotification:(NSNotification *)notification; 69 | { 70 | MRLogVerbose(@"Merging changes to %@context%@", 71 | self == [NSManagedObjectContext MR_defaultContext] ? @"*** DEFAULT *** " : @"", 72 | ([NSThread isMainThread] ? @" *** on Main Thread ***" : @"")); 73 | 74 | [self mergeChangesFromContextDidSaveNotification:notification]; 75 | } 76 | 77 | - (void) MR_mergeChangesOnMainThread:(NSNotification *)notification; 78 | { 79 | if ([NSThread isMainThread]) 80 | { 81 | [self MR_mergeChangesFromNotification:notification]; 82 | } 83 | else 84 | { 85 | [self performSelectorOnMainThread:@selector(MR_mergeChangesFromNotification:) withObject:notification waitUntilDone:YES]; 86 | } 87 | } 88 | 89 | - (void) MR_observeiCloudChangesInCoordinator:(NSPersistentStoreCoordinator *)coordinator; 90 | { 91 | if (![MagicalRecord isICloudEnabled]) return; 92 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 93 | [notificationCenter addObserver:self 94 | selector:@selector(MR_mergeChangesFromiCloud:) 95 | name:NSPersistentStoreDidImportUbiquitousContentChangesNotification 96 | object:coordinator]; 97 | 98 | } 99 | 100 | - (void) MR_stopObservingiCloudChangesInCoordinator:(NSPersistentStoreCoordinator *)coordinator; 101 | { 102 | if (![MagicalRecord isICloudEnabled]) return; 103 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 104 | [notificationCenter removeObserver:self 105 | name:NSPersistentStoreDidImportUbiquitousContentChangesNotification 106 | object:coordinator]; 107 | } 108 | 109 | @end 110 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 | #import "MagicalRecordDeprecated.h" 10 | 11 | @interface NSManagedObjectContext (MagicalRecord) 12 | 13 | #pragma mark - Setup 14 | 15 | /** 16 | Initializes MagicalRecord's default contexts using the provided persistent store coordinator. 17 | 18 | @param coordinator Persistent Store Coordinator 19 | */ 20 | + (void) MR_initializeDefaultContextWithCoordinator:(NSPersistentStoreCoordinator *)coordinator; 21 | 22 | #pragma mark - Default Contexts 23 | /** 24 | Root context responsible for sending changes to the main persistent store coordinator that will be saved to disk. 25 | 26 | @discussion Use this context for making and saving changes. All saves will be merged into the context returned by `MR_defaultContext` as well. 27 | 28 | @return Private context used for saving changes to disk on a background thread 29 | */ 30 | + (NSManagedObjectContext *) MR_rootSavingContext; 31 | 32 | /** 33 | @discussion Please do not use this context for saving changes, as it will block the main thread when doing so. 34 | 35 | @return Main queue context that can be observed for changes 36 | */ 37 | + (NSManagedObjectContext *) MR_defaultContext; 38 | 39 | #pragma mark - Context Creation 40 | 41 | /** 42 | Creates and returns a new managed object context of type `NSPrivateQueueConcurrencyType`, with it's parent context set to the root saving context. 43 | @return Private context with the parent set to the root saving context 44 | */ 45 | + (NSManagedObjectContext *) MR_context; 46 | 47 | /** 48 | Creates and returns a new managed object context of type `NSPrivateQueueConcurrencyType`, with it's parent context set to the root saving context. 49 | 50 | @param parentContext Context to set as the parent of the newly initialized context 51 | 52 | @return Private context with the parent set to the provided context 53 | */ 54 | + (NSManagedObjectContext *) MR_contextWithParent:(NSManagedObjectContext *)parentContext; 55 | 56 | /** 57 | Creates and returns a new managed object context of type `NSPrivateQueueConcurrencyType`, with it's persistent store coordinator set to the provided coordinator. 58 | 59 | @param coordinator A persistent store coordinator 60 | 61 | @return Private context with it's persistent store coordinator set to the provided coordinator 62 | */ 63 | + (NSManagedObjectContext *) MR_contextWithStoreCoordinator:(NSPersistentStoreCoordinator *)coordinator; 64 | 65 | /** 66 | Initializes a context of type `NSMainQueueConcurrencyType`. 67 | 68 | @return A context initialized using the `NSPrivateQueueConcurrencyType` concurrency type. 69 | */ 70 | + (NSManagedObjectContext *) MR_newMainQueueContext NS_RETURNS_RETAINED; 71 | 72 | /** 73 | Initializes a context of type `NSPrivateQueueConcurrencyType`. 74 | 75 | @return A context initialized using the `NSPrivateQueueConcurrencyType` concurrency type. 76 | */ 77 | + (NSManagedObjectContext *) MR_newPrivateQueueContext NS_RETURNS_RETAINED; 78 | 79 | #pragma mark - Debugging 80 | 81 | /** 82 | Sets a working name for the context, which will be used in debug logs. 83 | 84 | @param workingName Name for the context 85 | */ 86 | - (void) MR_setWorkingName:(NSString *)workingName; 87 | 88 | /** 89 | @return Working name for the context 90 | */ 91 | - (NSString *) MR_workingName; 92 | 93 | /** 94 | @return Description of this context 95 | */ 96 | - (NSString *) MR_description; 97 | 98 | /** 99 | @return Description of the parent contexts of this context 100 | */ 101 | - (NSString *) MR_parentChain; 102 | 103 | 104 | #pragma mark - Helpers 105 | 106 | /** 107 | Reset the default context. 108 | */ 109 | + (void) MR_resetDefaultContext; 110 | 111 | /** 112 | Delete the provided objects from the context 113 | 114 | @param objects An object conforming to `NSFastEnumeration`, containing NSManagedObject instances 115 | */ 116 | - (void) MR_deleteObjects:(id )objects; 117 | 118 | @end 119 | 120 | #pragma mark - Deprecated Methods — DO NOT USE 121 | @interface NSManagedObjectContext (MagicalRecordDeprecated) 122 | 123 | + (NSManagedObjectContext *) MR_contextWithoutParent MR_DEPRECATED_WILL_BE_REMOVED_IN_3_0_USE("Please use +MR_newPrivateQueueContext instead"); 124 | 125 | + (NSManagedObjectContext *) MR_newContext MR_DEPRECATED_WILL_BE_REMOVED_IN_3_0_USE("Please use +MR_context instead"); 126 | + (NSManagedObjectContext *) MR_newContextWithParent:(NSManagedObjectContext *)parentContext MR_DEPRECATED_WILL_BE_REMOVED_IN_3_0_USE("Please use +MR_contextWithParent: instead"); 127 | + (NSManagedObjectContext *) MR_newContextWithStoreCoordinator:(NSPersistentStoreCoordinator *)coordinator MR_DEPRECATED_WILL_BE_REMOVED_IN_3_0_USE("Please use +MR_contextWithStoreCoordinator: instead"); 128 | 129 | 130 | @end 131 | -------------------------------------------------------------------------------- /Sketch Toolbox/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalSaves.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSManagedObjectContext+MagicalSaves.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 | #import "MagicalRecordDeprecated.h" 11 | 12 | typedef NS_OPTIONS(NSUInteger, MRSaveOptions) { 13 | /** No options — used for cleanliness only */ 14 | MRSaveOptionNone = 0, 15 | 16 | /** When saving, continue saving parent contexts until the changes are present in the persistent store */ 17 | MRSaveParentContexts = 1 << 1, 18 | 19 | /** Perform saves synchronously, blocking execution on the current thread until the save is complete */ 20 | MRSaveSynchronously = 1 << 2, 21 | 22 | /** Perform saves synchronously, blocking execution on the current thread until the save is complete; however, saves root context asynchronously */ 23 | MRSaveSynchronouslyExceptRootContext = 1 << 3 24 | }; 25 | 26 | typedef void (^MRSaveCompletionHandler)(BOOL success, NSError *error); 27 | 28 | @interface NSManagedObjectContext (MagicalSaves) 29 | 30 | /** 31 | Asynchronously save changes in the current context and it's parent. 32 | Executes a save on the current context's dispatch queue asynchronously. This method only saves the current context, and the parent of the current context if one is set. The completion block will always be called on the main queue. 33 | 34 | @param completion Completion block that is called after the save has completed. The block is passed a success state as a `BOOL` and an `NSError` instance if an error occurs. Always called on the main queue. 35 | 36 | @since Available in v2.1.0 and later. 37 | */ 38 | - (void) MR_saveOnlySelfWithCompletion:(MRSaveCompletionHandler)completion; 39 | 40 | /** 41 | Asynchronously save changes in the current context all the way back to the persistent store. 42 | Executes asynchronous saves on the current context, and any ancestors, until the changes have been persisted to the assigned persistent store. The completion block will always be called on the main queue. 43 | 44 | @param completion Completion block that is called after the save has completed. The block is passed a success state as a `BOOL` and an `NSError` instance if an error occurs. Always called on the main queue. 45 | 46 | @since Available in v2.1.0 and later. 47 | */ 48 | - (void) MR_saveToPersistentStoreWithCompletion:(MRSaveCompletionHandler)completion; 49 | 50 | /** 51 | Synchronously save changes in the current context and it's parent. 52 | Executes a save on the current context's dispatch queue. This method only saves the current context, and the parent of the current context if one is set. The method will not return until the save is complete. 53 | 54 | @since Available in v2.1.0 and later. 55 | */ 56 | - (void) MR_saveOnlySelfAndWait; 57 | 58 | /** 59 | Synchronously save changes in the current context all the way back to the persistent store. 60 | Executes saves on the current context, and any ancestors, until the changes have been persisted to the assigned persistent store. The method will not return until the save is complete. 61 | 62 | @since Available in v2.1.0 and later. 63 | */ 64 | - (void) MR_saveToPersistentStoreAndWait; 65 | 66 | /** 67 | Save the current context with options. 68 | All other save methods are conveniences to this method. 69 | 70 | @param mask Bitmasked options for the save process. 71 | @param completion Completion block that is called after the save has completed. The block is passed a success state as a `BOOL` and an `NSError` instance if an error occurs. Always called on the main queue. 72 | 73 | @since Available in v2.1.0 and later. 74 | */ 75 | - (void) MR_saveWithOptions:(MRSaveOptions)mask completion:(MRSaveCompletionHandler)completion; 76 | 77 | @end 78 | 79 | #pragma mark - Deprecated Methods — DO NOT USE 80 | @interface NSManagedObjectContext (MagicalSavesDeprecated) 81 | 82 | - (void) MR_save MR_DEPRECATED_WILL_BE_REMOVED_IN_3_0_USE("Please use MR_saveToPersistentStoreAndWait instead."); 83 | - (void) MR_saveWithErrorCallback:(void(^)(NSError *error))errorCallback MR_DEPRECATED_WILL_BE_REMOVED_IN_3_0; 84 | - (void) MR_saveInBackgroundCompletion:(void (^)(void))completion MR_DEPRECATED_WILL_BE_REMOVED_IN_3_0; 85 | - (void) MR_saveInBackgroundErrorHandler:(void (^)(NSError *error))errorCallback MR_DEPRECATED_WILL_BE_REMOVED_IN_3_0; 86 | - (void) MR_saveInBackgroundErrorHandler:(void (^)(NSError *error))errorCallback completion:(void (^)(void))completion MR_DEPRECATED_WILL_BE_REMOVED_IN_3_0; 87 | - (void) MR_saveNestedContexts MR_DEPRECATED_WILL_BE_REMOVED_IN_3_0_USE("Please use MR_saveToPersistentStoreWithCompletion: instead."); 88 | - (void) MR_saveNestedContextsErrorHandler:(void (^)(NSError *error))errorCallback MR_DEPRECATED_WILL_BE_REMOVED_IN_3_0_USE("Please use MR_saveToPersistentStoreWithCompletion: instead."); 89 | - (void) MR_saveNestedContextsErrorHandler:(void (^)(NSError *error))errorCallback completion:(void (^)(void))completion MR_DEPRECATED_WILL_BE_REMOVED_IN_3_0_USE("Please use MR_saveToPersistentStoreWithCompletion: instead."); 90 | 91 | @end 92 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 __attribute((deprecated("This method will be removed in MagicalRecord 3.0"))); 14 | + (void) MR_clearNonMainThreadContextsCache __attribute((deprecated("This method will be removed in MagicalRecord 3.0"))); 15 | + (void) MR_resetContextForCurrentThread __attribute((deprecated("This method will be removed in MagicalRecord 3.0"))); 16 | + (void) MR_clearContextForCurrentThread __attribute((deprecated("This method will be removed in MagicalRecord 3.0"))); 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 | #include 13 | 14 | static NSString const * kMagicalRecordManagedObjectContextKey = @"MagicalRecord_NSManagedObjectContextForThreadKey"; 15 | static NSString const * kMagicalRecordManagedObjectContextCacheVersionKey = @"MagicalRecord_CacheVersionOfNSManagedObjectContextForThreadKey"; 16 | static volatile int32_t contextsCacheVersion = 0; 17 | 18 | 19 | @implementation NSManagedObjectContext (MagicalThreading) 20 | 21 | + (void)MR_resetContextForCurrentThread 22 | { 23 | [[NSManagedObjectContext MR_contextForCurrentThread] reset]; 24 | } 25 | 26 | + (void) MR_clearNonMainThreadContextsCache 27 | { 28 | OSAtomicIncrement32(&contextsCacheVersion); 29 | } 30 | 31 | + (NSManagedObjectContext *) MR_contextForCurrentThread; 32 | { 33 | if ([NSThread isMainThread]) 34 | { 35 | return [self MR_defaultContext]; 36 | } 37 | else 38 | { 39 | // contextsCacheVersion can change (atomically) at any time, so grab a copy to ensure that we always 40 | // use the same value throughout the remainder of this method. We are OK with this method returning 41 | // an outdated context if MR_clearNonMainThreadContextsCache is called from another thread while this 42 | // method is being executed. This behavior is unrelated to our choice to use a counter for synchronization. 43 | // We would have the same behavior if we used @synchronized() (or any other lock-based synchronization 44 | // method) since MR_clearNonMainThreadContextsCache would have to wait until this method finished before 45 | // it could acquire the mutex, resulting in us still returning an outdated context in that case as well. 46 | int32_t targetCacheVersionForContext = contextsCacheVersion; 47 | 48 | NSMutableDictionary *threadDict = [[NSThread currentThread] threadDictionary]; 49 | NSManagedObjectContext *threadContext = [threadDict objectForKey:kMagicalRecordManagedObjectContextKey]; 50 | NSNumber *currentCacheVersionForContext = [threadDict objectForKey:kMagicalRecordManagedObjectContextCacheVersionKey]; 51 | NSAssert((threadContext && currentCacheVersionForContext) || (!threadContext && !currentCacheVersionForContext), 52 | @"The Magical Record keys should either both be present or neither be present, otherwise we're in an inconsistent state!"); 53 | if ((threadContext == nil) || (currentCacheVersionForContext == nil) || ((int32_t)[currentCacheVersionForContext integerValue] != targetCacheVersionForContext)) 54 | { 55 | threadContext = [self MR_contextWithParent:[NSManagedObjectContext MR_defaultContext]]; 56 | [threadDict setObject:threadContext forKey:kMagicalRecordManagedObjectContextKey]; 57 | [threadDict setObject:[NSNumber numberWithInteger:targetCacheVersionForContext] 58 | forKey:kMagicalRecordManagedObjectContextCacheVersionKey]; 59 | } 60 | return threadContext; 61 | } 62 | } 63 | 64 | + (void) MR_clearContextForCurrentThread { 65 | [[[NSThread currentThread] threadDictionary] removeObjectForKey:kMagicalRecordManagedObjectContextKey]; 66 | [[[NSThread currentThread] threadDictionary] removeObjectForKey:kMagicalRecordManagedObjectContextCacheVersionKey]; 67 | } 68 | 69 | @end 70 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 | + (NSManagedObjectModel *) MR_newModelNamed:(NSString *) modelName inBundle:(NSBundle*) bundle NS_RETURNS_RETAINED; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Sketch Toolbox/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_newModelNamed:(NSString *) modelName inBundle:(NSBundle*) bundle 48 | { 49 | NSString *path = [bundle pathForResource:[modelName stringByDeletingPathExtension] 50 | ofType:[modelName pathExtension]]; 51 | NSURL *modelUrl = [NSURL fileURLWithPath:path]; 52 | 53 | NSManagedObjectModel *mom = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelUrl]; 54 | 55 | return mom; 56 | } 57 | 58 | + (NSManagedObjectModel *) MR_newManagedObjectModelNamed:(NSString *)modelFileName 59 | { 60 | NSString *path = [[NSBundle mainBundle] pathForResource:[modelFileName stringByDeletingPathExtension] 61 | ofType:[modelFileName pathExtension]]; 62 | NSURL *momURL = [NSURL fileURLWithPath:path]; 63 | 64 | NSManagedObjectModel *model = [[NSManagedObjectModel alloc] initWithContentsOfURL:momURL]; 65 | return model; 66 | } 67 | 68 | + (NSManagedObjectModel *) MR_managedObjectModelNamed:(NSString *)modelFileName 69 | { 70 | NSManagedObjectModel *model = [self MR_newManagedObjectModelNamed:modelFileName]; 71 | return model; 72 | } 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 | #import 10 | 11 | // option to autodelete store if it already exists 12 | 13 | extern NSString * const kMagicalRecordDefaultStoreFileName; 14 | 15 | 16 | @interface NSPersistentStore (MagicalRecord) 17 | 18 | + (NSURL *) MR_defaultLocalStoreUrl; 19 | 20 | + (NSPersistentStore *) MR_defaultPersistentStore; 21 | + (void) MR_setDefaultPersistentStore:(NSPersistentStore *) store; 22 | 23 | + (NSURL *) MR_urlForStoreName:(NSString *)storeFileName; 24 | + (NSURL *) MR_cloudURLForUbiqutiousContainer:(NSString *)bucketName; 25 | 26 | @end 27 | 28 | 29 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 | extern NSString * const kMagicalRecordPSCMismatchWillDeleteStore; 13 | extern NSString * const kMagicalRecordPSCMismatchDidDeleteStore; 14 | extern NSString * const kMagicalRecordPSCMismatchWillRecreateStore; 15 | extern NSString * const kMagicalRecordPSCMismatchDidRecreateStore; 16 | extern NSString * const kMagicalRecordPSCMismatchCouldNotDeleteStore; 17 | extern NSString * const kMagicalRecordPSCMismatchCouldNotRecreateStore; 18 | 19 | @interface NSPersistentStoreCoordinator (MagicalRecord) 20 | 21 | + (NSPersistentStoreCoordinator *) MR_defaultStoreCoordinator; 22 | + (void) MR_setDefaultStoreCoordinator:(NSPersistentStoreCoordinator *)coordinator; 23 | 24 | + (NSPersistentStoreCoordinator *) MR_coordinatorWithInMemoryStore; 25 | 26 | + (NSPersistentStoreCoordinator *) MR_newPersistentStoreCoordinator NS_RETURNS_RETAINED; 27 | 28 | + (NSPersistentStoreCoordinator *) MR_coordinatorWithSqliteStoreNamed:(NSString *)storeFileName; 29 | + (NSPersistentStoreCoordinator *) MR_coordinatorWithAutoMigratingSqliteStoreNamed:(NSString *)storeFileName; 30 | + (NSPersistentStoreCoordinator *) MR_coordinatorWithPersistentStore:(NSPersistentStore *)persistentStore; 31 | + (NSPersistentStoreCoordinator *) MR_coordinatorWithiCloudContainerID:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreNamed:(NSString *)localStoreName cloudStorePathComponent:(NSString *)subPathComponent; 32 | 33 | + (NSPersistentStoreCoordinator *) MR_coordinatorWithiCloudContainerID:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreNamed:(NSString *)localStoreName cloudStorePathComponent:(NSString *)subPathComponent completion:(void(^)(void))completionHandler; 34 | 35 | - (NSPersistentStore *) MR_addInMemoryStore; 36 | - (NSPersistentStore *) MR_addAutoMigratingSqliteStoreNamed:(NSString *) storeFileName; 37 | - (NSPersistentStore *) MR_addSqliteStoreNamed:(id)storeFileName withOptions:(__autoreleasing NSDictionary *)options; 38 | 39 | - (void) MR_addiCloudContainerID:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreNamed:(NSString *)localStoreName cloudStorePathComponent:(NSString *)subPathComponent; 40 | - (void) MR_addiCloudContainerID:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreNamed:(NSString *)localStoreName cloudStorePathComponent:(NSString *)subPathComponent completion:(void(^)(void))completionBlock; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 | @end 24 | 25 | @interface MagicalRecord (ActionsDeprecated) 26 | 27 | + (void) saveUsingCurrentThreadContextWithBlock:(void (^)(NSManagedObjectContext *localContext))block completion:(MRSaveCompletionHandler)completion MR_DEPRECATED_WILL_BE_REMOVED_IN_3_0; 28 | + (void) saveUsingCurrentThreadContextWithBlockAndWait:(void (^)(NSManagedObjectContext *localContext))block MR_DEPRECATED_WILL_BE_REMOVED_IN_3_0; 29 | + (void) saveInBackgroundWithBlock:(void(^)(NSManagedObjectContext *localContext))block MR_DEPRECATED_WILL_BE_REMOVED_IN_3_0; 30 | + (void) saveInBackgroundWithBlock:(void(^)(NSManagedObjectContext *localContext))block completion:(void(^)(void))completion MR_DEPRECATED_WILL_BE_REMOVED_IN_3_0; 31 | + (void) saveInBackgroundUsingCurrentContextWithBlock:(void (^)(NSManagedObjectContext *localContext))block completion:(void (^)(void))completion errorHandler:(void (^)(NSError *error))errorHandler MR_DEPRECATED_WILL_BE_REMOVED_IN_3_0; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Sketch Toolbox/MagicalRecord/Core/MagicalRecord+Actions.m: -------------------------------------------------------------------------------- 1 | // 2 | // MagicalRecord+Actions.m 3 | // 4 | // Created by Saul Mora on 2/24/11. 5 | // Copyright 2011 Magical Panda Software. All rights reserved. 6 | // 7 | 8 | #import "CoreData+MagicalRecord.h" 9 | #import "NSManagedObjectContext+MagicalRecord.h" 10 | 11 | 12 | @implementation MagicalRecord (Actions) 13 | 14 | #pragma mark - Asynchronous saving 15 | 16 | + (void) saveWithBlock:(void(^)(NSManagedObjectContext *localContext))block; 17 | { 18 | [self saveWithBlock:block completion:nil]; 19 | } 20 | 21 | + (void) saveWithBlock:(void(^)(NSManagedObjectContext *localContext))block completion:(MRSaveCompletionHandler)completion; 22 | { 23 | NSManagedObjectContext *savingContext = [NSManagedObjectContext MR_rootSavingContext]; 24 | NSManagedObjectContext *localContext = [NSManagedObjectContext MR_contextWithParent:savingContext]; 25 | 26 | [localContext MR_setWorkingName:NSStringFromSelector(_cmd)]; 27 | 28 | [localContext performBlock:^{ 29 | if (block) { 30 | block(localContext); 31 | } 32 | 33 | [localContext MR_saveWithOptions:MRSaveParentContexts completion:completion]; 34 | }]; 35 | } 36 | 37 | #pragma mark - Synchronous saving 38 | 39 | + (void) saveWithBlockAndWait:(void(^)(NSManagedObjectContext *localContext))block; 40 | { 41 | NSManagedObjectContext *savingContext = [NSManagedObjectContext MR_rootSavingContext]; 42 | NSManagedObjectContext *localContext = [NSManagedObjectContext MR_contextWithParent:savingContext]; 43 | 44 | [localContext MR_setWorkingName:NSStringFromSelector(_cmd)]; 45 | 46 | [localContext performBlockAndWait:^{ 47 | if (block) { 48 | block(localContext); 49 | } 50 | 51 | [localContext MR_saveWithOptions:MRSaveParentContexts|MRSaveSynchronously completion:nil]; 52 | }]; 53 | } 54 | 55 | @end 56 | 57 | #pragma mark - Deprecated Methods — DO NOT USE 58 | @implementation MagicalRecord (ActionsDeprecated) 59 | 60 | + (void) saveUsingCurrentThreadContextWithBlock:(void (^)(NSManagedObjectContext *localContext))block completion:(MRSaveCompletionHandler)completion; 61 | { 62 | NSManagedObjectContext *localContext = [NSManagedObjectContext MR_contextForCurrentThread]; 63 | 64 | [localContext MR_setWorkingName:NSStringFromSelector(_cmd)]; 65 | 66 | [localContext performBlock:^{ 67 | if (block) { 68 | block(localContext); 69 | } 70 | 71 | [localContext MR_saveWithOptions:MRSaveParentContexts completion:completion]; 72 | }]; 73 | } 74 | 75 | + (void) saveUsingCurrentThreadContextWithBlockAndWait:(void (^)(NSManagedObjectContext *localContext))block; 76 | { 77 | NSManagedObjectContext *localContext = [NSManagedObjectContext MR_contextForCurrentThread]; 78 | 79 | [localContext MR_setWorkingName:NSStringFromSelector(_cmd)]; 80 | 81 | [localContext performBlockAndWait:^{ 82 | if (block) { 83 | block(localContext); 84 | } 85 | 86 | [localContext MR_saveWithOptions:MRSaveParentContexts|MRSaveSynchronously completion:nil]; 87 | }]; 88 | } 89 | 90 | + (void) saveInBackgroundWithBlock:(void(^)(NSManagedObjectContext *localContext))block 91 | { 92 | [[self class] saveWithBlock:block completion:nil]; 93 | } 94 | 95 | + (void) saveInBackgroundWithBlock:(void(^)(NSManagedObjectContext *localContext))block completion:(void(^)(void))completion 96 | { 97 | NSManagedObjectContext *savingContext = [NSManagedObjectContext MR_rootSavingContext]; 98 | NSManagedObjectContext *localContext = [NSManagedObjectContext MR_contextWithParent:savingContext]; 99 | 100 | [localContext MR_setWorkingName:NSStringFromSelector(_cmd)]; 101 | 102 | [localContext performBlock:^{ 103 | if (block) 104 | { 105 | block(localContext); 106 | } 107 | 108 | [localContext MR_saveToPersistentStoreAndWait]; 109 | 110 | if (completion) 111 | { 112 | completion(); 113 | } 114 | }]; 115 | } 116 | 117 | + (void) saveInBackgroundUsingCurrentContextWithBlock:(void (^)(NSManagedObjectContext *localContext))block completion:(void (^)(void))completion errorHandler:(void (^)(NSError *error))errorHandler; 118 | { 119 | NSManagedObjectContext *localContext = [NSManagedObjectContext MR_contextForCurrentThread]; 120 | 121 | [localContext MR_setWorkingName:NSStringFromSelector(_cmd)]; 122 | 123 | [localContext performBlock:^{ 124 | if (block) { 125 | block(localContext); 126 | } 127 | 128 | [localContext MR_saveToPersistentStoreWithCompletion:^(BOOL success, NSError *error) { 129 | if (success) { 130 | if (completion) { 131 | completion(); 132 | } 133 | } 134 | else { 135 | if (errorHandler) { 136 | errorHandler(error); 137 | } 138 | } 139 | }]; 140 | }]; 141 | } 142 | 143 | @end 144 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 | #import "MagicalRecordLogging.h" 11 | 12 | 13 | __weak static id errorHandlerTarget = nil; 14 | static SEL errorHandlerAction = nil; 15 | 16 | 17 | @implementation MagicalRecord (ErrorHandling) 18 | 19 | + (void) cleanUpErrorHanding; 20 | { 21 | errorHandlerTarget = nil; 22 | errorHandlerAction = nil; 23 | } 24 | 25 | + (void) defaultErrorHandler:(NSError *)error 26 | { 27 | NSDictionary *userInfo = [error userInfo]; 28 | for (NSArray *detailedError in [userInfo allValues]) 29 | { 30 | if ([detailedError isKindOfClass:[NSArray class]]) 31 | { 32 | for (NSError *e in detailedError) 33 | { 34 | if ([e respondsToSelector:@selector(userInfo)]) 35 | { 36 | MRLogError(@"Error Details: %@", [e userInfo]); 37 | } 38 | else 39 | { 40 | MRLogError(@"Error Details: %@", e); 41 | } 42 | } 43 | } 44 | else 45 | { 46 | MRLogError(@"Error: %@", detailedError); 47 | } 48 | } 49 | MRLogError(@"Error Message: %@", [error localizedDescription]); 50 | MRLogError(@"Error Domain: %@", [error domain]); 51 | MRLogError(@"Recovery Suggestion: %@", [error localizedRecoverySuggestion]); 52 | } 53 | 54 | + (void) handleErrors:(NSError *)error 55 | { 56 | if (error) 57 | { 58 | // If a custom error handler is set, call that 59 | if (errorHandlerTarget != nil && errorHandlerAction != nil) 60 | { 61 | #pragma clang diagnostic push 62 | #pragma clang diagnostic ignored "-Warc-performSelector-leaks" 63 | [errorHandlerTarget performSelector:errorHandlerAction withObject:error]; 64 | #pragma clang diagnostic pop 65 | } 66 | else 67 | { 68 | // Otherwise, fall back to the default error handling 69 | [self defaultErrorHandler:error]; 70 | } 71 | } 72 | } 73 | 74 | + (id) errorHandlerTarget 75 | { 76 | return errorHandlerTarget; 77 | } 78 | 79 | + (SEL) errorHandlerAction 80 | { 81 | return errorHandlerAction; 82 | } 83 | 84 | + (void) setErrorHandlerTarget:(id)target action:(SEL)action 85 | { 86 | errorHandlerTarget = target; /* Deliberately don't retain to avoid potential retain cycles */ 87 | errorHandlerAction = action; 88 | } 89 | 90 | - (void) handleErrors:(NSError *)error 91 | { 92 | [[self class] handleErrors:error]; 93 | } 94 | 95 | @end 96 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 MagicalRecordLoggingLevel kMagicalRecordLoggingLevel = MagicalRecordLoggingLevelVerbose; 12 | static BOOL kMagicalRecordShouldAutoCreateManagedObjectModel = NO; 13 | static BOOL kMagicalRecordShouldAutoCreateDefaultPersistentStoreCoordinator = NO; 14 | static BOOL kMagicalRecordShouldDeleteStoreOnModelMismatch = NO; 15 | 16 | @implementation MagicalRecord (Options) 17 | 18 | #pragma mark - Configuration Options 19 | 20 | + (BOOL) shouldAutoCreateManagedObjectModel; 21 | { 22 | return kMagicalRecordShouldAutoCreateManagedObjectModel; 23 | } 24 | 25 | + (void) setShouldAutoCreateManagedObjectModel:(BOOL)autoCreate; 26 | { 27 | kMagicalRecordShouldAutoCreateManagedObjectModel = autoCreate; 28 | } 29 | 30 | + (BOOL) shouldAutoCreateDefaultPersistentStoreCoordinator; 31 | { 32 | return kMagicalRecordShouldAutoCreateDefaultPersistentStoreCoordinator; 33 | } 34 | 35 | + (void) setShouldAutoCreateDefaultPersistentStoreCoordinator:(BOOL)autoCreate; 36 | { 37 | kMagicalRecordShouldAutoCreateDefaultPersistentStoreCoordinator = autoCreate; 38 | } 39 | 40 | + (BOOL) shouldDeleteStoreOnModelMismatch; 41 | { 42 | return kMagicalRecordShouldDeleteStoreOnModelMismatch; 43 | } 44 | 45 | + (void) setShouldDeleteStoreOnModelMismatch:(BOOL)shouldDelete; 46 | { 47 | kMagicalRecordShouldDeleteStoreOnModelMismatch = shouldDelete; 48 | } 49 | 50 | + (MagicalRecordLoggingLevel) loggingLevel; 51 | { 52 | return kMagicalRecordLoggingLevel; 53 | } 54 | 55 | + (void) setLoggingLevel:(MagicalRecordLoggingLevel)level; 56 | { 57 | kMagicalRecordLoggingLevel = level; 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 | #ifdef NS_BLOCKS_AVAILABLE 16 | 17 | #define MagicalRecordVersionNumber2_2 220 18 | #define MagicalRecordVersionNumber2_3 230 19 | 20 | extern const double MagicalRecordVersionNumber; 21 | 22 | extern NSString * const kMagicalRecordCleanedUpNotification; 23 | 24 | @class NSManagedObjectContext; 25 | typedef void (^CoreDataBlock)(NSManagedObjectContext *context); 26 | 27 | #endif 28 | 29 | @interface MagicalRecord : NSObject 30 | 31 | + (double) version; 32 | 33 | + (NSString *) currentStack; 34 | 35 | + (void) cleanUp; 36 | 37 | + (void) setDefaultModelFromClass:(Class)klass; 38 | + (void) setDefaultModelNamed:(NSString *)modelName; 39 | + (NSString *) defaultStoreName; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /Sketch Toolbox/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 | const double MagicalRecordVersionNumber = MagicalRecordVersionNumber2_3; 11 | 12 | NSString * const kMagicalRecordCleanedUpNotification = @"kMagicalRecordCleanedUpNotification"; 13 | 14 | @interface MagicalRecord (Internal) 15 | 16 | + (void) cleanUpStack; 17 | + (void) cleanUpErrorHanding; 18 | 19 | @end 20 | 21 | @interface NSManagedObjectContext (MagicalRecordInternal) 22 | 23 | + (void) MR_cleanUp; 24 | 25 | @end 26 | 27 | 28 | @implementation MagicalRecord 29 | 30 | + (double) version 31 | { 32 | return MagicalRecordVersionNumber; 33 | } 34 | 35 | + (void) cleanUp 36 | { 37 | [self cleanUpErrorHanding]; 38 | [self cleanUpStack]; 39 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 40 | [notificationCenter postNotificationName:kMagicalRecordCleanedUpNotification 41 | object:nil 42 | userInfo:nil]; 43 | } 44 | 45 | + (void) cleanUpStack; 46 | { 47 | [NSManagedObjectContext MR_cleanUp]; 48 | [NSManagedObjectModel MR_setDefaultManagedObjectModel:nil]; 49 | [NSPersistentStoreCoordinator MR_setDefaultStoreCoordinator:nil]; 50 | [NSPersistentStore MR_setDefaultPersistentStore:nil]; 51 | } 52 | 53 | + (NSString *) currentStack 54 | { 55 | NSMutableString *status = [NSMutableString stringWithString:@"Current Default Core Data Stack: ---- \n"]; 56 | 57 | [status appendFormat:@"Model: %@\n", [[NSManagedObjectModel MR_defaultManagedObjectModel] entityVersionHashesByName]]; 58 | [status appendFormat:@"Coordinator: %@\n", [NSPersistentStoreCoordinator MR_defaultStoreCoordinator]]; 59 | [status appendFormat:@"Store: %@\n", [NSPersistentStore MR_defaultPersistentStore]]; 60 | [status appendFormat:@"Default Context: %@\n", [[NSManagedObjectContext MR_defaultContext] MR_description]]; 61 | [status appendFormat:@"Context Chain: \n%@\n", [[NSManagedObjectContext MR_defaultContext] MR_parentChain]]; 62 | 63 | return status; 64 | } 65 | 66 | + (void) setDefaultModelNamed:(NSString *)modelName; 67 | { 68 | NSManagedObjectModel *model = [NSManagedObjectModel MR_managedObjectModelNamed:modelName]; 69 | [NSManagedObjectModel MR_setDefaultManagedObjectModel:model]; 70 | } 71 | 72 | + (void) setDefaultModelFromClass:(Class)klass; 73 | { 74 | NSBundle *bundle = [NSBundle bundleForClass:klass]; 75 | NSManagedObjectModel *model = [NSManagedObjectModel mergedModelFromBundles:[NSArray arrayWithObject:bundle]]; 76 | [NSManagedObjectModel MR_setDefaultManagedObjectModel:model]; 77 | } 78 | 79 | + (NSString *) defaultStoreName; 80 | { 81 | NSString *defaultName = [[[NSBundle mainBundle] infoDictionary] valueForKey:(id)kCFBundleNameKey]; 82 | if (defaultName == nil) 83 | { 84 | defaultName = kMagicalRecordDefaultStoreFileName; 85 | } 86 | if (![defaultName hasSuffix:@"sqlite"]) 87 | { 88 | defaultName = [defaultName stringByAppendingPathExtension:@"sqlite"]; 89 | } 90 | 91 | return defaultName; 92 | } 93 | 94 | 95 | #pragma mark - initialize 96 | 97 | + (void) initialize; 98 | { 99 | if (self == [MagicalRecord class]) 100 | { 101 | #ifdef MR_SHORTHAND 102 | [self swizzleShorthandMethods]; 103 | #endif 104 | [self setShouldAutoCreateManagedObjectModel:YES]; 105 | [self setShouldAutoCreateDefaultPersistentStoreCoordinator:NO]; 106 | #ifdef DEBUG 107 | [self setShouldDeleteStoreOnModelMismatch:YES]; 108 | #else 109 | [self setShouldDeleteStoreOnModelMismatch:NO]; 110 | #endif 111 | } 112 | } 113 | 114 | @end 115 | 116 | 117 | -------------------------------------------------------------------------------- /Sketch Toolbox/MagicalRecord/Core/MagicalRecordDeprecated.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Tony Arnold on 10/04/2014. 3 | // Copyright (c) 2014 Magical Panda Software LLC. All rights reserved. 4 | // 5 | 6 | #define MR_DEPRECATED_WILL_BE_REMOVED_IN_3_0 __attribute__((deprecated("This method will be removed in MagicalRecord 3.0."))) 7 | #define MR_DEPRECATED_WILL_BE_REMOVED_IN_3_0_USE(MSG) __attribute__((deprecated("This method will be removed in MagicalRecord 3.0. " MSG))) 8 | -------------------------------------------------------------------------------- /Sketch Toolbox/MagicalRecord/Core/MagicalRecordLogging.h: -------------------------------------------------------------------------------- 1 | // 2 | // MagicalRecordLogging.h 3 | // MagicalRecord 4 | // 5 | // Created by Saul Mora on 10/4/13. 6 | // Copyright (c) 2013 Magical Panda Software LLC. All rights reserved. 7 | // 8 | 9 | #ifndef MagicalRecord_MagicalRecordLogging_h 10 | #define MagicalRecord_MagicalRecordLogging_h 11 | 12 | #import "MagicalRecord.h" 13 | #import "MagicalRecord+Options.h" 14 | 15 | #define LOG_ASYNC_ENABLED YES 16 | 17 | #define LOG_ASYNC_ERROR ( NO && LOG_ASYNC_ENABLED) 18 | #define LOG_ASYNC_WARN (YES && LOG_ASYNC_ENABLED) 19 | #define LOG_ASYNC_INFO (YES && LOG_ASYNC_ENABLED) 20 | #define LOG_ASYNC_VERBOSE (YES && LOG_ASYNC_ENABLED) 21 | 22 | #ifdef MR_LOGGING_ENABLED 23 | 24 | #ifndef LOG_MACRO 25 | 26 | #define LOG_MACRO(isAsynchronous, lvl, flg, ctx, atag, fnct, frmt, ...) \ 27 | NSLog (frmt, ##__VA_ARGS__) 28 | 29 | #define LOG_MAYBE(async, lvl, flg, ctx, fnct, frmt, ...) \ 30 | do { if(lvl & flg) { LOG_MACRO(async, lvl, flg, ctx, nil, fnct, frmt, ##__VA_ARGS__); } } while(0) 31 | 32 | #define LOG_OBJC_MAYBE(async, lvl, flg, ctx, frmt, ...) \ 33 | LOG_MAYBE(async, lvl, flg, ctx, sel_getName(_cmd), frmt, ##__VA_ARGS__) 34 | 35 | #define LOG_C_MAYBE(async, lvl, flg, ctx, frmt, ...) \ 36 | LOG_MAYBE(async, lvl, flg, ctx, __FUNCTION__, frmt, ##__VA_ARGS__) 37 | 38 | #endif 39 | 40 | #define MRLogFatal(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_ERROR, [MagicalRecord loggingLevel], MagicalRecordLoggingLevelFatal, 0, frmt, ##__VA_ARGS__) 41 | #define MRLogError(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_ERROR, [MagicalRecord loggingLevel], MagicalRecordLoggingLevelError, 0, frmt, ##__VA_ARGS__) 42 | #define MRLogWarn(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_WARN, [MagicalRecord loggingLevel], MagicalRecordLoggingLevelWarn, 0, frmt, ##__VA_ARGS__) 43 | #define MRLogInfo(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_INFO, [MagicalRecord loggingLevel], MagicalRecordLoggingLevelInfo, 0, frmt, ##__VA_ARGS__) 44 | #define MRLogVerbose(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_VERBOSE, [MagicalRecord loggingLevel], MagicalRecordLoggingLevelVerbose, 0, frmt, ##__VA_ARGS__) 45 | 46 | #define MRLogCFatal(frmt, ...) LOG_C_MAYBE(LOG_ASYNC_ERROR, [MagicalRecord loggingLevel], MagicalRecordLoggingLevelFatal, 0, frmt, ##__VA_ARGS__) 47 | #define MRLogCError(frmt, ...) LOG_C_MAYBE(LOG_ASYNC_ERROR, [MagicalRecord loggingLevel], MagicalRecordLoggingLevelError, 0, frmt, ##__VA_ARGS__) 48 | #define MRLogCWarn(frmt, ...) LOG_C_MAYBE(LOG_ASYNC_WARN, [MagicalRecord loggingLevel], MagicalRecordLoggingLevelWarn, 0, frmt, ##__VA_ARGS__) 49 | #define MRLogCInfo(frmt, ...) LOG_C_MAYBE(LOG_ASYNC_INFO, [MagicalRecord loggingLevel], MagicalRecordLoggingLevelInfo, 0, frmt, ##__VA_ARGS__) 50 | #define MRLogCVerbose(frmt, ...) LOG_C_MAYBE(LOG_ASYNC_VERBOSE, [MagicalRecord loggingLevel], MagicalRecordLoggingLevelVerbose, 0, frmt, ##__VA_ARGS__) 51 | 52 | #else 53 | 54 | #define MRLogFatal(frmt, ...) ((void)0) 55 | #define MRLogError(frmt, ...) ((void)0) 56 | #define MRLogWarn(frmt, ...) ((void)0) 57 | #define MRLogInfo(frmt, ...) ((void)0) 58 | #define MRLogVerbose(frmt, ...) ((void)0) 59 | 60 | #define MRLogCFatal(frmt, ...) ((void)0) 61 | #define MRLogCError(frmt, ...) ((void)0) 62 | #define MRLogCWarn(frmt, ...) ((void)0) 63 | #define MRLogCInfo(frmt, ...) ((void)0) 64 | #define MRLogCVerbose(frmt, ...) ((void)0) 65 | 66 | #endif 67 | 68 | #endif 69 | 70 | -------------------------------------------------------------------------------- /Sketch Toolbox/MagicalRecord/CoreData+MagicalRecord.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef NS_BLOCKS_AVAILABLE 3 | #warning MagicalRecord requires blocks 4 | #endif 5 | 6 | #ifdef __OBJC__ 7 | 8 | #import 9 | #import 10 | 11 | #ifdef MR_SHORTHAND 12 | #import "MagicalRecordShorthand.h" 13 | #endif 14 | 15 | #import "MagicalRecord.h" 16 | #import "MagicalRecordDeprecated.h" 17 | #import "MagicalRecord+Actions.h" 18 | #import "MagicalRecord+ErrorHandling.h" 19 | #import "MagicalRecord+Options.h" 20 | #import "MagicalRecord+ShorthandSupport.h" 21 | #import "MagicalRecord+Setup.h" 22 | #import "MagicalRecord+iCloud.h" 23 | 24 | #import "NSManagedObject+MagicalRecord.h" 25 | #import "NSManagedObject+MagicalRequests.h" 26 | #import "NSManagedObject+MagicalFinders.h" 27 | #import "NSManagedObject+MagicalAggregation.h" 28 | #import "NSManagedObjectContext+MagicalRecord.h" 29 | #import "NSManagedObjectContext+MagicalObserving.h" 30 | #import "NSManagedObjectContext+MagicalSaves.h" 31 | #import "NSManagedObjectContext+MagicalThreading.h" 32 | #import "NSPersistentStoreCoordinator+MagicalRecord.h" 33 | #import "NSManagedObjectModel+MagicalRecord.h" 34 | #import "NSPersistentStore+MagicalRecord.h" 35 | 36 | #import "MagicalImportFunctions.h" 37 | #import "NSManagedObject+MagicalDataImport.h" 38 | #import "NSNumber+MagicalDataImport.h" 39 | #import "NSObject+MagicalDataImport.h" 40 | #import "NSString+MagicalDataImport.h" 41 | #import "NSAttributeDescription+MagicalDataImport.h" 42 | #import "NSRelationshipDescription+MagicalDataImport.h" 43 | #import "NSEntityDescription+MagicalDataImport.h" 44 | 45 | #endif 46 | 47 | // @see https://github.com/ccgus/fmdb/commit/aef763eeb64e6fa654e7d121f1df4c16a98d9f4f 48 | #define MRDispatchQueueRelease(q) (dispatch_release(q)) 49 | 50 | #if TARGET_OS_IPHONE 51 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000 52 | #undef MRDispatchQueueRelease 53 | #define MRDispatchQueueRelease(q) 54 | #endif 55 | #else 56 | #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 57 | #undef MRDispatchQueueRelease 58 | #define MRDispatchQueueRelease(q) 59 | #endif 60 | #endif 61 | -------------------------------------------------------------------------------- /Sketch Toolbox/Plugin.h: -------------------------------------------------------------------------------- 1 | // 2 | // Plugin.h 3 | // Sketch Toolbox 4 | // 5 | // Created by Shahruz Shaukat on 5/19/14. 6 | // Copyright (c) 2014 Shahruz Shaukat. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | 13 | @interface Plugin : NSManagedObject 14 | 15 | 16 | typedef NS_ENUM(UInt16, PluginState) { 17 | PluginStateUninstalled, 18 | PluginStateInstalled, 19 | PluginStateDownloading 20 | }; 21 | 22 | @property (nonatomic, retain) NSString * name; 23 | @property (nonatomic, retain) NSString * owner; 24 | @property (nonatomic, retain) NSString * desc; 25 | @property (nonatomic, retain) NSDate * installed; 26 | @property (nonatomic, retain) NSData * downloadPath; 27 | @property (nonatomic, retain) NSDate * lastModified; 28 | @property (nonatomic, retain) NSString * directoryName; 29 | @property (nonatomic) UInt32 stars; 30 | @property (nonatomic) UInt16 state; 31 | 32 | -(BOOL)isInstalled; 33 | 34 | -(void)download; 35 | -(void)delete; 36 | 37 | -(NSString*)displayName; 38 | -(NSURL*)repoURL; 39 | 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /Sketch Toolbox/Plugin.m: -------------------------------------------------------------------------------- 1 | // 2 | // Plugin.m 3 | // Sketch Toolbox 4 | // 5 | // Created by Shahruz Shaukat on 5/19/14. 6 | // Copyright (c) 2014 Shahruz Shaukat. All rights reserved. 7 | // 8 | 9 | #import "Plugin.h" 10 | #import "SSZipArchive.h" 11 | 12 | @implementation Plugin 13 | 14 | @dynamic name; 15 | @dynamic owner; 16 | @dynamic desc; 17 | @dynamic installed; 18 | @dynamic stars; 19 | @dynamic downloadPath; 20 | @dynamic lastModified; 21 | @dynamic directoryName; 22 | @dynamic state; 23 | 24 | #pragma mark - Main Methods 25 | -(void)download { 26 | if (self.isInstalled) return; 27 | NSLog(@"Downloading %@", self.name); 28 | self.state = PluginStateDownloading; 29 | 30 | NSURL *url = [NSURL URLWithString: 31 | [NSString stringWithFormat: 32 | @"%@/archive/master.zip", self.repoURL]]; 33 | NSURLRequest *request = [NSURLRequest requestWithURL:url]; 34 | [NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) { 35 | NSString *tmpPath = [@"/tmp/" stringByAppendingPathComponent: 36 | [NSString stringWithFormat:@"%@-%@.zip", self.owner, self.name]]; 37 | NSString *tmpOutputPath = @"/tmp/"; 38 | NSString *tmpContentsPath = [tmpOutputPath stringByAppendingPathComponent: 39 | [NSString stringWithFormat:@"%@-master", self.name]]; 40 | [data writeToFile:tmpPath atomically:YES]; 41 | [SSZipArchive unzipFileAtPath:tmpPath toDestination:tmpOutputPath]; 42 | NSFileManager *fm = [NSFileManager defaultManager]; 43 | [fm removeItemAtPath:tmpPath error:nil]; 44 | 45 | NSMutableArray *downloadPaths = [@[] mutableCopy]; 46 | 47 | NSArray *paths = @[kSketch3AppStorePluginPath, kSketch3PluginPath, kSketch3BetaPluginPath, kSketch2AppStorePluginPath, kSketch2PluginPath]; 48 | 49 | [paths enumerateObjectsUsingBlock:^(NSString *path, NSUInteger idx, BOOL *stop) { 50 | if ([fm fileExistsAtPath:[path stringByExpandingTildeInPath]]) { 51 | NSString *outputPath = [NSString stringWithFormat:@"%@/%@", [path stringByExpandingTildeInPath], self.displayName]; 52 | [fm copyItemAtPath:tmpContentsPath toPath:outputPath error:nil]; 53 | NSLog(@"Copied to %@", outputPath); 54 | [downloadPaths addObject:outputPath]; 55 | } 56 | }]; 57 | 58 | [fm removeItemAtPath:tmpContentsPath error:nil]; 59 | 60 | NSLog(@"Finished downloading %@", self.name); 61 | self.downloadPath = [NSKeyedArchiver archivedDataWithRootObject:downloadPaths]; 62 | self.installed = [NSDate date]; 63 | self.state = PluginStateInstalled; 64 | 65 | [[NSManagedObjectContext MR_defaultContext] MR_saveToPersistentStoreAndWait]; 66 | [[NSNotificationCenter defaultCenter] postNotificationName:@"pluginStatusUpdated" object:nil]; 67 | }]; 68 | 69 | } 70 | 71 | -(void)delete { 72 | if (!self.isInstalled) return; 73 | NSFileManager *fm = [NSFileManager defaultManager]; 74 | NSArray *downloadPaths = [NSKeyedUnarchiver unarchiveObjectWithData:self.downloadPath]; 75 | [downloadPaths enumerateObjectsUsingBlock:^(NSString *downloadPath, NSUInteger idx, BOOL *stop) { 76 | [fm removeItemAtPath:downloadPath error:nil]; 77 | }]; 78 | self.installed = nil; 79 | self.downloadPath = nil; 80 | self.state = PluginStateUninstalled; 81 | [[NSManagedObjectContext MR_defaultContext] MR_saveToPersistentStoreAndWait]; 82 | [[NSNotificationCenter defaultCenter] postNotificationName:@"pluginStatusUpdated" object:nil]; 83 | } 84 | 85 | #pragma mark - Properties 86 | 87 | -(BOOL)isInstalled { 88 | return self.state == PluginStateInstalled || self.state == PluginStateDownloading; 89 | } 90 | 91 | -(NSString*)displayName { 92 | return [[self.name stringByReplacingOccurrencesOfString:@"-" withString:@" "] capitalizedString]; 93 | } 94 | 95 | -(NSURL*)repoURL { 96 | return [NSURL URLWithString: 97 | [NSString stringWithFormat:@"https://github.com/%@/%@", self.owner, self.name]]; 98 | } 99 | 100 | @end 101 | -------------------------------------------------------------------------------- /Sketch Toolbox/PluginManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // PluginManager.h 3 | // Sketch Toolbox 4 | // 5 | // Created by Shahruz Shaukat on 5/19/14. 6 | // Copyright (c) 2014 Shahruz Shaukat. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class Plugin; 12 | 13 | @interface PluginManager : NSObject 14 | 15 | +(id)sharedManager; 16 | 17 | -(void)downloadCatalog; 18 | -(NSArray*)localPlugins; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Sketch Toolbox/PluginManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // PluginManager.m 3 | // Sketch Toolbox 4 | // 5 | // Created by Shahruz Shaukat on 5/19/14. 6 | // Copyright (c) 2014 Shahruz Shaukat. All rights reserved. 7 | // 8 | 9 | #import "PluginManager.h" 10 | #import "Plugin.h" 11 | #import "SSZipArchive/SSZipArchive.h" 12 | #import "STAppDelegate.h" 13 | 14 | @implementation PluginManager 15 | 16 | + (id)sharedManager { 17 | static PluginManager *sharedPluginManager = nil; 18 | static dispatch_once_t onceToken; 19 | dispatch_once(&onceToken, ^{ 20 | sharedPluginManager = [[self alloc] init]; 21 | }); 22 | return sharedPluginManager; 23 | } 24 | 25 | -(void)downloadCatalog { 26 | NSURL *requestURL = [NSURL URLWithString:kPluginCatalogURL]; 27 | NSURLRequest *request = [NSURLRequest requestWithURL:requestURL]; 28 | NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil]; 29 | NSArray *remotePlugins = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil]; 30 | [remotePlugins enumerateObjectsUsingBlock:^(NSDictionary *p, NSUInteger idx, BOOL *stop) { 31 | [self upsertPlugin:p]; 32 | }]; 33 | } 34 | 35 | -(NSArray *)localPlugins { 36 | NSFileManager *fm = [NSFileManager defaultManager]; 37 | NSArray *paths = @[kSketch3AppStorePluginPath, kSketch3PluginPath, kSketch3BetaPluginPath,kSketch2AppStorePluginPath, kSketch2PluginPath]; 38 | NSMutableArray *localPlugins = [@[] mutableCopy]; 39 | 40 | [paths enumerateObjectsUsingBlock:^(NSString *path, NSUInteger idx, BOOL *stop) { 41 | path = [path stringByExpandingTildeInPath]; 42 | NSArray *plugins = [fm contentsOfDirectoryAtPath:path error:nil]; 43 | [plugins enumerateObjectsUsingBlock:^(NSString *fileName, NSUInteger idx, BOOL *stop) { 44 | if ([[fileName substringToIndex:1] isEqualToString:@"."]) return; 45 | Plugin *plugin = [Plugin MR_findFirstByAttribute:@"directoryName" withValue:fileName]; 46 | if (!plugin) { 47 | [localPlugins addObject:@{@"fileName": fileName, 48 | @"fileURL": [path stringByAppendingPathComponent:fileName] 49 | }]; 50 | } 51 | }]; 52 | }]; 53 | return [localPlugins copy]; 54 | } 55 | 56 | #pragma mark - Private 57 | 58 | -(void)upsertPlugin:(NSDictionary *)dictionary { 59 | 60 | NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(name = %@) AND (owner = %@)", dictionary[@"name"], dictionary[@"owner"]]; 61 | 62 | Plugin *plugin = [Plugin MR_findFirstWithPredicate:predicate]; 63 | 64 | if (!plugin) { 65 | plugin = [Plugin MR_createEntity]; 66 | plugin.name = dictionary[@"name"]; 67 | plugin.owner = dictionary[@"owner"]; 68 | plugin.installed = nil; 69 | plugin.lastModified = [NSDate dateWithTimeIntervalSince1970:0]; 70 | plugin.directoryName = plugin.displayName; 71 | } 72 | 73 | plugin.desc = dictionary[@"description"]; 74 | 75 | if (plugin.isInstalled) { 76 | 77 | NSLog(@"Getting latest info for %@", plugin.name); 78 | 79 | NSURL *url = [NSURL URLWithString: 80 | [NSString stringWithFormat: 81 | @"https://api.github.com/repos/%@/%@", plugin.owner, plugin.name]]; 82 | 83 | NSURLRequest *request = [NSURLRequest requestWithURL:url]; 84 | 85 | [NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) { 86 | NSDictionary *dataDict = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil]; 87 | plugin.stars = [dataDict[@"stargazers_count"] intValue]; 88 | 89 | NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; 90 | [formatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss.SSSZ"]; 91 | NSLocale *posix = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"]; 92 | [formatter setLocale:posix]; 93 | NSDate *pushed_date = [formatter dateFromString:dataDict[@"pushed_at"]]; 94 | 95 | if (plugin.isInstalled && ([plugin.installed compare:pushed_date] == NSOrderedAscending)) { 96 | NSLog(@"Updating %@", plugin.name); 97 | [plugin download]; 98 | } 99 | 100 | plugin.lastModified = [NSDate date]; 101 | [self triggerUpdate]; 102 | }]; 103 | 104 | } else { 105 | plugin.lastModified = [NSDate date]; 106 | [self triggerUpdate]; 107 | } 108 | } 109 | 110 | -(void)triggerUpdate { 111 | [[NSManagedObjectContext MR_defaultContext] MR_saveToPersistentStoreAndWait]; 112 | [[NSNotificationCenter defaultCenter] postNotificationName:@"pluginStatusUpdated" object:nil]; 113 | } 114 | 115 | @end 116 | -------------------------------------------------------------------------------- /Sketch Toolbox/SSZipArchive/SSZipArchive.h: -------------------------------------------------------------------------------- 1 | // 2 | // SSZipArchive.h 3 | // SSZipArchive 4 | // 5 | // Created by Sam Soffes on 7/21/10. 6 | // Copyright (c) Sam Soffes 2010-2014. All rights reserved. 7 | // 8 | 9 | #ifndef _SSZIPARCHIVE_H 10 | #define _SSZIPARCHIVE_H 11 | 12 | #import 13 | #include "unzip.h" 14 | 15 | @protocol SSZipArchiveDelegate; 16 | 17 | @interface SSZipArchive : NSObject 18 | 19 | // Unzip 20 | + (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination; 21 | + (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination overwrite:(BOOL)overwrite password:(NSString *)password error:(NSError **)error; 22 | 23 | + (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination delegate:(id)delegate; 24 | + (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination overwrite:(BOOL)overwrite password:(NSString *)password error:(NSError **)error delegate:(id)delegate; 25 | 26 | // Zip 27 | + (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)filenames; 28 | + (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath; 29 | 30 | - (id)initWithPath:(NSString *)path; 31 | - (BOOL)open; 32 | - (BOOL)writeFile:(NSString *)path; 33 | - (BOOL)writeData:(NSData *)data filename:(NSString *)filename; 34 | - (BOOL)close; 35 | 36 | @end 37 | 38 | 39 | @protocol SSZipArchiveDelegate 40 | 41 | @optional 42 | 43 | - (void)zipArchiveWillUnzipArchiveAtPath:(NSString *)path zipInfo:(unz_global_info)zipInfo; 44 | - (void)zipArchiveDidUnzipArchiveAtPath:(NSString *)path zipInfo:(unz_global_info)zipInfo unzippedPath:(NSString *)unzippedPath; 45 | 46 | - (void)zipArchiveWillUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo; 47 | - (void)zipArchiveDidUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo; 48 | 49 | - (void)zipArchiveProgressEvent:(NSInteger)loaded total:(NSInteger)total; 50 | @end 51 | 52 | #endif /* _SSZIPARCHIVE_H */ 53 | -------------------------------------------------------------------------------- /Sketch Toolbox/SSZipArchive/minizip/crypt.h: -------------------------------------------------------------------------------- 1 | /* crypt.h -- base code for crypt/uncrypt ZIPfile 2 | 3 | 4 | Version 1.01e, February 12th, 2005 5 | 6 | Copyright (C) 1998-2005 Gilles Vollant 7 | 8 | This code is a modified version of crypting code in Infozip distribution 9 | 10 | The encryption/decryption parts of this source code (as opposed to the 11 | non-echoing password parts) were originally written in Europe. The 12 | whole source package can be freely distributed, including from the USA. 13 | (Prior to January 2000, re-export from the US was a violation of US law.) 14 | 15 | This encryption code is a direct transcription of the algorithm from 16 | Roger Schlafly, described by Phil Katz in the file appnote.txt. This 17 | file (appnote.txt) is distributed with the PKZIP program (even in the 18 | version without encryption capabilities). 19 | 20 | If you don't need crypting in your application, just define symbols 21 | NOCRYPT and NOUNCRYPT. 22 | 23 | This code support the "Traditional PKWARE Encryption". 24 | 25 | The new AES encryption added on Zip format by Winzip (see the page 26 | http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong 27 | Encryption is not supported. 28 | */ 29 | 30 | #define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8)) 31 | 32 | /*********************************************************************** 33 | * Return the next byte in the pseudo-random sequence 34 | */ 35 | static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab) 36 | { 37 | unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an 38 | * unpredictable manner on 16-bit systems; not a problem 39 | * with any known compiler so far, though */ 40 | 41 | temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2; 42 | return (int)(((temp * (temp ^ 1)) >> 8) & 0xff); 43 | } 44 | 45 | /*********************************************************************** 46 | * Update the encryption keys with the next byte of plain text 47 | */ 48 | static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c) 49 | { 50 | (*(pkeys+0)) = CRC32((*(pkeys+0)), c); 51 | (*(pkeys+1)) += (*(pkeys+0)) & 0xff; 52 | (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1; 53 | { 54 | register int keyshift = (int)((*(pkeys+1)) >> 24); 55 | (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift); 56 | } 57 | return c; 58 | } 59 | 60 | 61 | /*********************************************************************** 62 | * Initialize the encryption keys and the random header according to 63 | * the given password. 64 | */ 65 | static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab) 66 | { 67 | *(pkeys+0) = 305419896L; 68 | *(pkeys+1) = 591751049L; 69 | *(pkeys+2) = 878082192L; 70 | while (*passwd != '\0') { 71 | update_keys(pkeys,pcrc_32_tab,(int)*passwd); 72 | passwd++; 73 | } 74 | } 75 | 76 | #define zdecode(pkeys,pcrc_32_tab,c) \ 77 | (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab))) 78 | 79 | #define zencode(pkeys,pcrc_32_tab,c,t) \ 80 | (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c)) 81 | 82 | #ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED 83 | 84 | #define RAND_HEAD_LEN 12 85 | /* "last resort" source for second part of crypt seed pattern */ 86 | # ifndef ZCR_SEED2 87 | # define ZCR_SEED2 3141592654UL /* use PI as default pattern */ 88 | # endif 89 | 90 | static int crypthead(const char* passwd, /* password string */ 91 | unsigned char* buf, /* where to write header */ 92 | int bufSize, 93 | unsigned long* pkeys, 94 | const unsigned long* pcrc_32_tab, 95 | unsigned long crcForCrypting) 96 | { 97 | int n; /* index in random header */ 98 | int t; /* temporary */ 99 | int c; /* random byte */ 100 | unsigned char header[RAND_HEAD_LEN-2]; /* random header */ 101 | static unsigned calls = 0; /* ensure different random header each time */ 102 | 103 | if (bufSize> 7) & 0xff; 118 | header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t); 119 | } 120 | /* Encrypt random header (last two bytes is high word of crc) */ 121 | init_keys(passwd, pkeys, pcrc_32_tab); 122 | for (n = 0; n < RAND_HEAD_LEN-2; n++) 123 | { 124 | buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t); 125 | } 126 | buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t); 127 | buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t); 128 | return n; 129 | } 130 | 131 | #endif 132 | -------------------------------------------------------------------------------- /Sketch Toolbox/SSZipArchive/minizip/mztools.h: -------------------------------------------------------------------------------- 1 | /* 2 | Additional tools for Minizip 3 | Code: Xavier Roche '2004 4 | License: Same as ZLIB (www.gzip.org) 5 | */ 6 | 7 | #ifndef _zip_tools_H 8 | #define _zip_tools_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #ifndef _ZLIB_H 15 | #include "zlib.h" 16 | #endif 17 | 18 | #include "unzip.h" 19 | 20 | /* Repair a ZIP file (missing central directory) 21 | file: file to recover 22 | fileOut: output file after recovery 23 | fileOutTmp: temporary file name used for recovery 24 | */ 25 | extern int ZEXPORT unzRepair(const char* file, 26 | const char* fileOut, 27 | const char* fileOutTmp, 28 | uLong* nRecovered, 29 | uLong* bytesRecovered); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /Sketch Toolbox/STAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // STAppDelegate.h 3 | // Sketch Toolbox 4 | // 5 | // Created by Shahruz Shaukat on 5/19/14. 6 | // Copyright (c) 2014 Shahruz Shaukat. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface STAppDelegate : NSObject 12 | 13 | @property (assign) IBOutlet NSWindow *window; 14 | @property (nonatomic, strong) IBOutlet NSSegmentedControl *filterControl; 15 | @property (nonatomic, strong) IBOutlet NSSearchField *searchField; 16 | 17 | @property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator; 18 | @property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel; 19 | @property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext; 20 | 21 | - (IBAction)saveAction:(id)sender; 22 | 23 | 24 | -(IBAction)filterPlugins:(NSSearchField *)searchField; 25 | -(IBAction)segmentSelected:(NSSegmentedControl*)sender; 26 | -(IBAction)feedbackEmailClicked:(id)sender; 27 | 28 | - (NSString *)applicationFilesDirectory; 29 | 30 | @property (nonatomic, strong) IBOutlet NSTableView *tableView; 31 | @property (nonatomic, strong) IBOutlet NSButton *refreshButton; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Sketch Toolbox/STPluginCellView.h: -------------------------------------------------------------------------------- 1 | // 2 | // STPluginCellView.h 3 | // Sketch Toolbox 4 | // 5 | // Created by Shahruz Shaukat on 5/19/14. 6 | // Copyright (c) 2014 Shahruz Shaukat. All rights reserved. 7 | // 8 | 9 | #import 10 | @class Plugin; 11 | 12 | @interface STPluginCellView : NSTableCellView 13 | 14 | @property (nonatomic, strong) Plugin *plugin; 15 | 16 | @property (nonatomic, strong) IBOutlet NSButton *nameButton; 17 | @property (nonatomic, strong) IBOutlet NSTextField *descriptionField; 18 | @property (nonatomic, strong) IBOutlet NSTextField *owner; 19 | @property (nonatomic, strong) IBOutlet NSTextField *starCount; 20 | @property (nonatomic, strong) IBOutlet NSButton *actionButton; 21 | 22 | -(IBAction)actionButtonPressed:(id)sender; 23 | -(IBAction)infoButtonPressed:(id)sender; 24 | -(IBAction)nameButtonPressed:(id)sender; 25 | 26 | -(void)populate; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Sketch Toolbox/STPluginCellView.m: -------------------------------------------------------------------------------- 1 | // 2 | // STPluginCellView.m 3 | // Sketch Toolbox 4 | // 5 | // Created by Shahruz Shaukat on 5/19/14. 6 | // Copyright (c) 2014 Shahruz Shaukat. All rights reserved. 7 | // 8 | 9 | #import "STPluginCellView.h" 10 | #import "Plugin.h" 11 | 12 | @implementation STPluginCellView 13 | 14 | -(IBAction)actionButtonPressed:(NSButton*)sender { 15 | if (!self.plugin.isInstalled) { 16 | [sender setTitle:@"Downloading..."]; 17 | [self.plugin download]; 18 | } 19 | else [self.plugin delete]; 20 | } 21 | 22 | -(void)infoButtonPressed:(id)sender { 23 | [self openGitHubURL]; 24 | } 25 | 26 | - (void)nameButtonPressed:(id)sender { 27 | [self openGitHubURL]; 28 | } 29 | 30 | -(void)populate { 31 | self.nameButton.title = self.plugin.displayName; 32 | self.descriptionField.stringValue = self.plugin.desc; 33 | self.owner.stringValue = self.plugin.owner; 34 | self.starCount.stringValue = [NSString stringWithFormat:@"%i", self.plugin.stars]; 35 | if (self.plugin.state == PluginStateInstalled) { 36 | [self.actionButton setTitle:@"Uninstall"]; 37 | } else if (self.plugin.state == PluginStateDownloading) { 38 | [self.actionButton setTitle:@"Downloading..."]; 39 | } else { 40 | [self.actionButton setTitle:@"Install"]; 41 | } 42 | } 43 | 44 | - (void)openGitHubURL { 45 | [[NSWorkspace sharedWorkspace] openURL:self.plugin.repoURL]; 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Sketch Toolbox/Sketch Toolbox-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | uz.shahr.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 0.5.1 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 051 25 | LSApplicationCategoryType 26 | public.app-category.graphics-design 27 | LSMinimumSystemVersion 28 | ${MACOSX_DEPLOYMENT_TARGET} 29 | NSHumanReadableCopyright 30 | Copyright © 2014 Shahruz Shaukat. All rights reserved. 31 | NSMainNibFile 32 | MainMenu 33 | NSPrincipalClass 34 | NSApplication 35 | SUFeedURL 36 | http://sketchtoolbox.com/updates/appcast.xml 37 | SUPublicDSAKeyFile 38 | dsa_pub.pem 39 | 40 | 41 | -------------------------------------------------------------------------------- /Sketch Toolbox/Sketch Toolbox-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #ifdef __OBJC__ 8 | #import 9 | 10 | #import "CoreData+MagicalRecord.h" 11 | 12 | #import "Constants.h" 13 | #endif 14 | -------------------------------------------------------------------------------- /Sketch Toolbox/Sketch_Toolbox.xcdatamodeld/.xccurrentversion: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | _XCCurrentVersionName 6 | Sketch_Toolbox.xcdatamodel 7 | 8 | 9 | -------------------------------------------------------------------------------- /Sketch Toolbox/Sketch_Toolbox.xcdatamodeld/Sketch_Toolbox.xcdatamodel/contents: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Sketch Toolbox/dsa_pub.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIIDOzCCAi0GByqGSM44BAEwggIgAoIBAQDH/Nfs1nHCVqQFP5qF2bB0kRPEL6JY 3 | 2mrzg2B3uUWzDVzlRYOz2K2OEubsq/K5xlJUC7SIUlOAdBGL9CfTXhNdbN2Wd99b 4 | xp/db68HCoLHmjnzn36bHo6EQps4Pu/yL0GxflClUFN+3cP0MLX4unhhfhr1mCNp 5 | STPzgFvpaSTicz6GV5en1KN3xu3QmtJAYk5778r4N8c/31Z4zJTtJwURlksZJpZD 6 | Q0foZqLZpu5Lnj7zwGvrBBvd40+Lh1YD5oeK2v4GO7+LXoAakA0oCDSNMG4zr2VK 7 | IWeLG/4we7f8lsGlJ7u2qlUkbwuy7T1nIbH18UsS11wylQSTdpSDmUz1AhUAzXWe 8 | y5WTOm7lc4DlI6PCxQswCe8CggEAK6dDiEc1F5dOjTaSZMQB5VPBT9ka4DBt0AzY 9 | KWcexnvtpuG8HGH2AFl3xhz/2sWmKDk7xg9MhxibC9dHO9JQ9yhFCuzbnuLDaIq7 10 | DUTncUxn3p7FCdmDjXPmvSbgTadS44CvONUzMagpWmGXK8qAXsD+rq2MA+J+fxio 11 | ZbGC0EUAxEFOJD2Me9TGpCOGpb8HXlDMKgN4/OmX74338ZRz8taR8AdsZ2Z4oKZb 12 | bIhJwRY5cis2APM7hBVZ66h10dEYrSI6Useuf0o3pw9sCAVD1TehkVKkqYbSNmah 13 | XKJvxmfpbZtBZ8LuanuN7b37D6u808EzeHVfVH0T1hegojiqwQOCAQYAAoIBAQCi 14 | kgdJD+MljkepHQ/pKwmMqc+l6UwRmMjXCI36SD5wrymRb0IKk33ik9J4oHAKaQvn 15 | +Gafry1tu7p0rve/OQaNpwE6qqdGIcmQiisz1tupnGuPh+QvMPKEiAYGJzgBzg76 16 | dXRvWGeyND4W2NHYpHdj2FdCqShWyemeSsORSMJiGvAnJAvYYFQI17WJOlRRc5QP 17 | rBlue0zAnaTx84WvwuuEGU+aKPbIDShoygATj1Iz80kZCl9E2N53rcdejBfS4wNx 18 | w+0qhRJpPrZgIAvU5wIusf+zMLUh7SQD0DzigGxphDkTdKBgxZSMZmgzxw/deDB2 19 | 3aLCw29geckZOvVY0CvQ 20 | -----END PUBLIC KEY----- 21 | -------------------------------------------------------------------------------- /Sketch Toolbox/en.lproj/Credits.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\ansicpg1252\cocoartf1265\cocoasubrtf190 2 | {\fonttbl\f0\fswiss\fcharset0 Helvetica;} 3 | {\colortbl;\red255\green255\blue255;} 4 | \vieww9600\viewh8400\viewkind0 5 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural 6 | 7 | \f0\b\fs24 \cf0 Created by \ 8 | 9 | \b0 Shahruz Shaukat ({\field{\*\fldinst{HYPERLINK "https://twitter.com/shahruz"}}{\fldrslt https://twitter.com/shahruz}})\ 10 | \ 11 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 12 | 13 | \b \cf0 With special thanks to:\ 14 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural 15 | \cf0 16 | \b0 Clark Wimberly ({\field{\*\fldinst{HYPERLINK "https://twitter.com/clarklab"}}{\fldrslt https://twitter.com/clarklab}})\ 17 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 18 | \cf0 Ale Mu\'f1oz ({\field{\*\fldinst{HYPERLINK "https://github.com/sketchplugins/plugin-directory"}}{\fldrslt https://github.com/sketchplugins/plugin-directory}})\ 19 | Bohemian Coding ({\field{\*\fldinst{HYPERLINK "https://twitter.com/bohemiancoding"}}{\fldrslt https://twitter.com/bohemiancoding}})\ 20 | Jerry Low ({\field{\*\fldinst{HYPERLINK "https://twitter.com/WebHostingJerry"}}{\fldrslt https://twitter.com/WebHostingJerry}})\ 21 | Sam Soffes ({\field{\*\fldinst{HYPERLINK "https://github.com/soffes/ssziparchive"}}{\fldrslt https://github.com/soffes/ssziparchive}})\ 22 | Saul Mora and the Magical Panda team ({\field{\*\fldinst{HYPERLINK "https://github.com/magicalpanda/MagicalRecord"}}{\fldrslt https://github.com/magicalpanda/MagicalRecord}})} -------------------------------------------------------------------------------- /Sketch Toolbox/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Sketch Toolbox/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Sketch Toolbox 4 | // 5 | // Created by Shahruz Shaukat on 5/19/14. 6 | // Copyright (c) 2014 Shahruz Shaukat. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, const char * argv[]) 12 | { 13 | return NSApplicationMain(argc, argv); 14 | } 15 | -------------------------------------------------------------------------------- /Sparkle.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /Sparkle.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /Sparkle.framework/Sparkle: -------------------------------------------------------------------------------- 1 | Versions/Current/Sparkle -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Headers/SUAppcast.h: -------------------------------------------------------------------------------- 1 | // 2 | // SUAppcast.h 3 | // Sparkle 4 | // 5 | // Created by Andy Matuschak on 3/12/06. 6 | // Copyright 2006 Andy Matuschak. All rights reserved. 7 | // 8 | 9 | #ifndef SUAPPCAST_H 10 | #define SUAPPCAST_H 11 | 12 | @class SUAppcastItem; 13 | @interface SUAppcast : NSObject { 14 | NSArray *items; 15 | NSString *userAgentString; 16 | id delegate; 17 | NSMutableData *incrementalData; 18 | } 19 | 20 | - (void)fetchAppcastFromURL:(NSURL *)url; 21 | - (void)setDelegate:delegate; 22 | - (void)setUserAgentString:(NSString *)userAgentString; 23 | 24 | - (NSArray *)items; 25 | 26 | @end 27 | 28 | @interface NSObject (SUAppcastDelegate) 29 | - (void)appcastDidFinishLoading:(SUAppcast *)appcast; 30 | - (void)appcast:(SUAppcast *)appcast failedToLoadWithError:(NSError *)error; 31 | @end 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Headers/SUAppcastItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // SUAppcastItem.h 3 | // Sparkle 4 | // 5 | // Created by Andy Matuschak on 3/12/06. 6 | // Copyright 2006 Andy Matuschak. All rights reserved. 7 | // 8 | 9 | #ifndef SUAPPCASTITEM_H 10 | #define SUAPPCASTITEM_H 11 | 12 | @interface SUAppcastItem : NSObject { 13 | NSString *title; 14 | NSDate *date; 15 | NSString *itemDescription; 16 | 17 | NSURL *releaseNotesURL; 18 | 19 | NSString *DSASignature; 20 | NSString *minimumSystemVersion; 21 | 22 | NSURL *fileURL; 23 | NSString *versionString; 24 | NSString *displayVersionString; 25 | 26 | NSDictionary *propertiesDictionary; 27 | } 28 | 29 | // Initializes with data from a dictionary provided by the RSS class. 30 | - initWithDictionary:(NSDictionary *)dict; 31 | 32 | - (NSString *)title; 33 | - (NSString *)versionString; 34 | - (NSString *)displayVersionString; 35 | - (NSDate *)date; 36 | - (NSString *)itemDescription; 37 | - (NSURL *)releaseNotesURL; 38 | - (NSURL *)fileURL; 39 | - (NSString *)DSASignature; 40 | - (NSString *)minimumSystemVersion; 41 | 42 | // Returns the dictionary provided in initWithDictionary; this might be useful later for extensions. 43 | - (NSDictionary *)propertiesDictionary; 44 | 45 | @end 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Headers/SUVersionComparisonProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // SUVersionComparisonProtocol.h 3 | // Sparkle 4 | // 5 | // Created by Andy Matuschak on 12/21/07. 6 | // Copyright 2007 Andy Matuschak. All rights reserved. 7 | // 8 | 9 | #ifndef SUVERSIONCOMPARISONPROTOCOL_H 10 | #define SUVERSIONCOMPARISONPROTOCOL_H 11 | 12 | /*! 13 | @protocol 14 | @abstract Implement this protocol to provide version comparison facilities for Sparkle. 15 | */ 16 | @protocol SUVersionComparison 17 | 18 | /*! 19 | @method 20 | @abstract An abstract method to compare two version strings. 21 | @discussion Should return NSOrderedAscending if b > a, NSOrderedDescending if b < a, and NSOrderedSame if they are equivalent. 22 | */ 23 | - (NSComparisonResult)compareVersion:(NSString *)versionA toVersion:(NSString *)versionB; 24 | 25 | @end 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Headers/Sparkle.h: -------------------------------------------------------------------------------- 1 | // 2 | // Sparkle.h 3 | // Sparkle 4 | // 5 | // Created by Andy Matuschak on 3/16/06. (Modified by CDHW on 23/12/07) 6 | // Copyright 2006 Andy Matuschak. All rights reserved. 7 | // 8 | 9 | #ifndef SPARKLE_H 10 | #define SPARKLE_H 11 | 12 | // This list should include the shared headers. It doesn't matter if some of them aren't shared (unless 13 | // there are name-space collisions) so we can list all of them to start with: 14 | 15 | #import 16 | 17 | #import 18 | #import 19 | #import 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | Sparkle 9 | CFBundleIdentifier 10 | org.andymatuschak.Sparkle 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | Sparkle 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.5 Beta 6 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 313 23 | 24 | 25 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/License.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2006 Andy Matuschak 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/SUStatus.nib/classes.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBClasses 6 | 7 | 8 | CLASS 9 | SUWindowController 10 | LANGUAGE 11 | ObjC 12 | SUPERCLASS 13 | NSWindowController 14 | 15 | 16 | CLASS 17 | NSApplication 18 | LANGUAGE 19 | ObjC 20 | SUPERCLASS 21 | NSResponder 22 | 23 | 24 | CLASS 25 | FirstResponder 26 | LANGUAGE 27 | ObjC 28 | SUPERCLASS 29 | NSObject 30 | 31 | 32 | CLASS 33 | NSObject 34 | LANGUAGE 35 | ObjC 36 | 37 | 38 | CLASS 39 | SUStatusController 40 | LANGUAGE 41 | ObjC 42 | OUTLETS 43 | 44 | actionButton 45 | NSButton 46 | progressBar 47 | NSProgressIndicator 48 | 49 | SUPERCLASS 50 | SUWindowController 51 | 52 | 53 | IBVersion 54 | 1 55 | 56 | 57 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/SUStatus.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBFramework Version 6 | 670 7 | IBLastKnownRelativeProjectPath 8 | Sparkle.xcodeproj 9 | IBOldestOS 10 | 5 11 | IBOpenObjects 12 | 13 | 6 14 | 15 | IBSystem Version 16 | 10A96 17 | targetFramework 18 | IBCocoaFramework 19 | 20 | 21 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/SUStatus.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Resources/SUStatus.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/de.lproj/SUAutomaticUpdateAlert.nib/classes.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBClasses 6 | 7 | 8 | CLASS 9 | SUWindowController 10 | LANGUAGE 11 | ObjC 12 | SUPERCLASS 13 | NSWindowController 14 | 15 | 16 | ACTIONS 17 | 18 | doNotInstall 19 | id 20 | installLater 21 | id 22 | installNow 23 | id 24 | 25 | CLASS 26 | SUAutomaticUpdateAlert 27 | LANGUAGE 28 | ObjC 29 | SUPERCLASS 30 | SUWindowController 31 | 32 | 33 | CLASS 34 | FirstResponder 35 | LANGUAGE 36 | ObjC 37 | SUPERCLASS 38 | NSObject 39 | 40 | 41 | CLASS 42 | NSObject 43 | LANGUAGE 44 | ObjC 45 | 46 | 47 | IBVersion 48 | 1 49 | 50 | 51 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/de.lproj/SUAutomaticUpdateAlert.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBFramework Version 6 | 667 7 | IBLastKnownRelativeProjectPath 8 | ../Sparkle.xcodeproj 9 | IBOldestOS 10 | 5 11 | IBOpenObjects 12 | 13 | 6 14 | 15 | IBSystem Version 16 | 9D34 17 | targetFramework 18 | IBCocoaFramework 19 | 20 | 21 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/de.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Resources/de.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdateAlert.nib/classes.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBClasses 6 | 7 | 8 | CLASS 9 | SUWindowController 10 | LANGUAGE 11 | ObjC 12 | SUPERCLASS 13 | NSWindowController 14 | 15 | 16 | CLASS 17 | NSApplication 18 | LANGUAGE 19 | ObjC 20 | SUPERCLASS 21 | NSResponder 22 | 23 | 24 | ACTIONS 25 | 26 | installUpdate 27 | id 28 | remindMeLater 29 | id 30 | skipThisVersion 31 | id 32 | 33 | CLASS 34 | SUUpdateAlert 35 | LANGUAGE 36 | ObjC 37 | OUTLETS 38 | 39 | delegate 40 | id 41 | description 42 | NSTextField 43 | releaseNotesView 44 | WebView 45 | 46 | SUPERCLASS 47 | SUWindowController 48 | 49 | 50 | CLASS 51 | FirstResponder 52 | LANGUAGE 53 | ObjC 54 | SUPERCLASS 55 | NSObject 56 | 57 | 58 | CLASS 59 | NSObject 60 | LANGUAGE 61 | ObjC 62 | 63 | 64 | IBVersion 65 | 1 66 | 67 | 68 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdateAlert.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBFramework Version 6 | 667 7 | IBLastKnownRelativeProjectPath 8 | ../Sparkle.xcodeproj 9 | IBOldestOS 10 | 5 11 | IBOpenObjects 12 | 13 | 6 14 | 15 | IBSystem Version 16 | 9D34 17 | targetFramework 18 | IBCocoaFramework 19 | 20 | 21 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdateAlert.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdateAlert.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdatePermissionPrompt.nib/classes.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBClasses 6 | 7 | 8 | CLASS 9 | SUWindowController 10 | LANGUAGE 11 | ObjC 12 | SUPERCLASS 13 | NSWindowController 14 | 15 | 16 | ACTIONS 17 | 18 | finishPrompt 19 | id 20 | toggleMoreInfo 21 | id 22 | 23 | CLASS 24 | SUUpdatePermissionPrompt 25 | LANGUAGE 26 | ObjC 27 | OUTLETS 28 | 29 | delegate 30 | id 31 | descriptionTextField 32 | NSTextField 33 | moreInfoButton 34 | NSButton 35 | moreInfoView 36 | NSView 37 | 38 | SUPERCLASS 39 | SUWindowController 40 | 41 | 42 | CLASS 43 | FirstResponder 44 | LANGUAGE 45 | ObjC 46 | SUPERCLASS 47 | NSObject 48 | 49 | 50 | CLASS 51 | NSObject 52 | LANGUAGE 53 | ObjC 54 | 55 | 56 | IBVersion 57 | 1 58 | 59 | 60 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdatePermissionPrompt.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBFramework Version 6 | 667 7 | IBLastKnownRelativeProjectPath 8 | ../Sparkle.xcodeproj 9 | IBOldestOS 10 | 5 11 | IBOpenObjects 12 | 13 | 6 14 | 15 | IBSystem Version 16 | 9D34 17 | targetFramework 18 | IBCocoaFramework 19 | 20 | 21 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/de.lproj/Sparkle.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Resources/de.lproj/Sparkle.strings -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/en.lproj/SUAutomaticUpdateAlert.nib/classes.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBClasses 6 | 7 | 8 | CLASS 9 | SUWindowController 10 | LANGUAGE 11 | ObjC 12 | SUPERCLASS 13 | NSWindowController 14 | 15 | 16 | ACTIONS 17 | 18 | doNotInstall 19 | id 20 | installLater 21 | id 22 | installNow 23 | id 24 | 25 | CLASS 26 | SUAutomaticUpdateAlert 27 | LANGUAGE 28 | ObjC 29 | SUPERCLASS 30 | SUWindowController 31 | 32 | 33 | CLASS 34 | FirstResponder 35 | LANGUAGE 36 | ObjC 37 | SUPERCLASS 38 | NSObject 39 | 40 | 41 | CLASS 42 | NSObject 43 | LANGUAGE 44 | ObjC 45 | 46 | 47 | IBVersion 48 | 1 49 | 50 | 51 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/en.lproj/SUAutomaticUpdateAlert.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBFramework Version 6 | 658 7 | IBLastKnownRelativeProjectPath 8 | ../Sparkle.xcodeproj 9 | IBOldestOS 10 | 5 11 | IBOpenObjects 12 | 13 | 6 14 | 15 | IBSystem Version 16 | 9C7010 17 | targetFramework 18 | IBCocoaFramework 19 | 20 | 21 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/en.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Resources/en.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdateAlert.nib/classes.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBClasses 6 | 7 | 8 | CLASS 9 | SUWindowController 10 | LANGUAGE 11 | ObjC 12 | SUPERCLASS 13 | NSWindowController 14 | 15 | 16 | CLASS 17 | NSApplication 18 | LANGUAGE 19 | ObjC 20 | SUPERCLASS 21 | NSResponder 22 | 23 | 24 | ACTIONS 25 | 26 | installUpdate 27 | id 28 | remindMeLater 29 | id 30 | skipThisVersion 31 | id 32 | 33 | CLASS 34 | SUUpdateAlert 35 | LANGUAGE 36 | ObjC 37 | OUTLETS 38 | 39 | delegate 40 | id 41 | description 42 | NSTextField 43 | releaseNotesView 44 | WebView 45 | 46 | SUPERCLASS 47 | SUWindowController 48 | 49 | 50 | CLASS 51 | FirstResponder 52 | LANGUAGE 53 | ObjC 54 | SUPERCLASS 55 | NSObject 56 | 57 | 58 | CLASS 59 | NSObject 60 | LANGUAGE 61 | ObjC 62 | 63 | 64 | IBVersion 65 | 1 66 | 67 | 68 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdateAlert.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBFramework Version 6 | 670 7 | IBLastKnownRelativeProjectPath 8 | ../Sparkle.xcodeproj 9 | IBOldestOS 10 | 5 11 | IBOpenObjects 12 | 13 | 18 14 | 15 | IBSystem Version 16 | 10A96 17 | targetFramework 18 | IBCocoaFramework 19 | 20 | 21 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdateAlert.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdateAlert.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdatePermissionPrompt.nib/classes.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBClasses 6 | 7 | 8 | CLASS 9 | SUWindowController 10 | LANGUAGE 11 | ObjC 12 | SUPERCLASS 13 | NSWindowController 14 | 15 | 16 | ACTIONS 17 | 18 | finishPrompt 19 | id 20 | toggleMoreInfo 21 | id 22 | 23 | CLASS 24 | SUUpdatePermissionPrompt 25 | LANGUAGE 26 | ObjC 27 | OUTLETS 28 | 29 | delegate 30 | id 31 | descriptionTextField 32 | NSTextField 33 | moreInfoButton 34 | NSButton 35 | moreInfoView 36 | NSView 37 | 38 | SUPERCLASS 39 | SUWindowController 40 | 41 | 42 | CLASS 43 | FirstResponder 44 | LANGUAGE 45 | ObjC 46 | SUPERCLASS 47 | NSObject 48 | 49 | 50 | CLASS 51 | NSObject 52 | LANGUAGE 53 | ObjC 54 | 55 | 56 | IBVersion 57 | 1 58 | 59 | 60 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdatePermissionPrompt.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBFramework Version 6 | 670 7 | IBLastKnownRelativeProjectPath 8 | ../Sparkle.xcodeproj 9 | IBOldestOS 10 | 5 11 | IBOpenObjects 12 | 13 | 6 14 | 41 15 | 16 | IBSystem Version 17 | 10A96 18 | targetFramework 19 | IBCocoaFramework 20 | 21 | 22 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/en.lproj/Sparkle.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Resources/en.lproj/Sparkle.strings -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/es.lproj/SUAutomaticUpdateAlert.nib/classes.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBClasses 6 | 7 | 8 | CLASS 9 | SUWindowController 10 | LANGUAGE 11 | ObjC 12 | SUPERCLASS 13 | NSWindowController 14 | 15 | 16 | ACTIONS 17 | 18 | doNotInstall 19 | id 20 | installLater 21 | id 22 | installNow 23 | id 24 | 25 | CLASS 26 | SUAutomaticUpdateAlert 27 | LANGUAGE 28 | ObjC 29 | SUPERCLASS 30 | SUWindowController 31 | 32 | 33 | CLASS 34 | FirstResponder 35 | LANGUAGE 36 | ObjC 37 | SUPERCLASS 38 | NSObject 39 | 40 | 41 | CLASS 42 | NSObject 43 | LANGUAGE 44 | ObjC 45 | 46 | 47 | IBVersion 48 | 1 49 | 50 | 51 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/es.lproj/SUAutomaticUpdateAlert.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBFramework Version 6 | 667 7 | IBLastKnownRelativeProjectPath 8 | ../Sparkle.xcodeproj 9 | IBOldestOS 10 | 5 11 | IBOpenObjects 12 | 13 | 6 14 | 15 | IBSystem Version 16 | 9D34 17 | targetFramework 18 | IBCocoaFramework 19 | 20 | 21 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/es.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Resources/es.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdateAlert.nib/classes.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBClasses 6 | 7 | 8 | CLASS 9 | SUWindowController 10 | LANGUAGE 11 | ObjC 12 | SUPERCLASS 13 | NSWindowController 14 | 15 | 16 | CLASS 17 | NSApplication 18 | LANGUAGE 19 | ObjC 20 | SUPERCLASS 21 | NSResponder 22 | 23 | 24 | ACTIONS 25 | 26 | installUpdate 27 | id 28 | remindMeLater 29 | id 30 | skipThisVersion 31 | id 32 | 33 | CLASS 34 | SUUpdateAlert 35 | LANGUAGE 36 | ObjC 37 | OUTLETS 38 | 39 | delegate 40 | id 41 | description 42 | NSTextField 43 | releaseNotesView 44 | WebView 45 | 46 | SUPERCLASS 47 | SUWindowController 48 | 49 | 50 | CLASS 51 | FirstResponder 52 | LANGUAGE 53 | ObjC 54 | SUPERCLASS 55 | NSObject 56 | 57 | 58 | CLASS 59 | NSObject 60 | LANGUAGE 61 | ObjC 62 | 63 | 64 | IBVersion 65 | 1 66 | 67 | 68 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdateAlert.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBFramework Version 6 | 667 7 | IBLastKnownRelativeProjectPath 8 | ../Sparkle.xcodeproj 9 | IBOldestOS 10 | 5 11 | IBOpenObjects 12 | 13 | 6 14 | 15 | IBSystem Version 16 | 9D34 17 | targetFramework 18 | IBCocoaFramework 19 | 20 | 21 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdateAlert.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdateAlert.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdatePermissionPrompt.nib/classes.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBClasses 6 | 7 | 8 | CLASS 9 | SUWindowController 10 | LANGUAGE 11 | ObjC 12 | SUPERCLASS 13 | NSWindowController 14 | 15 | 16 | ACTIONS 17 | 18 | finishPrompt 19 | id 20 | toggleMoreInfo 21 | id 22 | 23 | CLASS 24 | SUUpdatePermissionPrompt 25 | LANGUAGE 26 | ObjC 27 | OUTLETS 28 | 29 | delegate 30 | id 31 | descriptionTextField 32 | NSTextField 33 | moreInfoButton 34 | NSButton 35 | moreInfoView 36 | NSView 37 | 38 | SUPERCLASS 39 | SUWindowController 40 | 41 | 42 | CLASS 43 | FirstResponder 44 | LANGUAGE 45 | ObjC 46 | SUPERCLASS 47 | NSObject 48 | 49 | 50 | CLASS 51 | NSObject 52 | LANGUAGE 53 | ObjC 54 | 55 | 56 | IBVersion 57 | 1 58 | 59 | 60 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdatePermissionPrompt.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBFramework Version 6 | 667 7 | IBLastKnownRelativeProjectPath 8 | ../../Sparkle.xcodeproj 9 | IBOldestOS 10 | 5 11 | IBOpenObjects 12 | 13 | 6 14 | 15 | IBSystem Version 16 | 9D34 17 | targetFramework 18 | IBCocoaFramework 19 | 20 | 21 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/es.lproj/Sparkle.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Resources/es.lproj/Sparkle.strings -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/fr.lproj/SUAutomaticUpdateAlert.nib/classes.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBClasses 6 | 7 | 8 | CLASS 9 | SUWindowController 10 | LANGUAGE 11 | ObjC 12 | SUPERCLASS 13 | NSWindowController 14 | 15 | 16 | ACTIONS 17 | 18 | doNotInstall 19 | id 20 | installLater 21 | id 22 | installNow 23 | id 24 | 25 | CLASS 26 | SUAutomaticUpdateAlert 27 | LANGUAGE 28 | ObjC 29 | SUPERCLASS 30 | SUWindowController 31 | 32 | 33 | CLASS 34 | FirstResponder 35 | LANGUAGE 36 | ObjC 37 | SUPERCLASS 38 | NSObject 39 | 40 | 41 | CLASS 42 | NSObject 43 | LANGUAGE 44 | ObjC 45 | 46 | 47 | IBVersion 48 | 1 49 | 50 | 51 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/fr.lproj/SUAutomaticUpdateAlert.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBFramework Version 6 | 629 7 | IBOldestOS 8 | 5 9 | IBOpenObjects 10 | 11 | IBSystem Version 12 | 9D34 13 | targetFramework 14 | IBCocoaFramework 15 | 16 | 17 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/fr.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Resources/fr.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdateAlert.nib/classes.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBClasses 6 | 7 | 8 | CLASS 9 | SUWindowController 10 | LANGUAGE 11 | ObjC 12 | SUPERCLASS 13 | NSWindowController 14 | 15 | 16 | CLASS 17 | NSApplication 18 | LANGUAGE 19 | ObjC 20 | SUPERCLASS 21 | NSResponder 22 | 23 | 24 | ACTIONS 25 | 26 | installUpdate 27 | id 28 | remindMeLater 29 | id 30 | skipThisVersion 31 | id 32 | 33 | CLASS 34 | SUUpdateAlert 35 | LANGUAGE 36 | ObjC 37 | OUTLETS 38 | 39 | delegate 40 | id 41 | description 42 | NSTextField 43 | releaseNotesView 44 | WebView 45 | 46 | SUPERCLASS 47 | SUWindowController 48 | 49 | 50 | CLASS 51 | FirstResponder 52 | LANGUAGE 53 | ObjC 54 | SUPERCLASS 55 | NSObject 56 | 57 | 58 | CLASS 59 | NSObject 60 | LANGUAGE 61 | ObjC 62 | 63 | 64 | IBVersion 65 | 1 66 | 67 | 68 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdateAlert.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBFramework Version 6 | 629 7 | IBOldestOS 8 | 5 9 | IBOpenObjects 10 | 11 | IBSystem Version 12 | 9E17 13 | targetFramework 14 | IBCocoaFramework 15 | 16 | 17 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdateAlert.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdateAlert.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdatePermissionPrompt.nib/classes.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBClasses 6 | 7 | 8 | CLASS 9 | SUWindowController 10 | LANGUAGE 11 | ObjC 12 | SUPERCLASS 13 | NSWindowController 14 | 15 | 16 | ACTIONS 17 | 18 | finishPrompt 19 | id 20 | toggleMoreInfo 21 | id 22 | 23 | CLASS 24 | SUUpdatePermissionPrompt 25 | LANGUAGE 26 | ObjC 27 | OUTLETS 28 | 29 | delegate 30 | id 31 | descriptionTextField 32 | NSTextField 33 | moreInfoButton 34 | NSButton 35 | moreInfoView 36 | NSView 37 | 38 | SUPERCLASS 39 | SUWindowController 40 | 41 | 42 | CLASS 43 | FirstResponder 44 | LANGUAGE 45 | ObjC 46 | SUPERCLASS 47 | NSObject 48 | 49 | 50 | CLASS 51 | NSObject 52 | LANGUAGE 53 | ObjC 54 | 55 | 56 | IBVersion 57 | 1 58 | 59 | 60 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdatePermissionPrompt.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBFramework Version 6 | 629 7 | IBOldestOS 8 | 5 9 | IBOpenObjects 10 | 11 | IBSystem Version 12 | 9E17 13 | targetFramework 14 | IBCocoaFramework 15 | 16 | 17 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/fr.lproj/Sparkle.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Resources/fr.lproj/Sparkle.strings -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/fr.lproj/fr.lproj: -------------------------------------------------------------------------------- 1 | /Users/andym/Development/Build Products/Release/Sparkle.framework/Resources/fr.lproj -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/fr_CA.lproj: -------------------------------------------------------------------------------- 1 | /Users/andym/Development/Build Products/Release/Sparkle.framework/Resources/fr.lproj -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/it.lproj/SUAutomaticUpdateAlert.nib/classes.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBClasses 6 | 7 | 8 | CLASS 9 | SUWindowController 10 | LANGUAGE 11 | ObjC 12 | SUPERCLASS 13 | NSWindowController 14 | 15 | 16 | ACTIONS 17 | 18 | doNotInstall 19 | id 20 | installLater 21 | id 22 | installNow 23 | id 24 | 25 | CLASS 26 | SUAutomaticUpdateAlert 27 | LANGUAGE 28 | ObjC 29 | SUPERCLASS 30 | SUWindowController 31 | 32 | 33 | CLASS 34 | FirstResponder 35 | LANGUAGE 36 | ObjC 37 | SUPERCLASS 38 | NSObject 39 | 40 | 41 | CLASS 42 | NSObject 43 | LANGUAGE 44 | ObjC 45 | 46 | 47 | IBVersion 48 | 1 49 | 50 | 51 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/it.lproj/SUAutomaticUpdateAlert.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBFramework Version 6 | 667 7 | IBLastKnownRelativeProjectPath 8 | ../Sparkle.xcodeproj 9 | IBOldestOS 10 | 5 11 | IBOpenObjects 12 | 13 | 6 14 | 15 | IBSystem Version 16 | 9D34 17 | targetFramework 18 | IBCocoaFramework 19 | 20 | 21 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/it.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Resources/it.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdateAlert.nib/classes.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBClasses 6 | 7 | 8 | CLASS 9 | SUWindowController 10 | LANGUAGE 11 | ObjC 12 | SUPERCLASS 13 | NSWindowController 14 | 15 | 16 | CLASS 17 | NSApplication 18 | LANGUAGE 19 | ObjC 20 | SUPERCLASS 21 | NSResponder 22 | 23 | 24 | ACTIONS 25 | 26 | installUpdate 27 | id 28 | remindMeLater 29 | id 30 | skipThisVersion 31 | id 32 | 33 | CLASS 34 | SUUpdateAlert 35 | LANGUAGE 36 | ObjC 37 | OUTLETS 38 | 39 | delegate 40 | id 41 | description 42 | NSTextField 43 | releaseNotesView 44 | WebView 45 | 46 | SUPERCLASS 47 | SUWindowController 48 | 49 | 50 | CLASS 51 | FirstResponder 52 | LANGUAGE 53 | ObjC 54 | SUPERCLASS 55 | NSObject 56 | 57 | 58 | CLASS 59 | NSObject 60 | LANGUAGE 61 | ObjC 62 | 63 | 64 | IBVersion 65 | 1 66 | 67 | 68 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdateAlert.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBFramework Version 6 | 667 7 | IBLastKnownRelativeProjectPath 8 | ../Sparkle.xcodeproj 9 | IBOldestOS 10 | 5 11 | IBOpenObjects 12 | 13 | 6 14 | 15 | IBSystem Version 16 | 9D34 17 | targetFramework 18 | IBCocoaFramework 19 | 20 | 21 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdateAlert.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdateAlert.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdatePermissionPrompt.nib/classes.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBClasses 6 | 7 | 8 | CLASS 9 | SUWindowController 10 | LANGUAGE 11 | ObjC 12 | SUPERCLASS 13 | NSWindowController 14 | 15 | 16 | ACTIONS 17 | 18 | finishPrompt 19 | id 20 | toggleMoreInfo 21 | id 22 | 23 | CLASS 24 | SUUpdatePermissionPrompt 25 | LANGUAGE 26 | ObjC 27 | OUTLETS 28 | 29 | delegate 30 | id 31 | descriptionTextField 32 | NSTextField 33 | moreInfoButton 34 | NSButton 35 | moreInfoView 36 | NSView 37 | 38 | SUPERCLASS 39 | SUWindowController 40 | 41 | 42 | CLASS 43 | FirstResponder 44 | LANGUAGE 45 | ObjC 46 | SUPERCLASS 47 | NSObject 48 | 49 | 50 | CLASS 51 | NSObject 52 | LANGUAGE 53 | ObjC 54 | 55 | 56 | IBVersion 57 | 1 58 | 59 | 60 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdatePermissionPrompt.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBFramework Version 6 | 667 7 | IBLastKnownRelativeProjectPath 8 | ../Sparkle.xcodeproj 9 | IBOldestOS 10 | 5 11 | IBOpenObjects 12 | 13 | 5 14 | 15 | IBSystem Version 16 | 9D34 17 | targetFramework 18 | IBCocoaFramework 19 | 20 | 21 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/it.lproj/Sparkle.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Resources/it.lproj/Sparkle.strings -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/nl.lproj/SUAutomaticUpdateAlert.nib/classes.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBClasses 6 | 7 | 8 | CLASS 9 | SUWindowController 10 | LANGUAGE 11 | ObjC 12 | SUPERCLASS 13 | NSWindowController 14 | 15 | 16 | ACTIONS 17 | 18 | doNotInstall 19 | id 20 | installLater 21 | id 22 | installNow 23 | id 24 | 25 | CLASS 26 | SUAutomaticUpdateAlert 27 | LANGUAGE 28 | ObjC 29 | SUPERCLASS 30 | SUWindowController 31 | 32 | 33 | CLASS 34 | FirstResponder 35 | LANGUAGE 36 | ObjC 37 | SUPERCLASS 38 | NSObject 39 | 40 | 41 | CLASS 42 | NSObject 43 | LANGUAGE 44 | ObjC 45 | 46 | 47 | IBVersion 48 | 1 49 | 50 | 51 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/nl.lproj/SUAutomaticUpdateAlert.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBFramework Version 6 | 629 7 | IBOldestOS 8 | 5 9 | IBOpenObjects 10 | 11 | 6 12 | 13 | IBSystem Version 14 | 9D34 15 | targetFramework 16 | IBCocoaFramework 17 | 18 | 19 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/nl.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Resources/nl.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdateAlert.nib/classes.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBClasses 6 | 7 | 8 | CLASS 9 | SUWindowController 10 | LANGUAGE 11 | ObjC 12 | SUPERCLASS 13 | NSWindowController 14 | 15 | 16 | CLASS 17 | NSApplication 18 | LANGUAGE 19 | ObjC 20 | SUPERCLASS 21 | NSResponder 22 | 23 | 24 | ACTIONS 25 | 26 | installUpdate 27 | id 28 | remindMeLater 29 | id 30 | skipThisVersion 31 | id 32 | 33 | CLASS 34 | SUUpdateAlert 35 | LANGUAGE 36 | ObjC 37 | OUTLETS 38 | 39 | delegate 40 | id 41 | description 42 | NSTextField 43 | releaseNotesView 44 | WebView 45 | 46 | SUPERCLASS 47 | SUWindowController 48 | 49 | 50 | CLASS 51 | FirstResponder 52 | LANGUAGE 53 | ObjC 54 | SUPERCLASS 55 | NSObject 56 | 57 | 58 | CLASS 59 | NSObject 60 | LANGUAGE 61 | ObjC 62 | 63 | 64 | IBVersion 65 | 1 66 | 67 | 68 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdateAlert.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBFramework Version 6 | 629 7 | IBOldestOS 8 | 5 9 | IBOpenObjects 10 | 11 | IBSystem Version 12 | 9E17 13 | targetFramework 14 | IBCocoaFramework 15 | 16 | 17 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdateAlert.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdateAlert.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdatePermissionPrompt.nib/classes.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBClasses 6 | 7 | 8 | CLASS 9 | SUWindowController 10 | LANGUAGE 11 | ObjC 12 | SUPERCLASS 13 | NSWindowController 14 | 15 | 16 | ACTIONS 17 | 18 | finishPrompt 19 | id 20 | toggleMoreInfo 21 | id 22 | 23 | CLASS 24 | SUUpdatePermissionPrompt 25 | LANGUAGE 26 | ObjC 27 | OUTLETS 28 | 29 | delegate 30 | id 31 | descriptionTextField 32 | NSTextField 33 | moreInfoButton 34 | NSButton 35 | moreInfoView 36 | NSView 37 | 38 | SUPERCLASS 39 | SUWindowController 40 | 41 | 42 | CLASS 43 | FirstResponder 44 | LANGUAGE 45 | ObjC 46 | SUPERCLASS 47 | NSObject 48 | 49 | 50 | CLASS 51 | NSObject 52 | LANGUAGE 53 | ObjC 54 | 55 | 56 | IBVersion 57 | 1 58 | 59 | 60 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdatePermissionPrompt.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBFramework Version 6 | 629 7 | IBOldestOS 8 | 5 9 | IBOpenObjects 10 | 11 | IBSystem Version 12 | 9E17 13 | targetFramework 14 | IBCocoaFramework 15 | 16 | 17 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/nl.lproj/Sparkle.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Resources/nl.lproj/Sparkle.strings -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/relaunch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Resources/relaunch -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/ru.lproj/SUAutomaticUpdateAlert.nib/classes.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBClasses 6 | 7 | 8 | CLASS 9 | SUWindowController 10 | LANGUAGE 11 | ObjC 12 | SUPERCLASS 13 | NSWindowController 14 | 15 | 16 | ACTIONS 17 | 18 | doNotInstall 19 | id 20 | installLater 21 | id 22 | installNow 23 | id 24 | 25 | CLASS 26 | SUAutomaticUpdateAlert 27 | LANGUAGE 28 | ObjC 29 | SUPERCLASS 30 | SUWindowController 31 | 32 | 33 | CLASS 34 | FirstResponder 35 | LANGUAGE 36 | ObjC 37 | SUPERCLASS 38 | NSObject 39 | 40 | 41 | CLASS 42 | NSObject 43 | LANGUAGE 44 | ObjC 45 | 46 | 47 | IBVersion 48 | 1 49 | 50 | 51 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/ru.lproj/SUAutomaticUpdateAlert.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBFramework Version 6 | 670 7 | IBLastKnownRelativeProjectPath 8 | ../Sparkle.xcodeproj 9 | IBOldestOS 10 | 5 11 | IBOpenObjects 12 | 13 | 6 14 | 15 | IBSystem Version 16 | 9E17 17 | targetFramework 18 | IBCocoaFramework 19 | 20 | 21 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/ru.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Resources/ru.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdateAlert.nib/classes.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBClasses 6 | 7 | 8 | CLASS 9 | SUWindowController 10 | LANGUAGE 11 | ObjC 12 | SUPERCLASS 13 | NSWindowController 14 | 15 | 16 | CLASS 17 | NSApplication 18 | LANGUAGE 19 | ObjC 20 | SUPERCLASS 21 | NSResponder 22 | 23 | 24 | ACTIONS 25 | 26 | installUpdate 27 | id 28 | remindMeLater 29 | id 30 | skipThisVersion 31 | id 32 | 33 | CLASS 34 | SUUpdateAlert 35 | LANGUAGE 36 | ObjC 37 | OUTLETS 38 | 39 | delegate 40 | id 41 | description 42 | NSTextField 43 | releaseNotesView 44 | WebView 45 | 46 | SUPERCLASS 47 | SUWindowController 48 | 49 | 50 | CLASS 51 | FirstResponder 52 | LANGUAGE 53 | ObjC 54 | SUPERCLASS 55 | NSObject 56 | 57 | 58 | CLASS 59 | NSObject 60 | LANGUAGE 61 | ObjC 62 | 63 | 64 | IBVersion 65 | 1 66 | 67 | 68 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdateAlert.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBFramework Version 6 | 670 7 | IBLastKnownRelativeProjectPath 8 | ../Sparkle.xcodeproj 9 | IBOldestOS 10 | 5 11 | IBOpenObjects 12 | 13 | 6 14 | 15 | IBSystem Version 16 | 9E17 17 | targetFramework 18 | IBCocoaFramework 19 | 20 | 21 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdateAlert.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdateAlert.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdatePermissionPrompt.nib/classes.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBClasses 6 | 7 | 8 | CLASS 9 | NSObject 10 | LANGUAGE 11 | ObjC 12 | 13 | 14 | CLASS 15 | SUWindowController 16 | LANGUAGE 17 | ObjC 18 | SUPERCLASS 19 | NSWindowController 20 | 21 | 22 | ACTIONS 23 | 24 | finishPrompt 25 | id 26 | toggleMoreInfo 27 | id 28 | 29 | CLASS 30 | SUUpdatePermissionPrompt 31 | LANGUAGE 32 | ObjC 33 | OUTLETS 34 | 35 | delegate 36 | id 37 | descriptionTextField 38 | NSTextField 39 | moreInfoButton 40 | NSButton 41 | moreInfoView 42 | NSView 43 | 44 | SUPERCLASS 45 | SUWindowController 46 | 47 | 48 | CLASS 49 | FirstResponder 50 | LANGUAGE 51 | ObjC 52 | SUPERCLASS 53 | NSObject 54 | 55 | 56 | IBVersion 57 | 1 58 | 59 | 60 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdatePermissionPrompt.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBFramework Version 6 | 670 7 | IBLastKnownRelativeProjectPath 8 | ../Sparkle.xcodeproj 9 | IBOldestOS 10 | 5 11 | IBOpenObjects 12 | 13 | IBSystem Version 14 | 9E17 15 | targetFramework 16 | IBCocoaFramework 17 | 18 | 19 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/ru.lproj/Sparkle.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Resources/ru.lproj/Sparkle.strings -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/sv.lproj/SUAutomaticUpdateAlert.nib/classes.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBClasses 6 | 7 | 8 | CLASS 9 | SUWindowController 10 | LANGUAGE 11 | ObjC 12 | SUPERCLASS 13 | NSWindowController 14 | 15 | 16 | ACTIONS 17 | 18 | doNotInstall 19 | id 20 | installLater 21 | id 22 | installNow 23 | id 24 | 25 | CLASS 26 | SUAutomaticUpdateAlert 27 | LANGUAGE 28 | ObjC 29 | SUPERCLASS 30 | SUWindowController 31 | 32 | 33 | CLASS 34 | FirstResponder 35 | LANGUAGE 36 | ObjC 37 | SUPERCLASS 38 | NSObject 39 | 40 | 41 | CLASS 42 | NSObject 43 | LANGUAGE 44 | ObjC 45 | 46 | 47 | IBVersion 48 | 1 49 | 50 | 51 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/sv.lproj/SUAutomaticUpdateAlert.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBFramework Version 6 | 670 7 | IBLastKnownRelativeProjectPath 8 | ../Sparkle.xcodeproj 9 | IBOldestOS 10 | 5 11 | IBOpenObjects 12 | 13 | 6 14 | 15 | IBSystem Version 16 | 10A96 17 | targetFramework 18 | IBCocoaFramework 19 | 20 | 21 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/sv.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Resources/sv.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdateAlert.nib/classes.nib: -------------------------------------------------------------------------------- 1 | { 2 | IBClasses = ( 3 | { 4 | CLASS = FirstResponder; 5 | LANGUAGE = ObjC; 6 | SUPERCLASS = NSObject; 7 | }, 8 | { 9 | CLASS = NSApplication; 10 | LANGUAGE = ObjC; 11 | SUPERCLASS = NSResponder; 12 | }, 13 | { 14 | CLASS = NSObject; 15 | LANGUAGE = ObjC; 16 | }, 17 | { 18 | ACTIONS = { 19 | installUpdate = id; 20 | remindMeLater = id; 21 | skipThisVersion = id; 22 | }; 23 | CLASS = SUUpdateAlert; 24 | LANGUAGE = ObjC; 25 | OUTLETS = { 26 | delegate = id; 27 | description = NSTextField; 28 | releaseNotesView = WebView; 29 | }; 30 | SUPERCLASS = SUWindowController; 31 | }, 32 | { 33 | CLASS = SUWindowController; 34 | LANGUAGE = ObjC; 35 | SUPERCLASS = NSWindowController; 36 | } 37 | ); 38 | IBVersion = 1; 39 | } -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdateAlert.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBDocumentLocation 6 | 69 14 356 240 0 0 1280 778 7 | IBFramework Version 8 | 489.0 9 | IBLastKnownRelativeProjectPath 10 | ../Sparkle.xcodeproj 11 | IBOldestOS 12 | 5 13 | IBSystem Version 14 | 9D34 15 | targetFramework 16 | IBCocoaFramework 17 | 18 | 19 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdateAlert.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdateAlert.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdatePermissionPrompt.nib/classes.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBClasses 6 | 7 | 8 | CLASS 9 | SUWindowController 10 | LANGUAGE 11 | ObjC 12 | SUPERCLASS 13 | NSWindowController 14 | 15 | 16 | ACTIONS 17 | 18 | finishPrompt 19 | id 20 | toggleMoreInfo 21 | id 22 | 23 | CLASS 24 | SUUpdatePermissionPrompt 25 | LANGUAGE 26 | ObjC 27 | OUTLETS 28 | 29 | delegate 30 | id 31 | descriptionTextField 32 | NSTextField 33 | moreInfoButton 34 | NSButton 35 | moreInfoView 36 | NSView 37 | 38 | SUPERCLASS 39 | SUWindowController 40 | 41 | 42 | CLASS 43 | FirstResponder 44 | LANGUAGE 45 | ObjC 46 | SUPERCLASS 47 | NSObject 48 | 49 | 50 | CLASS 51 | NSObject 52 | LANGUAGE 53 | ObjC 54 | 55 | 56 | IBVersion 57 | 1 58 | 59 | 60 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdatePermissionPrompt.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBFramework Version 6 | 670 7 | IBLastKnownRelativeProjectPath 8 | ../Sparkle.xcodeproj 9 | IBOldestOS 10 | 5 11 | IBOpenObjects 12 | 13 | 6 14 | 15 | IBSystem Version 16 | 10A96 17 | targetFramework 18 | IBCocoaFramework 19 | 20 | 21 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/sv.lproj/Sparkle.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Resources/sv.lproj/Sparkle.strings -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Sparkle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buzzfeed/Sketch-Toolbox/98f451298652a5d32a3b079bb0f8850b1c34edf3/Sparkle.framework/Versions/A/Sparkle -------------------------------------------------------------------------------- /Sparkle.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A --------------------------------------------------------------------------------