├── .gitignore
├── .kick
├── Example
├── KZPlayground.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── KZPlayground.xcscheme
├── KZPlayground.xcworkspace
│ └── contents.xcworkspacedata
├── KZPlayground
│ ├── Images.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ └── Contents.json
│ │ ├── LaunchImage.launchimage
│ │ │ └── Contents.json
│ │ ├── TEst.imageset
│ │ │ ├── Contents.json
│ │ │ └── Screen Shot 2014-10-27 at 17.55.30.png
│ │ └── foldify.imageset
│ │ │ ├── Contents.json
│ │ │ └── foldify.png
│ ├── KZPAppDelegate.h
│ ├── KZPAppDelegate.m
│ ├── KZPlayground-Info.plist
│ ├── KZPlayground-Prefix.pch
│ ├── KZPlaygroundExample.h
│ ├── KZPlaygroundExample.m
│ ├── avatar.jpg
│ ├── en.lproj
│ │ ├── InfoPlist.strings
│ │ └── Localizable.strings
│ └── main.m
├── Podfile
├── Podfile.lock
└── Pods
│ ├── Headers
│ └── Public
│ │ ├── KZPlayground
│ │ ├── KZPActionComponent.h
│ │ ├── KZPAnimatorComponent.h
│ │ ├── KZPComponent.h
│ │ ├── KZPImagePickerCollectionViewController.h
│ │ ├── KZPImagePickerComponent.h
│ │ ├── KZPPlayground+Internal.h
│ │ ├── KZPPlayground.h
│ │ ├── KZPPlaygroundViewController.h
│ │ ├── KZPPresenterComponent.h
│ │ ├── KZPPresenterInfoViewController.h
│ │ ├── KZPSnapshotView.h
│ │ ├── KZPSynchronizationComponent.h
│ │ ├── KZPTimelineViewController.h
│ │ └── KZPValueAdjustComponent.h
│ │ ├── NHBalancedFlowLayout
│ │ ├── NHBalancedFlowLayout.h
│ │ └── NHLinearPartition.h
│ │ ├── RSSwizzle
│ │ └── RSSwizzle.h
│ │ └── dyci
│ │ ├── NSObject+DyCInjection.h
│ │ ├── NSSet+ClassesList.h
│ │ ├── SFDynamicCodeInjection.h
│ │ ├── SFFileWatcher.h
│ │ ├── SFFileWatcherDelegate.h
│ │ ├── SFInjectionsNotificationsCenter.h
│ │ ├── UINib+StoryBoardSupport.h
│ │ └── UIViewController+XIBSupport.h
│ ├── Local Podspecs
│ └── KZPlayground.podspec
│ ├── Manifest.lock
│ ├── NHBalancedFlowLayout
│ ├── LICENSE
│ ├── NHBalancedFlowLayout
│ │ ├── NHBalancedFlowLayout.h
│ │ ├── NHBalancedFlowLayout.m
│ │ ├── NHLinearPartition.h
│ │ └── NHLinearPartition.m
│ └── README.md
│ ├── Pods.xcodeproj
│ └── project.pbxproj
│ ├── RSSwizzle
│ ├── LICENSE
│ ├── README.md
│ └── RSSwizzle
│ │ ├── RSSwizzle.h
│ │ └── RSSwizzle.m
│ ├── Target Support Files
│ ├── Pods-KZPlayground-KZPlayground
│ │ ├── Pods-KZPlayground-KZPlayground-Private.xcconfig
│ │ ├── Pods-KZPlayground-KZPlayground-dummy.m
│ │ ├── Pods-KZPlayground-KZPlayground-prefix.pch
│ │ └── Pods-KZPlayground-KZPlayground.xcconfig
│ ├── Pods-KZPlayground-NHBalancedFlowLayout
│ │ ├── Pods-KZPlayground-NHBalancedFlowLayout-Private.xcconfig
│ │ ├── Pods-KZPlayground-NHBalancedFlowLayout-dummy.m
│ │ ├── Pods-KZPlayground-NHBalancedFlowLayout-prefix.pch
│ │ └── Pods-KZPlayground-NHBalancedFlowLayout.xcconfig
│ ├── Pods-KZPlayground-RSSwizzle
│ │ ├── Pods-KZPlayground-RSSwizzle-Private.xcconfig
│ │ ├── Pods-KZPlayground-RSSwizzle-dummy.m
│ │ ├── Pods-KZPlayground-RSSwizzle-prefix.pch
│ │ └── Pods-KZPlayground-RSSwizzle.xcconfig
│ ├── Pods-KZPlayground-dyci
│ │ ├── Pods-KZPlayground-dyci-Private.xcconfig
│ │ ├── Pods-KZPlayground-dyci-dummy.m
│ │ ├── Pods-KZPlayground-dyci-prefix.pch
│ │ └── Pods-KZPlayground-dyci.xcconfig
│ └── Pods-KZPlayground
│ │ ├── Pods-KZPlayground-acknowledgements.markdown
│ │ ├── Pods-KZPlayground-acknowledgements.plist
│ │ ├── Pods-KZPlayground-dummy.m
│ │ ├── Pods-KZPlayground-environment.h
│ │ ├── Pods-KZPlayground-resources.sh
│ │ ├── Pods-KZPlayground.debug.xcconfig
│ │ └── Pods-KZPlayground.release.xcconfig
│ └── dyci
│ ├── Dynamic Code Injection
│ └── dyci
│ │ └── Classes
│ │ ├── Categories
│ │ ├── NSSet+ClassesList.h
│ │ └── NSSet+ClassesList.m
│ │ ├── FileWatcher
│ │ ├── SFFileWatcher.h
│ │ ├── SFFileWatcher.m
│ │ └── SFFileWatcherDelegate.h
│ │ ├── Injections
│ │ ├── NSObject+DyCInjection.h
│ │ ├── NSObject+DyCInjection.m
│ │ ├── UINib+StoryBoardSupport.h
│ │ ├── UINib+StoryBoardSupport.m
│ │ ├── UIViewController+XIBSupport.h
│ │ └── UIViewController+XIBSupport.m
│ │ ├── Notifications
│ │ ├── SFInjectionsNotificationsCenter.h
│ │ └── SFInjectionsNotificationsCenter.m
│ │ ├── SFDynamicCodeInjection.h
│ │ └── SFDynamicCodeInjection.m
│ ├── LICENSE.md
│ └── README.md
├── Funding.yml
├── KZPlayground.podspec
├── LICENSE
├── Pod
├── Assets
│ ├── .gitkeep
│ ├── KZPPresenterInfoViewController.xib
│ └── Main.storyboard
└── Classes
│ ├── .gitkeep
│ ├── Components
│ ├── Animation
│ │ ├── KZPAnimatorComponent.h
│ │ └── KZPAnimatorComponent.m
│ ├── Controls
│ │ ├── Action
│ │ │ ├── KZPActionComponent.h
│ │ │ └── KZPActionComponent.m
│ │ └── ValueAdjust
│ │ │ ├── KZPValueAdjustComponent.h
│ │ │ └── KZPValueAdjustComponent.m
│ ├── Images
│ │ └── ImagePicker
│ │ │ ├── AssetBrowser
│ │ │ ├── KZPImagePickerCollectionViewController.h
│ │ │ └── KZPImagePickerCollectionViewController.m
│ │ │ ├── KZPImagePickerComponent.h
│ │ │ └── KZPImagePickerComponent.m
│ ├── KZPComponent.h
│ ├── KZPSnapshotView.h
│ ├── Presenter
│ │ ├── KZPPresenterComponent.h
│ │ ├── KZPPresenterComponent.m
│ │ ├── KZPPresenterInfoViewController.h
│ │ └── KZPPresenterInfoViewController.m
│ └── Synchronization
│ │ ├── KZPSynchronizationComponent.h
│ │ └── KZPSynchronizationComponent.m
│ ├── Playground
│ ├── KZPPlayground+Internal.h
│ ├── KZPPlayground.h
│ ├── KZPPlayground.m
│ ├── KZPPlaygroundViewController.h
│ └── KZPPlaygroundViewController.m
│ └── Timeline
│ ├── KZPTimelineViewController.h
│ └── KZPTimelineViewController.m
├── README.md
├── Screenshots
├── playground.png
└── small_playground.gif
└── SwiftExample
├── Podfile
├── Podfile.lock
├── Pods
├── Headers
│ ├── Private
│ │ ├── KZPlayground
│ │ │ ├── KZPActionComponent.h
│ │ │ ├── KZPAnimatorComponent.h
│ │ │ ├── KZPComponent.h
│ │ │ ├── KZPImagePickerCollectionViewController.h
│ │ │ ├── KZPImagePickerComponent.h
│ │ │ ├── KZPPlayground+Internal.h
│ │ │ ├── KZPPlayground.h
│ │ │ ├── KZPPlaygroundViewController.h
│ │ │ ├── KZPPresenterComponent.h
│ │ │ ├── KZPPresenterInfoViewController.h
│ │ │ ├── KZPSnapshotView.h
│ │ │ ├── KZPSynchronizationComponent.h
│ │ │ ├── KZPTimelineViewController.h
│ │ │ └── KZPValueAdjustComponent.h
│ │ ├── NHBalancedFlowLayout
│ │ │ ├── NHBalancedFlowLayout.h
│ │ │ └── NHLinearPartition.h
│ │ ├── RSSwizzle
│ │ │ └── RSSwizzle.h
│ │ └── dyci
│ │ │ ├── NSObject+DyCInjection.h
│ │ │ ├── NSSet+ClassesList.h
│ │ │ ├── SFDynamicCodeInjection.h
│ │ │ ├── SFFileWatcher.h
│ │ │ ├── SFFileWatcherDelegate.h
│ │ │ ├── SFInjectionsNotificationsCenter.h
│ │ │ ├── UINib+StoryBoardSupport.h
│ │ │ └── UIViewController+XIBSupport.h
│ └── Public
│ │ └── Reveal-iOS-SDK
│ │ └── Reveal
│ │ ├── IBANetServiceTypes.h
│ │ ├── IBARevealLoader.h
│ │ ├── IBARevealLogger.h
│ │ └── Reveal.h
├── Local Podspecs
│ └── KZPlayground.podspec.json
├── Manifest.lock
├── NHBalancedFlowLayout
│ ├── LICENSE
│ ├── NHBalancedFlowLayout
│ │ ├── NHBalancedFlowLayout.h
│ │ ├── NHBalancedFlowLayout.m
│ │ ├── NHLinearPartition.h
│ │ └── NHLinearPartition.m
│ └── README.md
├── Pods.xcodeproj
│ ├── project.pbxproj
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── KZPlayground.xcscheme
├── RSSwizzle
│ ├── LICENSE
│ ├── README.md
│ └── RSSwizzle
│ │ ├── RSSwizzle.h
│ │ └── RSSwizzle.m
├── Reveal-iOS-SDK
│ └── Reveal-Framework-1.6.1
│ │ └── Reveal.framework
│ │ ├── Headers
│ │ ├── Reveal
│ │ └── Versions
│ │ ├── A
│ │ ├── Headers
│ │ │ ├── IBANetServiceTypes.h
│ │ │ ├── IBARevealLoader.h
│ │ │ ├── IBARevealLogger.h
│ │ │ └── Reveal.h
│ │ └── Reveal
│ │ └── Current
├── Target Support Files
│ ├── KZPlayground
│ │ ├── Info.plist
│ │ ├── KZPlayground-dummy.m
│ │ ├── KZPlayground-prefix.pch
│ │ ├── KZPlayground-umbrella.h
│ │ ├── KZPlayground.modulemap
│ │ └── KZPlayground.xcconfig
│ ├── NHBalancedFlowLayout
│ │ ├── Info.plist
│ │ ├── NHBalancedFlowLayout-dummy.m
│ │ ├── NHBalancedFlowLayout-prefix.pch
│ │ ├── NHBalancedFlowLayout-umbrella.h
│ │ ├── NHBalancedFlowLayout.modulemap
│ │ └── NHBalancedFlowLayout.xcconfig
│ ├── Pods-SwiftExample
│ │ ├── Info.plist
│ │ ├── Pods-SwiftExample-acknowledgements.markdown
│ │ ├── Pods-SwiftExample-acknowledgements.plist
│ │ ├── Pods-SwiftExample-dummy.m
│ │ ├── Pods-SwiftExample-frameworks.sh
│ │ ├── Pods-SwiftExample-resources.sh
│ │ ├── Pods-SwiftExample-umbrella.h
│ │ ├── Pods-SwiftExample.debug.xcconfig
│ │ ├── Pods-SwiftExample.modulemap
│ │ └── Pods-SwiftExample.release.xcconfig
│ ├── RSSwizzle
│ │ ├── Info.plist
│ │ ├── RSSwizzle-dummy.m
│ │ ├── RSSwizzle-prefix.pch
│ │ ├── RSSwizzle-umbrella.h
│ │ ├── RSSwizzle.modulemap
│ │ └── RSSwizzle.xcconfig
│ └── dyci
│ │ ├── Info.plist
│ │ ├── dyci-dummy.m
│ │ ├── dyci-prefix.pch
│ │ ├── dyci-umbrella.h
│ │ ├── dyci.modulemap
│ │ └── dyci.xcconfig
└── dyci
│ ├── Dynamic Code Injection
│ └── dyci
│ │ └── Classes
│ │ ├── Categories
│ │ ├── NSSet+ClassesList.h
│ │ └── NSSet+ClassesList.m
│ │ ├── FileWatcher
│ │ ├── SFFileWatcher.h
│ │ ├── SFFileWatcher.m
│ │ └── SFFileWatcherDelegate.h
│ │ ├── Injections
│ │ ├── NSObject+DyCInjection.h
│ │ ├── NSObject+DyCInjection.m
│ │ ├── UINib+StoryBoardSupport.h
│ │ ├── UINib+StoryBoardSupport.m
│ │ ├── UIViewController+XIBSupport.h
│ │ └── UIViewController+XIBSupport.m
│ │ ├── Notifications
│ │ ├── SFInjectionsNotificationsCenter.h
│ │ └── SFInjectionsNotificationsCenter.m
│ │ ├── SFDynamicCodeInjection.h
│ │ └── SFDynamicCodeInjection.m
│ ├── LICENSE.md
│ └── README.md
├── SwiftExample.xcodeproj
├── project.pbxproj
└── project.xcworkspace
│ └── contents.xcworkspacedata
├── SwiftExample.xcworkspace
└── contents.xcworkspacedata
├── SwiftExample
├── AppDelegate.swift
├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ └── Contents.json
│ ├── Contents.json
│ ├── background.imageset
│ │ ├── Contents.json
│ │ └── background.png
│ ├── content.imageset
│ │ ├── Contents.json
│ │ └── scrollList.png
│ └── statusBar.imageset
│ │ ├── Contents.json
│ │ └── statusBar.png
├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
├── Info.plist
└── PlaygroundExample.swift
└── iOSInjectionProject
├── BundleContents.h
├── BundleContents.m
├── InjectionBundle-Info.plist
├── InjectionBundle-Prefix.pch
├── InjectionBundle.xcodeproj
└── project.pbxproj
└── x86_64
├── built.txt
├── compile_commands.sh
├── identity.txt
└── injecting_class.o
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | build/
4 | *.pbxuser
5 | !default.pbxuser
6 | *.mode1v3
7 | !default.mode1v3
8 | *.mode2v3
9 | !default.mode2v3
10 | *.perspectivev3
11 | !default.perspectivev3
12 | xcuserdata
13 | *.xccheckout
14 | *.moved-aside
15 | DerivedData
16 | *.hmap
17 | *.ipa
18 | *.xcuserstate
19 |
--------------------------------------------------------------------------------
/.kick:
--------------------------------------------------------------------------------
1 | recipe :ruby
2 | Kicker::Recipes::Ruby.runner_bin = 'bacon -q'
3 |
4 | process do |potential_files|
5 | files = potential_files.take_and_map do |file|
6 | if file =~ %r{^.*\.(m|xib|strings)$}
7 | execute("/usr/bin/python #{File.expand_path("~/.dyci/scripts/dyci-recompile.py")} '#{"%s" % File.expand_path(file)}'")
8 | puts "KZPlayground: Recompiled #{file}"
9 | file
10 | end
11 | end
12 | end
13 |
14 | process do |remaining_files|
15 | remaining_files.take_and_map do |file|
16 | puts "KZPlayground: Ignored #{file}"
17 | file
18 | end
19 | end
20 |
21 | startup do
22 | log "KZPlayground: Watching for file changes!"
23 | end
24 |
--------------------------------------------------------------------------------
/Example/KZPlayground.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Example/KZPlayground.xcodeproj/xcshareddata/xcschemes/KZPlayground.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 |
--------------------------------------------------------------------------------
/Example/KZPlayground.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Example/KZPlayground/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "40x40",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "60x60",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "60x60",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "ipad",
25 | "size" : "29x29",
26 | "scale" : "1x"
27 | },
28 | {
29 | "idiom" : "ipad",
30 | "size" : "29x29",
31 | "scale" : "2x"
32 | },
33 | {
34 | "idiom" : "ipad",
35 | "size" : "40x40",
36 | "scale" : "1x"
37 | },
38 | {
39 | "idiom" : "ipad",
40 | "size" : "40x40",
41 | "scale" : "2x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "76x76",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "76x76",
51 | "scale" : "2x"
52 | }
53 | ],
54 | "info" : {
55 | "version" : 1,
56 | "author" : "xcode"
57 | }
58 | }
--------------------------------------------------------------------------------
/Example/KZPlayground/Images.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "orientation" : "portrait",
5 | "idiom" : "iphone",
6 | "extent" : "full-screen",
7 | "minimum-system-version" : "7.0",
8 | "scale" : "2x"
9 | },
10 | {
11 | "orientation" : "portrait",
12 | "idiom" : "iphone",
13 | "subtype" : "retina4",
14 | "extent" : "full-screen",
15 | "minimum-system-version" : "7.0",
16 | "scale" : "2x"
17 | },
18 | {
19 | "orientation" : "portrait",
20 | "idiom" : "ipad",
21 | "extent" : "full-screen",
22 | "minimum-system-version" : "7.0",
23 | "scale" : "1x"
24 | },
25 | {
26 | "orientation" : "landscape",
27 | "idiom" : "ipad",
28 | "extent" : "full-screen",
29 | "minimum-system-version" : "7.0",
30 | "scale" : "1x"
31 | },
32 | {
33 | "orientation" : "portrait",
34 | "idiom" : "ipad",
35 | "extent" : "full-screen",
36 | "minimum-system-version" : "7.0",
37 | "scale" : "2x"
38 | },
39 | {
40 | "orientation" : "landscape",
41 | "idiom" : "ipad",
42 | "extent" : "full-screen",
43 | "minimum-system-version" : "7.0",
44 | "scale" : "2x"
45 | }
46 | ],
47 | "info" : {
48 | "version" : 1,
49 | "author" : "xcode"
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/Example/KZPlayground/Images.xcassets/TEst.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "scale" : "2x",
10 | "filename" : "Screen Shot 2014-10-27 at 17.55.30.png"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Example/KZPlayground/Images.xcassets/TEst.imageset/Screen Shot 2014-10-27 at 17.55.30.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/krzysztofzablocki/Playgrounds/0b1494a04fed2cc7033f2a4f2113eef8b7f50b0f/Example/KZPlayground/Images.xcassets/TEst.imageset/Screen Shot 2014-10-27 at 17.55.30.png
--------------------------------------------------------------------------------
/Example/KZPlayground/Images.xcassets/foldify.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "scale" : "2x",
10 | "filename" : "foldify.png"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Example/KZPlayground/Images.xcassets/foldify.imageset/foldify.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/krzysztofzablocki/Playgrounds/0b1494a04fed2cc7033f2a4f2113eef8b7f50b0f/Example/KZPlayground/Images.xcassets/foldify.imageset/foldify.png
--------------------------------------------------------------------------------
/Example/KZPlayground/KZPAppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // KZPAppDelegate.h
3 | // KZPlayground
4 | //
5 | // Created by CocoaPods on 10/22/2014.
6 | // Copyright (c) 2014 Krzysztof Zablocki. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface KZPAppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/Example/KZPlayground/KZPAppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // KZPAppDelegate.m
3 | // KZPlayground
4 | //
5 | // Created by CocoaPods on 10/22/2014.
6 | // Copyright (c) 2014 Krzysztof Zablocki. All rights reserved.
7 | //
8 |
9 | #import "KZPAppDelegate.h"
10 | #import
11 | @implementation KZPAppDelegate
12 |
13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
14 | {
15 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].applicationFrame];
16 |
17 | self.window.rootViewController = [KZPPlaygroundViewController playgroundViewController];
18 | [self.window makeKeyAndVisible];
19 | return YES;
20 | }
21 |
22 | - (void)applicationWillResignActive:(UIApplication *)application
23 | {
24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
26 | }
27 |
28 | - (void)applicationDidEnterBackground:(UIApplication *)application
29 | {
30 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
31 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
32 | }
33 |
34 | - (void)applicationWillEnterForeground:(UIApplication *)application
35 | {
36 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
37 | }
38 |
39 | - (void)applicationDidBecomeActive:(UIApplication *)application
40 | {
41 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
42 | }
43 |
44 | - (void)applicationWillTerminate:(UIApplication *)application
45 | {
46 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
47 | }
48 |
49 | @end
50 |
--------------------------------------------------------------------------------
/Example/KZPlayground/KZPlayground-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleIdentifier
12 | org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | ${PRODUCT_NAME}
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1.0
25 | LSRequiresIPhoneOS
26 |
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UIViewControllerBasedStatusBarAppearance
38 |
39 | UIStatusBarHidden
40 |
41 | UISupportedInterfaceOrientations~ipad
42 |
43 | UIInterfaceOrientationPortrait
44 | UIInterfaceOrientationPortraitUpsideDown
45 | UIInterfaceOrientationLandscapeLeft
46 | UIInterfaceOrientationLandscapeRight
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/Example/KZPlayground/KZPlayground-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 | #import
8 |
9 | #ifndef __IPHONE_5_0
10 | #warning "This project uses features only available in iOS SDK 5.0 and later."
11 | #endif
12 |
13 | #ifdef __OBJC__
14 | #import
15 | #import
16 | #endif
17 |
--------------------------------------------------------------------------------
/Example/KZPlayground/KZPlaygroundExample.h:
--------------------------------------------------------------------------------
1 | //
2 | // KZPlaygroundExample.h
3 | // KZPPlaygroundHelper
4 | //
5 | // Created by Krzysztof Zabłocki on 19/10/2014.
6 | // Copyright (c) 2014 pixle. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "KZPPlayground.h"
11 |
12 | @interface KZPlaygroundExample : KZPPlayground
13 | @end
14 |
15 |
--------------------------------------------------------------------------------
/Example/KZPlayground/KZPlaygroundExample.m:
--------------------------------------------------------------------------------
1 | //
2 | // KZPlaygroundExample.m
3 | //
4 | // Created by Krzysztof Zabłocki on 19/10/2014.
5 | // Copyright (c) 2014 pixle. All rights reserved.
6 | //
7 |
8 | #import "KZPlaygroundExample.h"
9 | #import "KZPPlayground+Internal.h"
10 | @import SceneKit;
11 |
12 | @implementation KZPlaygroundExample
13 | - (void)setup
14 | {
15 | KZPShow(@"Setup snapshot");
16 | }
17 |
18 | - (void)run
19 | {
20 | [self backgroundImagePickingExample];
21 | [self samplePlayground];
22 | // [self sceneKit];
23 |
24 | }
25 |
26 | - (void)backgroundImagePickingExample
27 | {
28 | UIImageView *imageView = [UIImageView new];
29 | imageView.center = self.worksheetView.center;
30 | [self.worksheetView addSubview:imageView];
31 |
32 | KZPAdjustImage(myImage);
33 | KZPWhenChanged(myImage, (^(UIImage *img) {
34 | imageView.image = img;
35 | [imageView sizeToFit];
36 | imageView.center = self.worksheetView.center;
37 | }));
38 | }
39 |
40 | - (void)samplePlayground
41 | {
42 | UIImage *img = [UIImage imageNamed:@"avatar.jpg"];
43 | KZPShow(img);
44 |
45 | UIImage *bigImage = [UIImage imageNamed:@"foldify"];
46 | KZPShow(bigImage);
47 |
48 | UILabel *label = [[UILabel alloc] init];
49 | label.text = NSLocalizedString(@"main.hello", nil);
50 | [label sizeToFit];
51 | KZPShow(label);
52 |
53 | UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 128, 256)];
54 | view.layer.borderColor = UIColor.yellowColor.CGColor;
55 | view.layer.borderWidth = 2;
56 | view.backgroundColor = UIColor.blueColor;
57 | [view addSubview:({
58 | UIImageView *imgView = [[UIImageView alloc] initWithImage:bigImage];
59 | imgView.transform = CGAffineTransformMakeRotation(M_PI_2);
60 | imgView.center = CGPointMake(CGRectGetMidX(view.bounds), CGRectGetMidY(view.bounds));
61 | imgView;
62 | })];
63 | view.layer.cornerRadius = 30;
64 | view.clipsToBounds = YES;
65 | KZPShow(view);
66 |
67 | view.center = self.worksheetView.center;
68 | [self.worksheetView addSubview:view];
69 |
70 | KZPAdjustValue(rotation, 0, 360).defaultValue(120);
71 | KZPAdjustValue(scale, 0.3f, 3.0f).defaultValue(1.5f);
72 | //KZPAnimateValueAR(scale, 0.3, 3.0f);
73 |
74 | UIPanGestureRecognizer *panGestureRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePanGesture:)];
75 | [self.worksheetView addGestureRecognizer:panGestureRecognizer];
76 | self.transientObjects[@"pannableView"] = view;
77 |
78 | KZPAnimate(^{
79 | view.transform = CGAffineTransformRotate(CGAffineTransformMakeScale(scale, scale), rotation * (M_PI / 180));
80 | });
81 |
82 | UIBezierPath *bezierPath = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(0, 0, 128, 128)];
83 | [bezierPath setLineWidth:5];
84 | CGFloat pattern[] = { 9, 4, 0, 1 };
85 | [bezierPath setLineDash:pattern count:4 phase:2];
86 | KZPShow(bezierPath);
87 | }
88 |
89 | - (void)handlePanGesture:(UIPanGestureRecognizer *)panGestureRecognizer
90 | {
91 | UIView *view = self.transientObjects[@"pannableView"];
92 | view.center = [panGestureRecognizer locationInView:panGestureRecognizer.view];
93 | }
94 |
95 | - (void)sceneKit
96 | {
97 | SCNView *sceneView = [[SCNView alloc] initWithFrame:self.worksheetView.bounds];
98 | [self.worksheetView addSubview:sceneView];
99 |
100 | // An empty scene
101 | SCNScene *scene = [SCNScene scene];
102 | sceneView.scene = scene;
103 |
104 | // A camera
105 | SCNNode *cameraNode = [SCNNode node];
106 | cameraNode.camera = [SCNCamera camera];
107 |
108 | KZPAdjustValue(xPosition, 0, 20);
109 | KZPAdjustValue(yPosition, -5, 10);
110 | KZPAdjustValue(zPosition, 30, 60);
111 |
112 | KZPAnimate(^{
113 | cameraNode.transform = SCNMatrix4Rotate(SCNMatrix4MakeTranslation(xPosition, yPosition, zPosition),
114 | -M_PI / 7.0,
115 | 1, 0, 0);
116 | });
117 |
118 | [scene.rootNode addChildNode:cameraNode];
119 |
120 | // A spotlight
121 | SCNLight *spotLight = [SCNLight light];
122 | spotLight.type = SCNLightTypeSpot;
123 | spotLight.color = [UIColor redColor];
124 | SCNNode *spotLightNode = [SCNNode node];
125 | spotLightNode.light = spotLight;
126 | spotLightNode.position = SCNVector3Make(-2, 1, 0);
127 |
128 | [cameraNode addChildNode:spotLightNode];
129 |
130 | // A square box
131 | CGFloat boxSide = 2.0;
132 | SCNBox *box = [SCNBox boxWithWidth:boxSide
133 | height:boxSide
134 | length:boxSide
135 | chamferRadius:0];
136 | SCNNode *boxNode = [SCNNode nodeWithGeometry:box];
137 | boxNode.transform = SCNMatrix4MakeRotation(M_PI_2 / 3, 0, 1, 0);
138 | [scene.rootNode addChildNode:boxNode];
139 |
140 |
141 | KZPAnimateValueAR(yRotation, 0, 120);
142 | KZPAnimate(^{
143 | boxNode.transform = SCNMatrix4MakeRotation(yRotation * (M_PI / 180), 0, 1, 0);
144 | });
145 |
146 | KZPAction(@"Toggle Visibility", ^{
147 | boxNode.hidden = !boxNode.hidden;
148 | });
149 | }
150 | @end
151 |
--------------------------------------------------------------------------------
/Example/KZPlayground/avatar.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/krzysztofzablocki/Playgrounds/0b1494a04fed2cc7033f2a4f2113eef8b7f50b0f/Example/KZPlayground/avatar.jpg
--------------------------------------------------------------------------------
/Example/KZPlayground/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/Example/KZPlayground/en.lproj/Localizable.strings:
--------------------------------------------------------------------------------
1 | "main.hello" = "Hello! world!";
--------------------------------------------------------------------------------
/Example/KZPlayground/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // KZPlayground
4 | //
5 | // Created by Krzysztof Zablocki on 10/22/2014.
6 | // Copyright (c) 2014 Krzysztof Zablocki. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | #import "KZPAppDelegate.h"
12 |
13 | int main(int argc, char * argv[])
14 | {
15 | @autoreleasepool {
16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([KZPAppDelegate class]));
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Example/Podfile:
--------------------------------------------------------------------------------
1 | source 'https://github.com/CocoaPods/Specs.git'
2 |
3 | target 'KZPlayground', :exclusive => true do
4 | pod "KZPlayground", :path => "../"
5 | end
6 |
--------------------------------------------------------------------------------
/Example/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - dyci (0.1.5.6):
3 | - dyci/Injections
4 | - dyci/Injections (0.1.5.6)
5 | - KZPlayground (0.3.1):
6 | - dyci (~> 0.1.5.6)
7 | - NHBalancedFlowLayout (~> 0.2)
8 | - RSSwizzle (~> 0.1.0)
9 | - NHBalancedFlowLayout (0.2)
10 | - RSSwizzle (0.1.0)
11 |
12 | DEPENDENCIES:
13 | - KZPlayground (from `../`)
14 |
15 | EXTERNAL SOURCES:
16 | KZPlayground:
17 | :path: ../
18 |
19 | SPEC CHECKSUMS:
20 | dyci: 86668b266b8a281cb6db02843150f6a210c34ee9
21 | KZPlayground: a29737f87da26c8ae027c871ccad8b1c838fd732
22 | NHBalancedFlowLayout: be3c297b54f74c27607aaa04563270ecbd2d8e38
23 | RSSwizzle: ab39962b7ec56d19c2318ec1127e253797121363
24 |
25 | COCOAPODS: 0.34.4
26 |
--------------------------------------------------------------------------------
/Example/Pods/Headers/Public/KZPlayground/KZPActionComponent.h:
--------------------------------------------------------------------------------
1 | ../../../../../Pod/Classes/Components/Controls/Action/KZPActionComponent.h
--------------------------------------------------------------------------------
/Example/Pods/Headers/Public/KZPlayground/KZPAnimatorComponent.h:
--------------------------------------------------------------------------------
1 | ../../../../../Pod/Classes/Components/Animation/KZPAnimatorComponent.h
--------------------------------------------------------------------------------
/Example/Pods/Headers/Public/KZPlayground/KZPComponent.h:
--------------------------------------------------------------------------------
1 | ../../../../../Pod/Classes/Components/KZPComponent.h
--------------------------------------------------------------------------------
/Example/Pods/Headers/Public/KZPlayground/KZPImagePickerCollectionViewController.h:
--------------------------------------------------------------------------------
1 | ../../../../../Pod/Classes/Components/Images/ImagePicker/AssetBrowser/KZPImagePickerCollectionViewController.h
--------------------------------------------------------------------------------
/Example/Pods/Headers/Public/KZPlayground/KZPImagePickerComponent.h:
--------------------------------------------------------------------------------
1 | ../../../../../Pod/Classes/Components/Images/ImagePicker/KZPImagePickerComponent.h
--------------------------------------------------------------------------------
/Example/Pods/Headers/Public/KZPlayground/KZPPlayground+Internal.h:
--------------------------------------------------------------------------------
1 | ../../../../../Pod/Classes/Playground/KZPPlayground+Internal.h
--------------------------------------------------------------------------------
/Example/Pods/Headers/Public/KZPlayground/KZPPlayground.h:
--------------------------------------------------------------------------------
1 | ../../../../../Pod/Classes/Playground/KZPPlayground.h
--------------------------------------------------------------------------------
/Example/Pods/Headers/Public/KZPlayground/KZPPlaygroundViewController.h:
--------------------------------------------------------------------------------
1 | ../../../../../Pod/Classes/Playground/KZPPlaygroundViewController.h
--------------------------------------------------------------------------------
/Example/Pods/Headers/Public/KZPlayground/KZPPresenterComponent.h:
--------------------------------------------------------------------------------
1 | ../../../../../Pod/Classes/Components/Presenter/KZPPresenterComponent.h
--------------------------------------------------------------------------------
/Example/Pods/Headers/Public/KZPlayground/KZPPresenterInfoViewController.h:
--------------------------------------------------------------------------------
1 | ../../../../../Pod/Classes/Components/Presenter/KZPPresenterInfoViewController.h
--------------------------------------------------------------------------------
/Example/Pods/Headers/Public/KZPlayground/KZPSnapshotView.h:
--------------------------------------------------------------------------------
1 | ../../../../../Pod/Classes/Components/KZPSnapshotView.h
--------------------------------------------------------------------------------
/Example/Pods/Headers/Public/KZPlayground/KZPSynchronizationComponent.h:
--------------------------------------------------------------------------------
1 | ../../../../../Pod/Classes/Components/Synchronization/KZPSynchronizationComponent.h
--------------------------------------------------------------------------------
/Example/Pods/Headers/Public/KZPlayground/KZPTimelineViewController.h:
--------------------------------------------------------------------------------
1 | ../../../../../Pod/Classes/Timeline/KZPTimelineViewController.h
--------------------------------------------------------------------------------
/Example/Pods/Headers/Public/KZPlayground/KZPValueAdjustComponent.h:
--------------------------------------------------------------------------------
1 | ../../../../../Pod/Classes/Components/Controls/ValueAdjust/KZPValueAdjustComponent.h
--------------------------------------------------------------------------------
/Example/Pods/Headers/Public/NHBalancedFlowLayout/NHBalancedFlowLayout.h:
--------------------------------------------------------------------------------
1 | ../../../NHBalancedFlowLayout/NHBalancedFlowLayout/NHBalancedFlowLayout.h
--------------------------------------------------------------------------------
/Example/Pods/Headers/Public/NHBalancedFlowLayout/NHLinearPartition.h:
--------------------------------------------------------------------------------
1 | ../../../NHBalancedFlowLayout/NHBalancedFlowLayout/NHLinearPartition.h
--------------------------------------------------------------------------------
/Example/Pods/Headers/Public/RSSwizzle/RSSwizzle.h:
--------------------------------------------------------------------------------
1 | ../../../RSSwizzle/RSSwizzle/RSSwizzle.h
--------------------------------------------------------------------------------
/Example/Pods/Headers/Public/dyci/NSObject+DyCInjection.h:
--------------------------------------------------------------------------------
1 | ../../../dyci/Dynamic Code Injection/dyci/Classes/Injections/NSObject+DyCInjection.h
--------------------------------------------------------------------------------
/Example/Pods/Headers/Public/dyci/NSSet+ClassesList.h:
--------------------------------------------------------------------------------
1 | ../../../dyci/Dynamic Code Injection/dyci/Classes/Categories/NSSet+ClassesList.h
--------------------------------------------------------------------------------
/Example/Pods/Headers/Public/dyci/SFDynamicCodeInjection.h:
--------------------------------------------------------------------------------
1 | ../../../dyci/Dynamic Code Injection/dyci/Classes/SFDynamicCodeInjection.h
--------------------------------------------------------------------------------
/Example/Pods/Headers/Public/dyci/SFFileWatcher.h:
--------------------------------------------------------------------------------
1 | ../../../dyci/Dynamic Code Injection/dyci/Classes/FileWatcher/SFFileWatcher.h
--------------------------------------------------------------------------------
/Example/Pods/Headers/Public/dyci/SFFileWatcherDelegate.h:
--------------------------------------------------------------------------------
1 | ../../../dyci/Dynamic Code Injection/dyci/Classes/FileWatcher/SFFileWatcherDelegate.h
--------------------------------------------------------------------------------
/Example/Pods/Headers/Public/dyci/SFInjectionsNotificationsCenter.h:
--------------------------------------------------------------------------------
1 | ../../../dyci/Dynamic Code Injection/dyci/Classes/Notifications/SFInjectionsNotificationsCenter.h
--------------------------------------------------------------------------------
/Example/Pods/Headers/Public/dyci/UINib+StoryBoardSupport.h:
--------------------------------------------------------------------------------
1 | ../../../dyci/Dynamic Code Injection/dyci/Classes/Injections/UINib+StoryBoardSupport.h
--------------------------------------------------------------------------------
/Example/Pods/Headers/Public/dyci/UIViewController+XIBSupport.h:
--------------------------------------------------------------------------------
1 | ../../../dyci/Dynamic Code Injection/dyci/Classes/Injections/UIViewController+XIBSupport.h
--------------------------------------------------------------------------------
/Example/Pods/Local Podspecs/KZPlayground.podspec:
--------------------------------------------------------------------------------
1 | Pod::Spec.new do |s|
2 | s.name = "KZPlayground"
3 | s.version = "0.3.1"
4 | s.summary = "Playgrounds but for Objective-C, with some extra coolnes."
5 | s.description = <<-DESC
6 | We all love Swift playgrounds, they are really great,
7 | but since most of us still write Objective-C code, why not get benefits of rapid development with Objective-C Plagrounds?
8 | Fast robust interations make it easy to prototype custom UI/Algorithms or even learn Objective-C or some new API.
9 | DESC
10 | s.homepage = "https://github.com/krzysztofzablocki/KZPlayground"
11 | s.license = 'MIT'
12 | s.author = { "Krzysztof Zablocki" => "krzysztof.zablocki@me.com" }
13 | s.source = { :git => "https://github.com/krzysztofzablocki/KZPlayground.git", :tag => s.version.to_s }
14 | s.social_media_url = 'https://twitter.com/merowing_'
15 |
16 | s.platform = :ios, '7.0'
17 | s.requires_arc = true
18 |
19 | s.source_files = 'Pod/Classes/**/*.h', 'Pod/Classes/**/*.m'
20 | s.resources = ['Pod/Assets/*']
21 |
22 | s.dependency 'dyci', '~> 0.1.5.6'
23 | s.dependency 'RSSwizzle', '~> 0.1.0'
24 | s.dependency 'NHBalancedFlowLayout', '~> 0.2'
25 |
26 | s.prepare_command = <<-'CMD'
27 | cat << EOF > ../../.kick
28 | recipe :ruby
29 | Kicker::Recipes::Ruby.runner_bin = 'bacon -q'
30 |
31 | process do |potential_files|
32 | files = potential_files.take_and_map do |file|
33 | if file =~ %r{^.*\.(m|xib|strings)$}
34 | execute("/usr/bin/python #{File.expand_path("~/.dyci/scripts/dyci-recompile.py")} #{File.expand_path(file)}")
35 | puts "KZPlayground: Recompiled #{file}"
36 | file
37 | end
38 | end
39 | end
40 |
41 | process do |remaining_files|
42 | remaining_files.take_and_map do |file|
43 | puts "KZPlayground: Ignored #{file}"
44 | file
45 | end
46 | end
47 |
48 | startup do
49 | log "KZPlayground: Watching for file changes!"
50 | end
51 | EOF
52 | CMD
53 | end
54 |
--------------------------------------------------------------------------------
/Example/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - dyci (0.1.5.6):
3 | - dyci/Injections
4 | - dyci/Injections (0.1.5.6)
5 | - KZPlayground (0.3.1):
6 | - dyci (~> 0.1.5.6)
7 | - NHBalancedFlowLayout (~> 0.2)
8 | - RSSwizzle (~> 0.1.0)
9 | - NHBalancedFlowLayout (0.2)
10 | - RSSwizzle (0.1.0)
11 |
12 | DEPENDENCIES:
13 | - KZPlayground (from `../`)
14 |
15 | EXTERNAL SOURCES:
16 | KZPlayground:
17 | :path: ../
18 |
19 | SPEC CHECKSUMS:
20 | dyci: 86668b266b8a281cb6db02843150f6a210c34ee9
21 | KZPlayground: a29737f87da26c8ae027c871ccad8b1c838fd732
22 | NHBalancedFlowLayout: be3c297b54f74c27607aaa04563270ecbd2d8e38
23 | RSSwizzle: ab39962b7ec56d19c2318ec1127e253797121363
24 |
25 | COCOAPODS: 0.34.4
26 |
--------------------------------------------------------------------------------
/Example/Pods/NHBalancedFlowLayout/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2013 Niels de Hoog
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 |
--------------------------------------------------------------------------------
/Example/Pods/NHBalancedFlowLayout/NHBalancedFlowLayout/NHBalancedFlowLayout.h:
--------------------------------------------------------------------------------
1 | //
2 | // BalancedFlowLayout.h
3 | // BalancedFlowLayout
4 | //
5 | // Created by Niels de Hoog on 31/10/13.
6 | // Copyright (c) 2013 Niels de Hoog. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | /**
12 | * The BalancedFlowLayout class is designed to display items of different sizes and aspect ratios in a grid, without wasting any visual space.
13 | * It takes the preferred sizes for the displayed items and a preferred row height as input to determine the optimal layout.
14 | *
15 | * In order to use this layout, the delegate for the collection view must implement the required methods in the BalancedFlowLayoutDelegate protocol.
16 | * Currently this class does not support supplementary or decoration views.
17 | *
18 | */
19 | @interface NHBalancedFlowLayout : UICollectionViewLayout
20 |
21 | // The preferred size for each row measured in the scroll direction
22 | @property (nonatomic) CGFloat preferredRowSize;
23 |
24 | // The size of each section's header. This maybe dynamically adjusted
25 | // per section via the protocol method referenceSizeForHeaderInSection.
26 | @property (nonatomic) CGSize headerReferenceSize;
27 |
28 | // The size of each section's header. This maybe dynamically adjusted
29 | // per section via the protocol method referenceSizeForFooterInSection.
30 | @property (nonatomic) CGSize footerReferenceSize;
31 |
32 | // The margins used to lay out content in a section.
33 | @property (nonatomic) UIEdgeInsets sectionInset;
34 |
35 | // The minimum spacing to use between lines of items in the grid.
36 | @property (nonatomic) CGFloat minimumLineSpacing;
37 |
38 | // The minimum spacing to use between items in the same row.
39 | @property (nonatomic) CGFloat minimumInteritemSpacing;
40 |
41 | // The scroll direction of the grid.
42 | @property (nonatomic) UICollectionViewScrollDirection scrollDirection;
43 |
44 | @end
45 |
46 |
47 | @protocol NHBalancedFlowLayoutDelegate
48 |
49 | @required
50 | - (CGSize)collectionView:(UICollectionView *)collectionView layout:(NHBalancedFlowLayout *)collectionViewLayout preferredSizeForItemAtIndexPath:(NSIndexPath *)indexPath;
51 |
52 | @end
--------------------------------------------------------------------------------
/Example/Pods/NHBalancedFlowLayout/NHBalancedFlowLayout/NHLinearPartition.h:
--------------------------------------------------------------------------------
1 | //
2 | // LinearPartition.h
3 | // BalancedFlowLayout
4 | //
5 | // Created by Niels de Hoog on 08-10-13.
6 | // Copyright (c) 2013 Niels de Hoog. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | /**
12 | * Partitions a sequence of non-negative integers into the required number of partitions.
13 | * Based on implementation in Python by Óscar López: http://stackoverflow.com/a/7942946
14 | * Example: [LinearPartition linearPartitionForSequence:@[9,2,6,3,8,5,8,1,7,3,4] numberOfPartitions:3] => @[@[9,2,6,3],@[8,5,8],@[1,7,3,4]]
15 | */
16 | @interface NHLinearPartition : NSObject
17 |
18 | + (NSArray *)linearPartitionForSequence:(NSArray *)sequence numberOfPartitions:(NSInteger)numberOfPartitions;
19 |
20 | @end
21 |
--------------------------------------------------------------------------------
/Example/Pods/NHBalancedFlowLayout/NHBalancedFlowLayout/NHLinearPartition.m:
--------------------------------------------------------------------------------
1 | //
2 | // LinearPartition.m
3 | // BalancedFlowLayout
4 | //
5 | // Created by Niels de Hoog on 08-10-13.
6 | // Copyright (c) 2013 Niels de Hoog. All rights reserved.
7 | //
8 |
9 | #import "NHLinearPartition.h"
10 |
11 |
12 | #define NH_LP_TABLE_LOOKUP(table, i, j, rowsize) (table)[(i) * (rowsize) + (j)]
13 |
14 |
15 | @implementation NHLinearPartition
16 |
17 | /**
18 | * Returns a solution integer array for the linear partition problem
19 | *
20 | * @param sequence An array of NSNumber's
21 | * @param numPartitions The number of partitions wanted
22 | *
23 | * @return A C-style solution table
24 | */
25 | + (NSInteger *)linearPartitionTable:(NSArray *)sequence numPartitions:(NSInteger)numPartitions
26 | {
27 | NSInteger k = numPartitions;
28 | NSInteger n = [sequence count];
29 |
30 | // allocate a table buffer of n * k integers
31 | NSInteger tableSize = sizeof(NSInteger) * n * k;
32 | NSInteger *tmpTable = (NSInteger *)malloc(tableSize);
33 | memset(tmpTable, 0, tableSize);
34 |
35 | // allocate a solution buffer of (n - 1) * (k - 1) integers
36 | NSInteger solutionSize = sizeof(NSInteger) * (n - 1) * (k - 1);
37 | NSInteger *solution = (NSInteger *)malloc(solutionSize);
38 | memset(solution, 0, solutionSize);
39 |
40 | // fill table with initial values
41 | for (NSInteger i = 0; i < n; i++) {
42 | NSInteger offset = i? NH_LP_TABLE_LOOKUP(tmpTable, i - 1, 0, k) : 0;
43 | NH_LP_TABLE_LOOKUP(tmpTable, i, 0, k) = [sequence[i] integerValue] + offset;
44 | }
45 |
46 | for (NSInteger j = 0; j < k; j++) {
47 | NH_LP_TABLE_LOOKUP(tmpTable, 0, j, k) = [sequence[0] integerValue];
48 | }
49 |
50 | // calculate the costs and fill the solution buffer
51 | for (NSInteger i = 1; i < n; i++) {
52 | for (NSInteger j = 1; j < k; j++) {
53 | NSInteger currentMin = 0;
54 | NSInteger minX = NSIntegerMax;
55 |
56 | for (NSInteger x = 0; x < i; x++) {
57 | NSInteger c1 = NH_LP_TABLE_LOOKUP(tmpTable, x, j - 1, k);
58 | NSInteger c2 = NH_LP_TABLE_LOOKUP(tmpTable, i, 0, k) - NH_LP_TABLE_LOOKUP(tmpTable, x, 0, k);
59 | NSInteger cost = MAX(c1, c2);
60 |
61 | if (!x || cost < currentMin) {
62 | currentMin = cost;
63 | minX = x;
64 | }
65 | }
66 |
67 | NH_LP_TABLE_LOOKUP(tmpTable, i, j, k) = currentMin;
68 | NH_LP_TABLE_LOOKUP(solution, i - 1, j - 1, k - 1) = minX;
69 | }
70 | }
71 |
72 | // free the tmp table, we don't need it anymore
73 | free(tmpTable);
74 |
75 | return solution;
76 | }
77 |
78 | + (NSArray *)linearPartitionForSequence:(NSArray *)sequence numberOfPartitions:(NSInteger)numberOfPartitions
79 | {
80 | NSInteger n = [sequence count];
81 | NSInteger k = numberOfPartitions;
82 |
83 | if (k <= 0) return @[];
84 |
85 | if (k >= n) {
86 | NSMutableArray *partition = [[NSMutableArray alloc] init];
87 | [sequence enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
88 | [partition addObject:@[obj]];
89 | }];
90 | return [partition copy];
91 | }
92 |
93 | if (n == 1) {
94 | return @[sequence];
95 | }
96 |
97 | // get the solution table
98 | NSInteger *solution = [self linearPartitionTable:sequence numPartitions:numberOfPartitions];
99 | NSInteger solutionRowSize = numberOfPartitions - 1;
100 |
101 | k = k - 2;
102 | n = n - 1;
103 | NSMutableArray *answer = [NSMutableArray array];
104 |
105 | while (k >= 0) {
106 | if (n < 1) {
107 | [answer insertObject:@[] atIndex:0];
108 | } else {
109 | NSMutableArray *currentAnswer = [NSMutableArray array];
110 | for (NSInteger i = NH_LP_TABLE_LOOKUP(solution, n - 1, k, solutionRowSize) + 1, range = n + 1; i < range; i++) {
111 | [currentAnswer addObject:sequence[i]];
112 | }
113 | [answer insertObject:currentAnswer atIndex:0];
114 |
115 | n = NH_LP_TABLE_LOOKUP(solution, n - 1, k, solutionRowSize);
116 | }
117 |
118 | k = k - 1;
119 | }
120 |
121 | // free the solution table because we don't need it anymore
122 | free(solution);
123 |
124 | NSMutableArray *currentAnswer = [NSMutableArray array];
125 | for (NSInteger i = 0, range = n + 1; i < range; i++) {
126 | [currentAnswer addObject:sequence[i]];
127 | }
128 |
129 | [answer insertObject:currentAnswer atIndex:0];
130 |
131 | return [answer copy];
132 | }
133 |
134 | @end
135 |
136 |
137 |
138 |
--------------------------------------------------------------------------------
/Example/Pods/NHBalancedFlowLayout/README.md:
--------------------------------------------------------------------------------
1 | NHBalancedFlowLayout
2 | ==================
3 |
4 | UICollectionViewLayout subclass for displaying items of different sizes in a grid without wasting any visual space. Inspired by: http://www.crispymtn.com/stories/the-algorithm-for-a-perfectly-balanced-photo-gallery
5 |
6 | ## Notes
7 | * Tested with iOS 7, but should be compatible with iOS6 as well
8 | * Works with iPhone and iPad
9 | * All interface orientations are supported
10 |
11 | ## Screenshots
12 |
13 |
14 |
15 |
16 | ## Installation
17 |
18 | The easiest way is to use CocoaPods. If you don't already, here's a [guide](http://guides.cocoapods.org/using/getting-started.html).
19 |
20 | pod 'NHBalancedFlowLayout', '~> 0.1.2'
21 |
22 | If you don't use CocoaPods, you'll need to copy the following files into your project:
23 |
24 | * NHBalancedFlowLayout.h
25 | * NHBalancedFlowLayout.m
26 | * NHLinearPartition.h
27 | * NHLinearPartition.m
28 |
29 | ## Credits
30 |
31 | Attributions for the photos in the same order as they appear in the demo:
32 |
33 | * http://www.flickr.com/photos/adriensifre/7162196453/
34 | * http://www.flickr.com/photos/ucumari/2949701552/
35 | * http://www.flickr.com/photos/ucumari/388370102/
36 | * http://www.flickr.com/photos/38659937@N06/3567549164/
37 | * http://www.flickr.com/photos/vinothchandar/5139245960/
38 | * http://www.flickr.com/photos/expressmonorail/3581442376/
39 | * http://www.flickr.com/photos/keithmwilliams/4465380932/
40 | * http://en.wikipedia.org/wiki/File:Bobcat-Texas-9110.jpg
41 | * http://www.flickr.com/photos/thecaucas/2390806406/
42 | * http://www.flickr.com/photos/ucumari/2342703987/
43 | * http://www.flickr.com/photos/ucumari/2317386162/
44 | * http://www.flickr.com/photos/ucumari/448815607/
45 | * http://www.flickr.com/photos/kshathriya/331847679/
46 | * http://www.flickr.com/photos/ucumari/367041320/
47 | * http://www.flickr.com/photos/da100fotos/465868860/
48 | * http://www.flickr.com/photos/hhoyer/3758550410/
49 | * http://www.flickr.com/photos/tambako/9314344697/
50 | * http://www.flickr.com/photos/sergiu_bacioiu/4485931477/
51 | * http://www.flickr.com/photos/matthileo/4077650329/
52 | * http://www.flickr.com/photos/markop/491027707/
53 | * http://www.flickr.com/photos/stevedave/3566325269/
54 | * http://www.flickr.com/photos/genista/127048347/
55 | * http://www.flickr.com/photos/wagner-machado-carlos-lemes/5540332691/
56 | * http://www.flickr.com/photos/29487767@N02/3438177701/
57 |
--------------------------------------------------------------------------------
/Example/Pods/RSSwizzle/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2013 Yan Rabovik
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is furnished
8 | to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in all
11 | copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
21 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-KZPlayground-KZPlayground/Pods-KZPlayground-KZPlayground-Private.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods-KZPlayground-KZPlayground.xcconfig"
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Build" "${PODS_ROOT}/Headers/Build/KZPlayground" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/KZPlayground" "${PODS_ROOT}/Headers/Public/NHBalancedFlowLayout" "${PODS_ROOT}/Headers/Public/RSSwizzle" "${PODS_ROOT}/Headers/Public/dyci"
4 | OTHER_LDFLAGS = -ObjC
5 | PODS_ROOT = ${SRCROOT}
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-KZPlayground-KZPlayground/Pods-KZPlayground-KZPlayground-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_KZPlayground_KZPlayground : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_KZPlayground_KZPlayground
5 | @end
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-KZPlayground-KZPlayground/Pods-KZPlayground-KZPlayground-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #endif
4 |
5 | #import "Pods-KZPlayground-environment.h"
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-KZPlayground-KZPlayground/Pods-KZPlayground-KZPlayground.xcconfig:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/krzysztofzablocki/Playgrounds/0b1494a04fed2cc7033f2a4f2113eef8b7f50b0f/Example/Pods/Target Support Files/Pods-KZPlayground-KZPlayground/Pods-KZPlayground-KZPlayground.xcconfig
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-KZPlayground-NHBalancedFlowLayout/Pods-KZPlayground-NHBalancedFlowLayout-Private.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods-KZPlayground-NHBalancedFlowLayout.xcconfig"
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Build" "${PODS_ROOT}/Headers/Build/NHBalancedFlowLayout" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/KZPlayground" "${PODS_ROOT}/Headers/Public/NHBalancedFlowLayout" "${PODS_ROOT}/Headers/Public/RSSwizzle" "${PODS_ROOT}/Headers/Public/dyci"
4 | OTHER_LDFLAGS = -ObjC
5 | PODS_ROOT = ${SRCROOT}
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-KZPlayground-NHBalancedFlowLayout/Pods-KZPlayground-NHBalancedFlowLayout-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_KZPlayground_NHBalancedFlowLayout : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_KZPlayground_NHBalancedFlowLayout
5 | @end
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-KZPlayground-NHBalancedFlowLayout/Pods-KZPlayground-NHBalancedFlowLayout-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #endif
4 |
5 | #import "Pods-KZPlayground-environment.h"
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-KZPlayground-NHBalancedFlowLayout/Pods-KZPlayground-NHBalancedFlowLayout.xcconfig:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/krzysztofzablocki/Playgrounds/0b1494a04fed2cc7033f2a4f2113eef8b7f50b0f/Example/Pods/Target Support Files/Pods-KZPlayground-NHBalancedFlowLayout/Pods-KZPlayground-NHBalancedFlowLayout.xcconfig
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-KZPlayground-RSSwizzle/Pods-KZPlayground-RSSwizzle-Private.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods-KZPlayground-RSSwizzle.xcconfig"
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Build" "${PODS_ROOT}/Headers/Build/RSSwizzle" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/KZPlayground" "${PODS_ROOT}/Headers/Public/NHBalancedFlowLayout" "${PODS_ROOT}/Headers/Public/RSSwizzle" "${PODS_ROOT}/Headers/Public/dyci"
4 | OTHER_LDFLAGS = ${PODS_KZPLAYGROUND_RSSWIZZLE_OTHER_LDFLAGS} -ObjC
5 | PODS_ROOT = ${SRCROOT}
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-KZPlayground-RSSwizzle/Pods-KZPlayground-RSSwizzle-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_KZPlayground_RSSwizzle : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_KZPlayground_RSSwizzle
5 | @end
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-KZPlayground-RSSwizzle/Pods-KZPlayground-RSSwizzle-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #endif
4 |
5 | #import "Pods-KZPlayground-environment.h"
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-KZPlayground-RSSwizzle/Pods-KZPlayground-RSSwizzle.xcconfig:
--------------------------------------------------------------------------------
1 | PODS_KZPLAYGROUND_RSSWIZZLE_OTHER_LDFLAGS = -framework "Foundation"
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-KZPlayground-dyci/Pods-KZPlayground-dyci-Private.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods-KZPlayground-dyci.xcconfig"
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Build" "${PODS_ROOT}/Headers/Build/dyci" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/KZPlayground" "${PODS_ROOT}/Headers/Public/NHBalancedFlowLayout" "${PODS_ROOT}/Headers/Public/RSSwizzle" "${PODS_ROOT}/Headers/Public/dyci"
4 | OTHER_LDFLAGS = -ObjC
5 | PODS_ROOT = ${SRCROOT}
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-KZPlayground-dyci/Pods-KZPlayground-dyci-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_KZPlayground_dyci : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_KZPlayground_dyci
5 | @end
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-KZPlayground-dyci/Pods-KZPlayground-dyci-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #endif
4 |
5 | #import "Pods-KZPlayground-environment.h"
6 |
7 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-KZPlayground-dyci/Pods-KZPlayground-dyci.xcconfig:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/krzysztofzablocki/Playgrounds/0b1494a04fed2cc7033f2a4f2113eef8b7f50b0f/Example/Pods/Target Support Files/Pods-KZPlayground-dyci/Pods-KZPlayground-dyci.xcconfig
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-KZPlayground/Pods-KZPlayground-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_KZPlayground : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_KZPlayground
5 | @end
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-KZPlayground/Pods-KZPlayground-environment.h:
--------------------------------------------------------------------------------
1 |
2 | // To check if a library is compiled with CocoaPods you
3 | // can use the `COCOAPODS` macro definition which is
4 | // defined in the xcconfigs so it is available in
5 | // headers also when they are imported in the client
6 | // project.
7 |
8 |
9 | // KZPlayground
10 | #define COCOAPODS_POD_AVAILABLE_KZPlayground
11 | #define COCOAPODS_VERSION_MAJOR_KZPlayground 0
12 | #define COCOAPODS_VERSION_MINOR_KZPlayground 3
13 | #define COCOAPODS_VERSION_PATCH_KZPlayground 1
14 |
15 | // NHBalancedFlowLayout
16 | #define COCOAPODS_POD_AVAILABLE_NHBalancedFlowLayout
17 | #define COCOAPODS_VERSION_MAJOR_NHBalancedFlowLayout 0
18 | #define COCOAPODS_VERSION_MINOR_NHBalancedFlowLayout 2
19 | #define COCOAPODS_VERSION_PATCH_NHBalancedFlowLayout 0
20 |
21 | // RSSwizzle
22 | #define COCOAPODS_POD_AVAILABLE_RSSwizzle
23 | #define COCOAPODS_VERSION_MAJOR_RSSwizzle 0
24 | #define COCOAPODS_VERSION_MINOR_RSSwizzle 1
25 | #define COCOAPODS_VERSION_PATCH_RSSwizzle 0
26 |
27 | // dyci
28 | #define COCOAPODS_POD_AVAILABLE_dyci
29 | // This library does not follow semantic-versioning,
30 | // so we were not able to define version macros.
31 | // Please contact the author.
32 | // Version: 0.1.5.6.
33 |
34 | // dyci/Injections
35 | #define COCOAPODS_POD_AVAILABLE_dyci_Injections
36 | // This library does not follow semantic-versioning,
37 | // so we were not able to define version macros.
38 | // Please contact the author.
39 | // Version: 0.1.5.6.
40 |
41 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-KZPlayground/Pods-KZPlayground-resources.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
5 |
6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
7 | > "$RESOURCES_TO_COPY"
8 |
9 | install_resource()
10 | {
11 | case $1 in
12 | *.storyboard)
13 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
14 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
15 | ;;
16 | *.xib)
17 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
18 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
19 | ;;
20 | *.framework)
21 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
22 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
23 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
24 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
25 | ;;
26 | *.xcdatamodel)
27 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\""
28 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom"
29 | ;;
30 | *.xcdatamodeld)
31 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\""
32 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd"
33 | ;;
34 | *.xcassets)
35 | ;;
36 | /*)
37 | echo "$1"
38 | echo "$1" >> "$RESOURCES_TO_COPY"
39 | ;;
40 | *)
41 | echo "${PODS_ROOT}/$1"
42 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY"
43 | ;;
44 | esac
45 | }
46 | install_resource "../../Pod/Assets/KZPPresenterInfoViewController.xib"
47 | install_resource "../../Pod/Assets/Main.storyboard"
48 |
49 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
50 | if [[ "${ACTION}" == "install" ]]; then
51 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
52 | fi
53 | rm -f "$RESOURCES_TO_COPY"
54 |
55 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ `find . -name '*.xcassets' | wc -l` -ne 0 ]
56 | then
57 | case "${TARGETED_DEVICE_FAMILY}" in
58 | 1,2)
59 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
60 | ;;
61 | 1)
62 | TARGET_DEVICE_ARGS="--target-device iphone"
63 | ;;
64 | 2)
65 | TARGET_DEVICE_ARGS="--target-device ipad"
66 | ;;
67 | *)
68 | TARGET_DEVICE_ARGS="--target-device mac"
69 | ;;
70 | esac
71 | find "${PWD}" -name "*.xcassets" -print0 | xargs -0 actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
72 | fi
73 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-KZPlayground/Pods-KZPlayground.debug.xcconfig:
--------------------------------------------------------------------------------
1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/KZPlayground" "${PODS_ROOT}/Headers/Public/NHBalancedFlowLayout" "${PODS_ROOT}/Headers/Public/RSSwizzle" "${PODS_ROOT}/Headers/Public/dyci"
3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/KZPlayground" -isystem "${PODS_ROOT}/Headers/Public/NHBalancedFlowLayout" -isystem "${PODS_ROOT}/Headers/Public/RSSwizzle" -isystem "${PODS_ROOT}/Headers/Public/dyci"
4 | OTHER_LDFLAGS = -ObjC -l"Pods-KZPlayground-KZPlayground" -l"Pods-KZPlayground-NHBalancedFlowLayout" -l"Pods-KZPlayground-RSSwizzle" -l"Pods-KZPlayground-dyci" -framework "Foundation"
5 | OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS)
6 | PODS_ROOT = ${SRCROOT}/Pods
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-KZPlayground/Pods-KZPlayground.release.xcconfig:
--------------------------------------------------------------------------------
1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/KZPlayground" "${PODS_ROOT}/Headers/Public/NHBalancedFlowLayout" "${PODS_ROOT}/Headers/Public/RSSwizzle" "${PODS_ROOT}/Headers/Public/dyci"
3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/KZPlayground" -isystem "${PODS_ROOT}/Headers/Public/NHBalancedFlowLayout" -isystem "${PODS_ROOT}/Headers/Public/RSSwizzle" -isystem "${PODS_ROOT}/Headers/Public/dyci"
4 | OTHER_LDFLAGS = -ObjC -l"Pods-KZPlayground-KZPlayground" -l"Pods-KZPlayground-NHBalancedFlowLayout" -l"Pods-KZPlayground-RSSwizzle" -l"Pods-KZPlayground-dyci" -framework "Foundation"
5 | OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS)
6 | PODS_ROOT = ${SRCROOT}/Pods
--------------------------------------------------------------------------------
/Example/Pods/dyci/Dynamic Code Injection/dyci/Classes/Categories/NSSet+ClassesList.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSSet+ClassesList(Classes)
3 | // Dynamic Code Injection
4 | //
5 | // Created by Paul Taykalo on 10/21/12.
6 | // Copyright (c) 2012 Stanfy LLC. All rights reserved.
7 | //
8 | #import
9 |
10 |
11 | #if TARGET_IPHONE_SIMULATOR
12 |
13 | @interface NSSet (ClassesList)
14 |
15 | /*
16 | Returns set of currently registered classes, wrapped with NSValue
17 | */
18 | + (NSMutableSet *)currentClassesSet;
19 |
20 |
21 | @end
22 |
23 | #endif
--------------------------------------------------------------------------------
/Example/Pods/dyci/Dynamic Code Injection/dyci/Classes/Categories/NSSet+ClassesList.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSSet+ClassesList(Classes)
3 | // Dynamic Code Injection
4 | //
5 | // Created by Paul Taykalo on 10/21/12.
6 | // Copyright (c) 2012 Stanfy LLC. All rights reserved.
7 | //
8 | #import
9 | #import "NSSet+ClassesList.h"
10 |
11 |
12 | #if TARGET_IPHONE_SIMULATOR
13 |
14 | @implementation NSSet (ClassesList)
15 |
16 | + (NSMutableSet *)currentClassesSet {
17 | NSMutableSet * classesSet = [NSMutableSet set];
18 |
19 | int classesCount = objc_getClassList(NULL, 0);
20 | Class * classes = NULL;
21 | if (classesCount > 0) {
22 | classes = (Class *) malloc(sizeof(Class) * classesCount);
23 | classesCount = objc_getClassList(classes, classesCount);
24 | for (int i = 0; i < classesCount; ++i) {
25 | NSValue * wrappedClass = [NSValue value:&classes[i] withObjCType:@encode(Class)];
26 | [classesSet addObject:wrappedClass];
27 | }
28 | free(classes);
29 | }
30 | return classesSet;
31 | }
32 |
33 | @end
34 |
35 | #endif
--------------------------------------------------------------------------------
/Example/Pods/dyci/Dynamic Code Injection/dyci/Classes/FileWatcher/SFFileWatcher.h:
--------------------------------------------------------------------------------
1 | //
2 | // SFFileWatcher.h
3 | // Dynamic Code Injection
4 | //
5 | // Created by adenisov on 16.10.12.
6 | // Copyright (c) 2012 Stanfy. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "SFFileWatcherDelegate.h"
11 |
12 | #if TARGET_IPHONE_SIMULATOR
13 |
14 | /*
15 | File watcher object.
16 | Watching for changes on the specified path
17 | */
18 | @interface SFFileWatcher : NSObject
19 |
20 | /*
21 | Path on which current watcher is watching
22 | */
23 | @property(nonatomic, readonly) NSString * watchingPath;
24 |
25 | /*
26 | Delegate that will be notified each time, as something changed
27 | */
28 | @property(nonatomic, assign) id delegate;
29 |
30 | /*
31 | Designated initializer
32 | Starts watching on specified path and with specified delegate
33 | */
34 | - (id)initWithFilePath:(NSString *)watchingFilePath delegate:(id)delegate;
35 | + (id)fileWatcherWithPath:(NSString *)watchingFilePath delegate:(id)delegate;
36 |
37 |
38 | @end
39 |
40 | #endif
--------------------------------------------------------------------------------
/Example/Pods/dyci/Dynamic Code Injection/dyci/Classes/FileWatcher/SFFileWatcher.m:
--------------------------------------------------------------------------------
1 | //
2 | // SFFileWatcher.m
3 | // Dynamic Code Injection
4 | //
5 | // Created by adenisov on 16.10.12.
6 | // Copyright (c) 2012 Stanfy. All rights reserved.
7 | //
8 |
9 | #import "SFFileWatcher.h"
10 |
11 | #if TARGET_IPHONE_SIMULATOR
12 |
13 | @implementation SFFileWatcher {
14 |
15 | /*
16 | Date on what last changes was loaded
17 | */
18 | NSDate *_lastLoadDate;
19 |
20 | /*
21 | Dispatching queue in which file watching operations will be performed
22 | */
23 | dispatch_queue_t _queue;
24 |
25 | /*
26 | Dispatch source of file changes notifications
27 | */
28 | dispatch_source_t _source;
29 | }
30 |
31 |
32 | + (id)fileWatcherWithPath:(NSString *)watchDirectory delegate:(id)delegate {
33 | return [[SFFileWatcher alloc] initWithFilePath:watchDirectory delegate:delegate];
34 | }
35 |
36 |
37 | - (id)initWithFilePath:(NSString *)watchingFilePath delegate:(id)delegate {
38 | self = [super init];
39 | if (self) {
40 | _watchingPath = watchingFilePath;
41 | _delegate = delegate;
42 | _lastLoadDate = [NSDate date];
43 |
44 | [self setupHandlerOnFileChange:_watchingPath];
45 |
46 | }
47 |
48 | return self;
49 |
50 | }
51 |
52 |
53 | - (void)setupHandlerOnFileChange:(NSString *)filePath {
54 |
55 | // Resolving file descriptor
56 | uintptr_t fd = (uintptr_t) open([filePath cStringUsingEncoding:NSUTF8StringEncoding], O_EVTONLY);
57 |
58 | // Setting up queued and source of dispatch events
59 | _queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
60 | _source = dispatch_source_create(DISPATCH_SOURCE_TYPE_VNODE,
61 | (uintptr_t) fd,
62 | DISPATCH_VNODE_WRITE,
63 | _queue);
64 |
65 | __block id weakSelf = self;
66 | dispatch_source_set_event_handler(_source, ^{
67 | dispatch_async(dispatch_get_main_queue(), ^{
68 | [weakSelf checkForFileCreationDate];
69 | });
70 | });
71 |
72 | dispatch_source_set_cancel_handler(_source, ^{
73 | close(fd);
74 | });
75 |
76 | dispatch_resume(_source);
77 | }
78 |
79 |
80 | - (void)checkForFileCreationDate {
81 | NSFileManager * fm = [NSFileManager defaultManager];
82 |
83 | NSArray * files = [fm contentsOfDirectoryAtPath:_watchingPath error:nil];
84 |
85 | // Using the most recent file, but date should be >> _lastLoadData
86 |
87 | for (NSString * file in files) {
88 | NSString * filePath = [_watchingPath stringByAppendingPathComponent:file];
89 | NSDictionary * fileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:filePath error:nil];
90 | NSDate * fileCreationDate = [fileAttributes fileCreationDate];
91 |
92 | // If new file has bigger creation date, then, let's notify our delegate about it
93 | NSTimeInterval diff = [_lastLoadDate timeIntervalSinceDate:fileCreationDate];
94 | if (diff < 0) {
95 | [self.delegate newFileWasFoundAtPath:filePath];
96 | _lastLoadDate = fileCreationDate;
97 | }
98 | }
99 | }
100 |
101 |
102 | @end
103 |
104 | #endif
--------------------------------------------------------------------------------
/Example/Pods/dyci/Dynamic Code Injection/dyci/Classes/FileWatcher/SFFileWatcherDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // SFFileWatcherDelegate.h
3 | // Dynamic Code Injection
4 | //
5 | // Created by adenisov on 16.10.12.
6 | // Copyright (c) 2012 Stanfy. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 |
12 | #if TARGET_IPHONE_SIMULATOR
13 |
14 | /*
15 | Object that get notified by SFFileWatcher, when some files are changed in the
16 | some directory
17 | */
18 | @protocol SFFileWatcherDelegate
19 |
20 | @optional
21 |
22 | /*
23 | This method will be called each time, when something changes in watching directory
24 | */
25 | - (void)newFileWasFoundAtPath:(NSString *)filePath;
26 |
27 | @end
28 |
29 | #endif
30 |
--------------------------------------------------------------------------------
/Example/Pods/dyci/Dynamic Code Injection/dyci/Classes/Injections/NSObject+DyCInjection.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSObject+DyCInjection(DCInjection)
3 | // Dynamic Code Injection
4 | //
5 | // Created by Paul Taykalo on 10/21/12.
6 | // Copyright (c) 2012 Stanfy LLC. All rights reserved.
7 | //
8 | #import
9 |
10 | #if TARGET_IPHONE_SIMULATOR
11 |
12 | /*
13 | Methods that will be called on object, that are waiting for injection
14 | */
15 | @interface NSObject (DyCInjection)
16 |
17 |
18 | + (void)allowInjectionSubscriptionOnInitMethod;
19 |
20 | /*
21 | This method will be called in order to determine,
22 | do we need to subscribe to Injection notifications, or not
23 |
24 | By default all objects that have prefixes:
25 | _
26 | NS
27 | CF
28 | Web
29 | UI
30 | DOM
31 | SFInj
32 | OS_
33 |
34 | are skipped
35 |
36 | This behaviour can be changed in next releases
37 | */
38 | + (BOOL)shouldPerformRuntimeCodeInjectionOnObject:(id)instance;
39 |
40 |
41 |
42 | /*
43 | Will be called, when some class (X) will be injected in application runtime
44 | On All instances of class X, and instances of subclasses of X, this method will be called
45 | */
46 | - (void)updateOnClassInjection;
47 |
48 | /*
49 | This method will be called for all classes, that are waiting for resources changes.
50 | Before this method is called, Image cache is flushed, so you don't have to call memory warnings
51 | Resource that was injected is passed with parameter. But in general, you don't need to care
52 |
53 | */
54 | - (void)updateOnResourceInjection:(NSString *)resourcePath;
55 |
56 |
57 | @end
58 |
59 | #endif
--------------------------------------------------------------------------------
/Example/Pods/dyci/Dynamic Code Injection/dyci/Classes/Injections/NSObject+DyCInjection.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSObject+DyCInjection(DCInjection)
3 | // Dynamic Code Injection
4 | //
5 | // Created by Paul Taykalo on 10/21/12.
6 | // Copyright (c) 2012 Stanfy LLC. All rights reserved.
7 | //
8 |
9 | #if TARGET_IPHONE_SIMULATOR
10 |
11 | #import
12 | #import "NSObject+DyCInjection.h"
13 | //#import "SFDynamicCodeInjection.h"
14 | #import "SFInjectionsNotificationsCenter.h"
15 |
16 |
17 | void swizzle(Class c, SEL orig, SEL new) {
18 | Method origMethod = class_getInstanceMethod(c, orig);
19 | Method newMethod = class_getInstanceMethod(c, new);
20 | if (class_addMethod(c, orig, method_getImplementation(newMethod), method_getTypeEncoding(newMethod))) {
21 | class_replaceMethod(c, new, method_getImplementation(origMethod), method_getTypeEncoding(origMethod));
22 | } else {
23 | method_exchangeImplementations(origMethod, newMethod);
24 | }
25 | }
26 |
27 |
28 | @interface NSObject (DyCInjectionObserver)
29 |
30 | @end
31 |
32 |
33 | @implementation NSObject (DyCInjection)
34 |
35 | #pragma mark - Swizzling
36 |
37 | + (void)allowInjectionSubscriptionOnInitMethod {
38 | swizzle([NSObject class], @selector(init), @selector(_swizzledInit));
39 | swizzle([NSObject class], NSSelectorFromString(@"dealloc"), @selector(_swizzledDealloc));
40 |
41 | // Storyboard support
42 | swizzle(NSClassFromString(@"UINib"), @selector(instantiateWithOwner:options:), @selector(_swizzledInstantiateWithOwner:options:));
43 | }
44 |
45 |
46 | #pragma mark - Subscription check
47 |
48 | + (BOOL)shouldPerformRuntimeCodeInjectionOnObject:(__unsafe_unretained id)instance {
49 | if (!instance) {
50 | return NO;
51 | }
52 |
53 | #warning We should skip more than just NS, CF, and private classes
54 | char const * className = object_getClassName(instance);
55 |
56 | switch (className[0]) {
57 | case '_':
58 | return NO;
59 | case 'N':
60 | if (className[1] == 'S') {
61 | return NO;
62 | }
63 | break;
64 | case 'C':
65 | if (className[1] == 'A' ||
66 | className[1] == 'F' ) {
67 | return NO;
68 | }
69 | break;
70 | case 'U':
71 | if (className[1] == 'I') {
72 | // Allowing to inject UIViewControllers
73 | if (strcmp(className, "UIViewController") == 0) {
74 | return YES;
75 | }
76 | if (strcmp(className, "UITableViewController") == 0) {
77 | return YES;
78 | }
79 | return NO;
80 | }
81 | break;
82 | case 'W':
83 | if (className[1] == 'e' && className[2] == 'b') {
84 | return NO;
85 | }
86 | break;
87 | case 'D':
88 | if (className[1] == 'O' && className[2] == 'M') {
89 | return NO;
90 | }
91 | break;
92 | case 'S':
93 | if (className[1] == 'F' && className[2] == 'I' && className[3] == 'n' && className[4] == 'j') {
94 | return NO;
95 | }
96 | break;
97 | case 'O':
98 | if (className[1] == 'S' && className[2] == '_') {
99 | return NO;
100 | }
101 | break;
102 |
103 | default:
104 | break;
105 | }
106 |
107 | // Disable injection on NSManagedObject object classes
108 | // They have slightly different lifecycle...
109 | Class clz = NSClassFromString(@"NSManagedObject");
110 | if (clz && [instance isKindOfClass:clz]) {
111 | return NO;
112 | }
113 |
114 | return YES;
115 | }
116 |
117 | #pragma mark - On Injection methods
118 |
119 | - (void)updateOnClassInjection {
120 |
121 | }
122 |
123 |
124 | - (void)updateOnResourceInjection:(NSString *)resourcePath {
125 |
126 | }
127 |
128 |
129 | #pragma mark - Swizzled methods
130 |
131 | - (id)_swizzledInit {
132 |
133 | // Calling previous init
134 |
135 | id result = self;
136 | result = [result _swizzledInit];
137 |
138 | if (result) {
139 |
140 | // In case, if we are in need to inject
141 | if ([NSObject shouldPerformRuntimeCodeInjectionOnObject:result]) {
142 | SFInjectionsNotificationsCenter * notificationCenter = [SFInjectionsNotificationsCenter sharedInstance];
143 | [notificationCenter addObserver:result];
144 | }
145 |
146 | }
147 | return result;
148 | }
149 |
150 | - (void)_swizzledDealloc {
151 |
152 | if ([NSObject shouldPerformRuntimeCodeInjectionOnObject:self]) {
153 | [[SFInjectionsNotificationsCenter sharedInstance] removeObserver:self];
154 | }
155 |
156 | // Swizzled methods are fun
157 | // Calling previous dealloc implementation
158 | [self _swizzledDealloc];
159 |
160 | }
161 |
162 | @end
163 |
164 | #endif
165 |
--------------------------------------------------------------------------------
/Example/Pods/dyci/Dynamic Code Injection/dyci/Classes/Injections/UINib+StoryBoardSupport.h:
--------------------------------------------------------------------------------
1 | //
2 | // UINib(StoryBoardSupport)
3 | // dyci
4 | //
5 | // Created by Paul Taykalo on 5/27/13.
6 | // Copyright (c) 2012 Stanfy LLC. All rights reserved.
7 | //
8 | #import
9 | #import
10 |
11 |
12 | #if TARGET_IPHONE_SIMULATOR
13 |
14 | /*
15 | It seems that storyboard passing some options, when instantiating the nibs
16 | So, we would save those, and reuse after injections
17 | */
18 | @interface UINib (StoryBoardSupport)
19 |
20 |
21 | /*
22 | Returns options, saved for the owner
23 | */
24 | + (NSDictionary *)optionsByOwner:(id)owner;
25 |
26 | @end
27 |
28 | #endif
--------------------------------------------------------------------------------
/Example/Pods/dyci/Dynamic Code Injection/dyci/Classes/Injections/UINib+StoryBoardSupport.m:
--------------------------------------------------------------------------------
1 | //
2 | // UINib(StoryBoardSupport)
3 | // dyci
4 | //
5 | // Created by Paul Taykalo on 5/27/13.
6 | // Copyright (c) 2012 Stanfy LLC. All rights reserved.
7 | //
8 | #import "UINib+StoryBoardSupport.h"
9 |
10 | #if TARGET_IPHONE_SIMULATOR
11 |
12 |
13 | @implementation UINib (StoryBoardSupport)
14 |
15 | static NSMutableDictionary * cachedOptions;
16 |
17 | - (NSArray *)_swizzledInstantiateWithOwner:(id)owner options:(NSDictionary *)options {
18 |
19 | //
20 | if (!cachedOptions) {
21 | cachedOptions = [[NSMutableDictionary alloc] init];
22 | }
23 |
24 | // Saving options per owner (View Controller address)
25 | if ( owner && options) {
26 | [cachedOptions setObject:options forKey:[NSString stringWithFormat:@"%0x", owner]];
27 | }
28 |
29 | NSArray *items = [self _swizzledInstantiateWithOwner:owner options:options];
30 | return items;
31 | }
32 |
33 |
34 | + (NSDictionary *)optionsByOwner:(id)owner {
35 | NSString * optionsKey = [NSString stringWithFormat:@"%0x", owner];
36 | return cachedOptions[optionsKey];
37 | }
38 |
39 |
40 | @end
41 |
42 | #endif
--------------------------------------------------------------------------------
/Example/Pods/dyci/Dynamic Code Injection/dyci/Classes/Injections/UIViewController+XIBSupport.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIViewController+XIBSupport.h
3 | // Dynamic Code Ibjection
4 | //
5 | // Created by Paul Taykalo on 11/30/12.
6 | // Copyright (c) 2012 Stanfy. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 |
12 | #if TARGET_IPHONE_SIMULATOR
13 |
14 | /*
15 | This category allows Xibs to be injected in runtime
16 | */
17 | @interface UIViewController (XIBSupport)
18 |
19 | /*
20 | Overriden updateOnResource Injection
21 | this method will check, if injected path is same as our xib,
22 | And will reinitialize xib with new nib instance
23 |
24 | This functionality is experimental. So, in case if it isn't working,
25 | describe the steps, and setup and issue on the Github
26 | https://github.com/DyCI/dyci-main/issues?sort=updated&state=open
27 | */
28 | - (void)updateOnResourceInjection:(NSString *)path;
29 |
30 | @end
31 |
32 | #endif
33 |
--------------------------------------------------------------------------------
/Example/Pods/dyci/Dynamic Code Injection/dyci/Classes/Notifications/SFInjectionsNotificationsCenter.h:
--------------------------------------------------------------------------------
1 | //
2 | // SFInjectionsNotificationsCenter.h
3 | // dyci-framework
4 | //
5 | // Created by Paul Taykalo on 6/1/13.
6 | // Copyright (c) 2013 Stanfy. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | #if TARGET_IPHONE_SIMULATOR
12 |
13 | @protocol SFInjectionObserver
14 |
15 | /*
16 | Will be called, when some class (X) will be injected in application runtime
17 | On All instances of class X, and instances of subclasses of X, this method will be called
18 | */
19 | - (void)updateOnClassInjection;
20 |
21 | /*
22 | This method will be called for all classes, that are waiting for resources changes.
23 | Before this method is called, Image cache is flushed, so you don't have to call memory warnings
24 | Resource that was injected is passed with parameter. But in general, you don't need to care
25 | */
26 | - (void)updateOnResourceInjection:(NSString *)resourcePath;
27 |
28 | @end
29 |
30 |
31 | /*
32 | This notification center will notify classes about new infection code available
33 | Live classes about new code
34 | This one was made because it seems sometimes classes doesn't remove themself as observers from
35 | Notification Center. And we'll try to understand why it's so
36 |
37 | Also it'll try to understand which classes should be filtered from observing
38 | */
39 | @interface SFInjectionsNotificationsCenter : NSObject
40 |
41 | /*
42 | Returns notification center instance
43 | */
44 | + (instancetype)sharedInstance;
45 |
46 | - (void)addObserver:(id)observer;
47 | - (void)removeObserver:(id)observer;
48 |
49 | /*
50 | This will notify about class injection
51 | */
52 | - (void)notifyOnClassInjection:(Class)class;
53 |
54 | /*
55 | This will notiy all registered classes about that some resource was injected
56 | */
57 | - (void)notifyOnResourceInjection:(NSString *)resourceInjection;
58 |
59 | @end
60 |
61 | #endif
--------------------------------------------------------------------------------
/Example/Pods/dyci/Dynamic Code Injection/dyci/Classes/Notifications/SFInjectionsNotificationsCenter.m:
--------------------------------------------------------------------------------
1 | //
2 | // SFInjectionsNotificationsCenter.m
3 | // dyci-framework
4 | //
5 | // Created by Paul Taykalo on 6/1/13.
6 | // Copyright (c) 2013 Stanfy. All rights reserved.
7 | //
8 |
9 | #import "SFInjectionsNotificationsCenter.h"
10 |
11 | #if TARGET_IPHONE_SIMULATOR
12 |
13 | @implementation SFInjectionsNotificationsCenter {
14 | NSMutableDictionary * _observers;
15 | }
16 |
17 |
18 | + (instancetype)sharedInstance {
19 | static SFInjectionsNotificationsCenter * _instance = nil;
20 | if (!_instance) {
21 | _instance = [[self alloc] init];
22 | _instance->_observers = [NSMutableDictionary dictionary];
23 | }
24 | return _instance;
25 | }
26 |
27 |
28 | - (void)addObserver:(id)observer {
29 | [self addObserver:observer forClass:[observer class]];
30 | }
31 |
32 |
33 | - (void)removeObserver:(id)observer {
34 | [self removeObserver:observer ofClass:[observer class]];
35 | }
36 |
37 |
38 | - (void)removeObserver:(id)observer ofClass:(Class)class {
39 | @synchronized (_observers) {
40 | NSMutableSet * observersPerClass = [_observers objectForKey:class];
41 | if (observersPerClass) {
42 | @synchronized (observersPerClass) {
43 | [observersPerClass removeObject:observer];
44 | }
45 | }
46 | }
47 | }
48 |
49 |
50 | - (void)addObserver:(id)observer forClass:(Class)class {
51 | if (!class) {
52 | return;
53 | }
54 | @synchronized (_observers) {
55 | NSMutableSet * observersPerClass = [_observers objectForKey:class];
56 | if (!observersPerClass) {
57 | observersPerClass = (__bridge_transfer NSMutableSet *) CFSetCreateMutable(nil, 0, nil);
58 | [_observers setObject:observersPerClass forKey:class];
59 | }
60 | @synchronized (observersPerClass) {
61 | [observersPerClass addObject:observer];
62 | }
63 | }
64 | }
65 |
66 |
67 | /*
68 | This will notify about class injection
69 | */
70 | - (void)notifyOnClassInjection:(Class)injectedClass {
71 | int idx = 0;
72 | @synchronized (_observers) {
73 | for (NSMutableSet * observersPerClass in [_observers allValues]) {
74 | @synchronized (observersPerClass) {
75 | id anyObject = [observersPerClass anyObject];
76 | int localIdx = 0;
77 | if ([anyObject isKindOfClass:injectedClass]) {
78 | for (id observer in observersPerClass) {
79 | [observer updateOnClassInjection];
80 | idx++;
81 | localIdx++;
82 | }
83 | NSLog(@"%d (%@) class instanses were notified on Class Injection : ", localIdx, NSStringFromClass([anyObject class]));
84 | }
85 | }
86 | }
87 | }
88 |
89 | NSLog(@"%d instanses were notified on Class Injection by injecting class: (%@)", idx, NSStringFromClass(injectedClass));
90 | }
91 |
92 |
93 | /*
94 | This will notiy all registered classes about that some resource was injected
95 | */
96 | - (void)notifyOnResourceInjection:(NSString *)resourceInjection {
97 | int idx = 0;
98 | @synchronized (_observers) {
99 | for (NSMutableSet * observersPerClass in [_observers allValues]) {
100 | @synchronized (observersPerClass) {
101 | for (id observer in observersPerClass) {
102 | [observer updateOnResourceInjection:resourceInjection];
103 | idx++;
104 | }
105 | }
106 | }
107 | }
108 | NSLog(@"%d classes instanses were notified on REsource Injection", idx);
109 | }
110 |
111 |
112 | @end
113 |
114 |
115 | #endif
--------------------------------------------------------------------------------
/Example/Pods/dyci/Dynamic Code Injection/dyci/Classes/SFDynamicCodeInjection.h:
--------------------------------------------------------------------------------
1 | //
2 | // SFDynamicCodeInjection
3 | // Nemlig-iPad
4 | //
5 | // Created by Paul Taykalo on 10/7/12.
6 | // Copyright (c) 2012 Stanfy LLC. All rights reserved.
7 | //
8 | #import
9 |
10 | @interface SFDynamicCodeInjection : NSObject
11 |
12 | /*
13 | Enables dynamic runtime
14 | */
15 | + (void)enable;
16 |
17 | /*
18 | Disables dynamic runtime
19 | */
20 | + (void)disable;
21 |
22 |
23 | @end
--------------------------------------------------------------------------------
/Example/Pods/dyci/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 Stanfy LLC
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.
--------------------------------------------------------------------------------
/Example/Pods/dyci/README.md:
--------------------------------------------------------------------------------
1 | # WARNING
2 | **Please, Read this.**
3 | Uninstall dyci before updating Xcode.
4 | In other case, you'll need to reinstall it :(
5 | We're currenlty working on [this issue](https://github.com/DyCI/dyci-main/issues/8)...
6 | If you've already expirienced this issue - remove and reinstall Xcode.
7 |
8 | # dyci
9 | Dynamic code injection tool.
10 | Allows you to inject your code into running iOS application, whithout restarting it.
11 |
12 | ## Installation
13 | If you already know, what this tool is about, you can move to [Installation page](https://github.com/DyCI/dyci-main/wiki/Installation)
14 |
15 | ## Adding to your project
16 | After installation, you need to add dyci library to your project
17 | If you are using [CocoaPods](https://github.com/CocoaPods/CocoaPods), then, just add this line to your PodFile
18 |
19 | `pod 'dyci', :git => 'https://github.com/DyCI/dyci-main.git'`
20 |
21 | If not, then, you can add dyci in [other ways](https://github.com/DyCI/dyci-main/wiki/Using-dyci)
22 |
23 | ## Reasons, why do you need this tool
24 | * It's good for applying small logic changes
25 | * It's good for quick small fixes on big projects.
26 | * It's good for debugging purposes. Remember, you can inject any code at runtime. Logging is the code also.
27 |
28 | ## Differences from other tools
29 | * You need minimum moves to enable dyci
30 | * You aren't writing some kind of script, you are writing your code!
31 | * You don't need to prepare/modify/lock your code for dyci
32 | * Your changes are always saved (They will not be discarded on next run)
33 |
34 | ## How it works
35 | If you curious about How [how it works](https://github.com/DyCI/dyci-main/wiki/How-it-Works), you can read about it in [wiki](https://github.com/DyCI/dyci-main/wiki/How-it-Works).
36 |
37 | ##Example
38 | There's one example in sources
39 | There's video about Tic-Tac-Toe game creation without project restart
40 | [Video at Youtube](https://www.youtube.com/watch?v=8nyEpAqUug4)
41 |
42 |
43 | ##Some points of view
44 | 1. Dyci is not about loading new code in application.
45 | 2. Dyci is about speeding up development.
46 | 3. Each time, you are using dyci, it saves your time.
47 |
48 |
49 | ##WARNING
50 | Please, do not use this tool in your real applications, that you about to publish in App Store. Dyci won't work on devices by default. It was made for purpose. Dynamic code injection is good for development, but it will leave huge security hole if you put it in your application. Please, do not :) I warned you.
51 |
52 | #FAQ
53 | If you have some questions, before asking them , make sure that they aren't listed [here](https://github.com/DyCI/dyci-main/wiki/FAQ)
54 |
55 |
56 |
--------------------------------------------------------------------------------
/Funding.yml:
--------------------------------------------------------------------------------
1 | custom: https://www.merowing.info/membership
2 | github: krzysztofzablocki
3 |
--------------------------------------------------------------------------------
/KZPlayground.podspec:
--------------------------------------------------------------------------------
1 | Pod::Spec.new do |s|
2 | s.name = "KZPlayground"
3 | s.version = "0.5.0"
4 | s.summary = "Playgrounds but for Objective-C, with some extra coolness."
5 | s.description = <<-DESC
6 | We all love Swift playgrounds, they are really great,
7 | but since most of us still write Objective-C code, why not get benefits of rapid development with Objective-C Plagrounds?
8 | Fast robust interations make it easy to prototype custom UI/Algorithms or even learn Objective-C or some new API.
9 | DESC
10 | s.homepage = "https://github.com/krzysztofzablocki/KZPlayground"
11 | s.license = 'MIT'
12 | s.author = { "Krzysztof Zablocki" => "krzysztof.zablocki@me.com" }
13 | s.source = { :git => "https://github.com/krzysztofzablocki/KZPlayground.git", :tag => s.version.to_s }
14 | s.social_media_url = 'https://twitter.com/merowing_'
15 |
16 | s.platform = :ios, '7.0'
17 | s.requires_arc = true
18 |
19 | s.source_files = 'Pod/Classes/**/*.h', 'Pod/Classes/**/*.m'
20 | s.resources = ['Pod/Assets/*']
21 |
22 | s.dependency 'dyci', '~> 0.1.5.6'
23 | s.dependency 'RSSwizzle', '~> 0.1.0'
24 | s.dependency 'NHBalancedFlowLayout', '~> 0.2'
25 |
26 | s.prepare_command = <<-'CMD'
27 | cat << EOF > ../../.kick
28 | recipe :ruby
29 | Kicker::Recipes::Ruby.runner_bin = 'bacon -q'
30 |
31 | process do |potential_files|
32 | files = potential_files.take_and_map do |file|
33 | if file =~ %r{^.*\.(m|xib|strings)$}
34 | execute("/usr/bin/python #{File.expand_path("~/.dyci/scripts/dyci-recompile.py")} '#{File.expand_path(file)}'")
35 | puts "KZPlayground: Recompiled #{file}"
36 | file
37 | end
38 | end
39 | end
40 |
41 | process do |remaining_files|
42 | remaining_files.take_and_map do |file|
43 | puts "KZPlayground: Ignored #{file}"
44 | file
45 | end
46 | end
47 |
48 | startup do
49 | log "KZPlayground: Watching for file changes!"
50 | end
51 | EOF
52 | CMD
53 | end
54 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2014 Krzysztof Zablocki
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | Redistribution in binary form is not permitted without specific prior written
14 | permission from the copyright holders.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/Pod/Assets/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/krzysztofzablocki/Playgrounds/0b1494a04fed2cc7033f2a4f2113eef8b7f50b0f/Pod/Assets/.gitkeep
--------------------------------------------------------------------------------
/Pod/Assets/KZPPresenterInfoViewController.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/Pod/Classes/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/krzysztofzablocki/Playgrounds/0b1494a04fed2cc7033f2a4f2113eef8b7f50b0f/Pod/Classes/.gitkeep
--------------------------------------------------------------------------------
/Pod/Classes/Components/Animation/KZPAnimatorComponent.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Krzysztof Zabłocki(http://twitter.com/merowing_) on 20/10/14.
3 | //
4 | //
5 | //
6 |
7 |
8 | @import Foundation;
9 | @import UIKit;
10 |
11 | #import "KZPComponent.h"
12 |
13 | // from - to - from - to
14 |
15 | extern void __attribute__((overloadable)) KZPAnimate(CGFloat from, CGFloat to, void (^block)(CGFloat));
16 |
17 | extern void __attribute__((overloadable)) KZPAnimate(float from, float to, void (^block)(float));
18 | extern void __attribute__((overloadable)) KZPAnimateAR(float from, float to, void (^block)(float));
19 |
20 | extern void __attribute__((overloadable)) KZPAnimate(void (^block)(void));
21 |
22 | #define KZPAnimateValue(name, from, to) __block CGFloat name = from; KZPAnimate(from, to, ^(CGFloat f) { name = f; });
23 | #define KZPAnimateValueAR(name, from, to) __block CGFloat name = from; KZPAnimate(0, M_PI, ^(CGFloat f) { name = sinf(f) * (to - from) + from; });
24 |
25 | #define KZPWhenChanged(value, completion) __block typeof(value) kzp_previous__##value = value; KZPAnimate(^{ if (kzp_previous__##value != value) { kzp_previous__##value = value; completion(value); }})
26 |
27 | @interface KZPAnimatorComponent : NSObject
28 | + (void)addAnimatorFromValue:(CGFloat)from toValue:(CGFloat)to withBlock:(void (^)(CGFloat))block;
29 | @end
30 |
--------------------------------------------------------------------------------
/Pod/Classes/Components/Animation/KZPAnimatorComponent.m:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Krzysztof Zabłocki(http://twitter.com/merowing_) on 20/10/14.
3 | //
4 | //
5 | //
6 |
7 | #import "KZPAnimatorComponent.h"
8 |
9 |
10 | void __attribute__((overloadable)) KZPAnimate(CGFloat from, CGFloat to, void (^block)(CGFloat)) {
11 | [KZPAnimatorComponent addAnimatorFromValue:from toValue:to withBlock:block];
12 | }
13 |
14 | void __attribute__((overloadable)) KZPAnimate(float from, float to, void (^block)(float)) {
15 | [KZPAnimatorComponent addAnimatorFromValue:from toValue:to withBlock:^(CGFloat v) { block(v); }];
16 | }
17 |
18 | void __attribute__((overloadable)) KZPAnimateAR(float from, float to, void (^block)(float)) {
19 | [KZPAnimatorComponent addAnimatorFromValue:from toValue:to withBlock:^(CGFloat v) {
20 | block(sinf(v) * (to - from) + from);
21 | }];
22 | }
23 |
24 | void __attribute__((overloadable)) KZPAnimate(void (^block)(void)) {
25 | [KZPAnimatorComponent addAnimatorFromValue:0 toValue:60 withBlock:^(CGFloat v) {
26 | block();
27 | }];
28 | }
29 |
30 | NSMutableArray *displayLinks = nil;
31 |
32 | @interface KZPAnimatorComponent ()
33 | @property(nonatomic, copy) void (^animationBlock)(CGFloat);
34 | @property(nonatomic, assign) CGFloat from;
35 | @property(nonatomic, assign) CGFloat to;
36 |
37 | @property(nonatomic, assign) CGFloat accumulator;
38 | @end
39 |
40 | @implementation KZPAnimatorComponent
41 |
42 | + (void)addAnimatorFromValue:(CGFloat)from toValue:(CGFloat)to withBlock:(void (^)(CGFloat))block
43 | {
44 | KZPAnimatorComponent *animation = [KZPAnimatorComponent new];
45 | animation.animationBlock = block;
46 | animation.from = from;
47 | animation.to = to;
48 |
49 | CADisplayLink *displayLink = [CADisplayLink displayLinkWithTarget:animation selector:@selector(animate:)];
50 | [displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
51 |
52 | if (!displayLinks) {
53 | displayLinks = [NSMutableArray new];
54 | }
55 | [displayLinks addObject:displayLink];
56 | }
57 |
58 | + (void)reset
59 | {
60 | [displayLinks enumerateObjectsUsingBlock:^(CADisplayLink *obj, NSUInteger idx, BOOL *stop) {
61 | [obj invalidate];
62 | }];
63 | [displayLinks removeAllObjects];
64 | }
65 |
66 | - (void)animate:(CADisplayLink *)displayLink
67 | {
68 | self.accumulator += displayLink.duration * fabsf(self.from - self.to) * 0.6;
69 | if (self.accumulator >= self.to) {
70 | self.accumulator = self.from;
71 | }
72 | self.animationBlock(self.accumulator);
73 | }
74 |
75 | - (void)setFrom:(CGFloat)from
76 | {
77 | _from = from;
78 | self.accumulator = _from;
79 | }
80 |
81 |
82 | @end
83 |
--------------------------------------------------------------------------------
/Pod/Classes/Components/Controls/Action/KZPActionComponent.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Krzysztof Zabłocki(http://twitter.com/merowing_) on 21/10/14.
3 | //
4 | //
5 | //
6 |
7 |
8 | @import Foundation;
9 |
10 | #import "KZPComponent.h"
11 |
12 | extern void __attribute__((overloadable)) KZPAction(NSString *name, void (^block)(void));
13 |
14 | @interface KZPActionComponent : NSObject
15 | + (void)addCallToActionWithName:(NSString *)name block:(void (^)())block;
16 | @end
--------------------------------------------------------------------------------
/Pod/Classes/Components/Controls/Action/KZPActionComponent.m:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Krzysztof Zabłocki(http://twitter.com/merowing_) on 21/10/14.
3 | //
4 | //
5 | //
6 |
7 |
8 | #import
9 | #import "KZPActionComponent.h"
10 | #import "KZPTimelineViewController.h"
11 |
12 | static const void *kActionBlockKey = &kActionBlockKey;
13 |
14 | void __attribute__((overloadable)) KZPAction(NSString *name, void (^block)(void)) {
15 | [KZPActionComponent addCallToActionWithName:name block:block];
16 | }
17 |
18 | @implementation KZPActionComponent
19 | + (void)addCallToActionWithName:(NSString *)name block:(void (^)())block
20 | {
21 | KZPTimelineViewController *timelineViewController = [KZPTimelineViewController sharedInstance];
22 |
23 | UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
24 | [button setTitle:name forState:UIControlStateNormal];
25 | [button setTitleColor:UIColor.brownColor forState:UIControlStateNormal];
26 | button.titleLabel.adjustsFontSizeToFitWidth = YES;
27 | CGSize size = [button sizeThatFits:CGSizeMake(timelineViewController.maxWidthForSnapshotView, CGFLOAT_MAX)];
28 | button.frame = CGRectMake(0, 0, size.width, size.height);
29 | objc_setAssociatedObject(button, kActionBlockKey, block, OBJC_ASSOCIATION_COPY_NONATOMIC);
30 | [button addTarget:self action:@selector(actionWithButton:) forControlEvents:UIControlEventTouchUpInside];
31 | [timelineViewController addView:button];
32 | }
33 |
34 | + (void)actionWithButton:(UIButton *)button
35 | {
36 | void(^block)(void) = objc_getAssociatedObject(button, kActionBlockKey);
37 | block();
38 | }
39 |
40 | + (void)reset
41 | {
42 |
43 | }
44 |
45 | @end
--------------------------------------------------------------------------------
/Pod/Classes/Components/Controls/ValueAdjust/KZPValueAdjustComponent.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Krzysztof Zabłocki(http://twitter.com/merowing_) on 21/10/14.
3 | //
4 | //
5 | //
6 |
7 |
8 | @import Foundation;
9 | @import UIKit;
10 | @class KZPValueAdjustComponent;
11 |
12 | //! only generates rounded values
13 | extern KZPValueAdjustComponent * __attribute__((overloadable)) KZPAdjust(NSString *name, int from, int to, void (^block)(int));
14 |
15 | extern KZPValueAdjustComponent * __attribute__((overloadable)) KZPAdjust(NSString *name, float from, float to, void (^block)(float));
16 |
17 | #define KZPAdjustValue(name, from, to) __block typeof(from) name = from; KZPAdjust(@#name, from, to, ^(typeof(from) value) { name = value; })
18 |
19 | @interface KZPValueAdjustComponent : NSObject
20 | @property(nonatomic, copy, readonly) void (^defaultValue)(CGFloat);
21 | + (KZPValueAdjustComponent*)addValueAdjustWithName:(NSString *)name fromValue:(CGFloat)from toValue:(CGFloat)to withBlock:(CGFloat (^)(CGFloat))block;
22 | @end
23 |
--------------------------------------------------------------------------------
/Pod/Classes/Components/Images/ImagePicker/AssetBrowser/KZPImagePickerCollectionViewController.h:
--------------------------------------------------------------------------------
1 |
2 | @import Foundation;
3 | @import UIKit;
4 |
5 | @interface KZPImagePickerCollectionViewCell : UICollectionViewCell
6 | @property(nonatomic, weak) UIImageView *imageView;
7 | @property(nonatomic, weak) UILabel *titleLabel;
8 | @end
9 |
10 | @interface KZPImagePickerCollectionViewController : UICollectionViewController
11 | @property(nonatomic, copy) void (^onSelectionBlock)(UIImage *);
12 | @end
--------------------------------------------------------------------------------
/Pod/Classes/Components/Images/ImagePicker/KZPImagePickerComponent.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Krzysztof Zabłocki(http://twitter.com/merowing_) on 21/10/14.
3 | //
4 | //
5 | //
6 |
7 |
8 | @import Foundation;
9 |
10 | #import "KZPComponent.h"
11 |
12 | @class KZPPresenterComponent;
13 |
14 | extern void __attribute__((overloadable)) KZPAdjust(NSString *name, void (^block)(UIImage *));
15 | #define KZPAdjustImage(name) __block UIImage *name = nil; KZPAdjust(@#name, ^(UIImage* value) { name = value; })
16 |
17 | @interface KZPImagePickerComponent : NSObject
18 | + (void)addImagePickerWithName:(NSString *)name block:(void (^)(UIImage *))block;
19 | @end
--------------------------------------------------------------------------------
/Pod/Classes/Components/KZPComponent.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Krzysztof Zabłocki(http://twitter.com/merowing_) on 20/10/14.
3 | //
4 | //
5 | //
6 |
7 |
8 | @import Foundation;
9 |
10 | @protocol KZPComponent
11 | @required
12 | + (void)reset;
13 | @end
--------------------------------------------------------------------------------
/Pod/Classes/Components/KZPSnapshotView.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Krzysztof Zabłocki(http://twitter.com/merowing_) on 20/10/14.
3 | //
4 | //
5 | //
6 |
7 |
8 | @import Foundation;
9 |
10 | @protocol KZPSnapshotView
11 | @required
12 | - (BOOL)hasExtraInformation;
13 | - (UIViewController*)extraInfoController;
14 | @end
--------------------------------------------------------------------------------
/Pod/Classes/Components/Presenter/KZPPresenterComponent.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Krzysztof Zabłocki(http://twitter.com/merowing_) on 20/10/14.
3 | //
4 | //
5 | //
6 |
7 |
8 | @import Foundation;
9 | @import UIKit;
10 | @import QuartzCore;
11 |
12 | #import "KZPComponent.h"
13 |
14 | extern void __attribute__((overloadable)) KZPShow(CALayer *layer);
15 |
16 | extern void __attribute__((overloadable)) KZPShow(UIView *view);
17 |
18 | extern void __attribute__((overloadable)) KZPShow(UIBezierPath *path);
19 |
20 | extern void __attribute__((overloadable)) KZPShow(CGPathRef path);
21 |
22 | extern void __attribute__((overloadable)) KZPShow(CGImageRef image);
23 |
24 | extern void __attribute__((overloadable)) KZPShow(UIImage *image);
25 |
26 | extern void __attribute__((overloadable)) KZPShow(NSString *format, ...);
27 |
28 | extern void __attribute__((overloadable)) KZPShow(id obj);
29 |
30 | @protocol KZPPresenterDebugProtocol
31 | //! preffered
32 | - (UIImage *)kzp_debugImage;
33 |
34 | //! will use if object provides any of [CALayer, UIView, UIBezierPath, UIImage, NSString]
35 | @optional
36 | - (id)debugQuickLookObject;
37 | @end
38 |
39 | @interface KZPPresenterComponent : UIView
40 | @property(nonatomic, strong) UIImage *image;
41 |
42 | - (instancetype)initWithImage:(UIImage *)image type:(NSString *)type;
43 | @end
--------------------------------------------------------------------------------
/Pod/Classes/Components/Presenter/KZPPresenterInfoViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // KZPPresenterInfoViewController.h
3 | // Playground
4 | //
5 | // Created by Krzysztof Zabłocki on 21/10/2014.
6 | // Copyright (c) 2014 pixle. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface KZPPresenterInfoViewController : UIViewController
12 | - (void)setFromImage:(UIImage *)image title:(NSString *)title;
13 | @end
14 |
--------------------------------------------------------------------------------
/Pod/Classes/Components/Presenter/KZPPresenterInfoViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // KZPPresenterInfoViewController.m
3 | // Playground
4 | //
5 | // Created by Krzysztof Zabłocki on 21/10/2014.
6 | // Copyright (c) 2014 pixle. All rights reserved.
7 | //
8 |
9 | #import "KZPPresenterInfoViewController.h"
10 |
11 | @interface KZPPresenterInfoViewController ()
12 | @property(weak, nonatomic) IBOutlet UILabel *titleLabel;
13 | @property(weak, nonatomic) IBOutlet UIImageView *imageView;
14 |
15 | @property(nonatomic, strong) UIImage *image;
16 |
17 | @end
18 |
19 | @implementation KZPPresenterInfoViewController
20 |
21 | - (void)setFromImage:(UIImage *)image title:(NSString *)title
22 | {
23 | self.image = image;
24 | self.title = title;
25 | }
26 |
27 | - (void)viewDidLoad
28 | {
29 | [super viewDidLoad];
30 | self.imageView.image = self.image;
31 | self.titleLabel.text = self.title;
32 | [self.view setNeedsLayout];
33 | }
34 |
35 | - (CGSize)preferredContentSize
36 | {
37 | static const NSInteger padding = 10;
38 | CGSize labelSize = [self.titleLabel sizeThatFits:CGSizeMake(1024, CGRectGetHeight(self.titleLabel.bounds))];
39 | return CGSizeMake(MAX(self.image.size.width, labelSize.width) + padding * 2, self.image.size.height + CGRectGetHeight(self.titleLabel.bounds) + padding);
40 | }
41 | @end
42 |
--------------------------------------------------------------------------------
/Pod/Classes/Components/Synchronization/KZPSynchronizationComponent.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Krzysztof Zabłocki(http://twitter.com/merowing_) on 25/10/14.
3 | //
4 | //
5 | //
6 |
7 |
8 | @import Foundation;
9 | @import UIKit;
10 |
11 | #import "KZPComponent.h"
12 |
13 | void KZPWaitForEvaluation(id (^valueGetter)(), void (^completion)(id));
14 |
15 | #define KZPWhenSet(value, completion) KZPWaitForEvaluation(^{return value;}, completion)
16 |
17 | @interface KZPSynchronizationComponent : NSObject
18 | + (void)addComponentWithGetter:(id (^)())valueGetter completion:(void (^)(id))completion;
19 |
20 | - (BOOL)evaluate;
21 | @end
--------------------------------------------------------------------------------
/Pod/Classes/Components/Synchronization/KZPSynchronizationComponent.m:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Krzysztof Zabłocki(http://twitter.com/merowing_) on 20/10/14.
3 | //
4 | //
5 | //
6 |
7 | #import
8 | #import "KZPSynchronizationComponent.h"
9 |
10 | void KZPWaitForEvaluation(id (^valueGetter)(), void (^completion)(id)) {
11 | [KZPSynchronizationComponent addComponentWithGetter:valueGetter completion:completion];
12 | }
13 |
14 | static const void *kComponentsKey = &kComponentsKey;
15 | static const void *kIsFinishedKey = &kIsFinishedKey;
16 |
17 | @interface KZPSynchronizationComponent ()
18 | @property(nonatomic, copy) id (^valueGetter)(void);
19 | @property(nonatomic, copy) void (^completion)(id);
20 | @end
21 |
22 | @implementation KZPSynchronizationComponent
23 |
24 | + (void)addComponentWithGetter:(id (^)())valueGetter completion:(void (^)(id))completion
25 | {
26 | KZPSynchronizationComponent *component = [KZPSynchronizationComponent new];
27 | component.valueGetter = valueGetter;
28 | component.completion = completion;
29 | [self addComponent:component];
30 | }
31 |
32 | + (void)addComponent:(KZPSynchronizationComponent *)component
33 | {
34 | @synchronized (self) {
35 | [self.components addObject:component];
36 | }
37 | }
38 |
39 | + (NSMutableArray *)components
40 | {
41 | NSMutableArray *components = objc_getAssociatedObject(self, kComponentsKey);
42 | if (!components) {
43 | components = [NSMutableArray new];
44 | objc_setAssociatedObject(self, kComponentsKey, components, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
45 | }
46 | return components;
47 | }
48 |
49 | + (void)load
50 | {
51 | [self performSelectorInBackground:@selector(backgroundProcessing) withObject:nil];
52 | }
53 |
54 | + (BOOL)isResetting
55 | {
56 | return [objc_getAssociatedObject(self, kIsFinishedKey) boolValue];
57 | }
58 |
59 | + (void)setFinished:(BOOL)finished
60 | {
61 | objc_setAssociatedObject(self, kIsFinishedKey, @(finished), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
62 | }
63 |
64 | + (void)backgroundProcessing
65 | {
66 | @autoreleasepool {
67 | #pragma clang diagnostic push
68 | #pragma clang diagnostic ignored "-Wmissing-noreturn"
69 | while (YES) {
70 | NSArray *components = nil;
71 | @synchronized (self) {
72 | components = [self.components copy];
73 | }
74 |
75 | NSMutableArray *componentsToRemove = [NSMutableArray new];
76 |
77 | [components enumerateObjectsUsingBlock:^(KZPSynchronizationComponent *component, NSUInteger idx, BOOL *stop) {
78 | *stop = [self isResetting];
79 |
80 | BOOL finished = [component evaluate];
81 | if (finished) {
82 | [componentsToRemove addObject:component];
83 | }
84 | }];
85 |
86 | @synchronized (self) {
87 | if ([self isResetting]) {
88 | [self.components removeObjectsInArray:componentsToRemove];
89 | }
90 | }
91 |
92 | [NSThread sleepForTimeInterval:0.1];
93 | }
94 | #pragma clang diagnostic pop
95 | }
96 | }
97 |
98 | - (BOOL)evaluate
99 | {
100 | __block BOOL finished = NO;
101 | dispatch_sync(dispatch_get_main_queue(), ^{
102 | id value = self.valueGetter();
103 | if (value) {
104 | self.completion(value);
105 | finished = YES;
106 | }
107 | });
108 |
109 | return finished;
110 | }
111 |
112 | + (void)reset
113 | {
114 | @synchronized (self) {
115 | self.finished = YES;
116 | [[self components] removeAllObjects];
117 | }
118 | }
119 |
120 |
121 | @end
122 |
--------------------------------------------------------------------------------
/Pod/Classes/Playground/KZPPlayground+Internal.h:
--------------------------------------------------------------------------------
1 | #import "KZPPlayground.h"
2 |
3 | @interface KZPPlayground (Internal)
4 | @property(nonatomic, weak, readwrite) UIView *worksheetView;
5 | @property(nonatomic, weak, readwrite) UIViewController *viewController;
6 | @property(nonatomic, weak, readwrite) KZPPlaygroundViewController *playgroundViewController;
7 | @end
--------------------------------------------------------------------------------
/Pod/Classes/Playground/KZPPlayground.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by merowing on 22/10/14.
3 | //
4 | //
5 | //
6 |
7 | #import "KZPAnimatorComponent.h"
8 | #import "KZPPresenterComponent.h"
9 | #import "KZPValueAdjustComponent.h"
10 | #import "KZPActionComponent.h"
11 | #import "KZPSynchronizationComponent.h"
12 | #import "KZPImagePickerComponent.h"
13 | #import "KZPPlaygroundViewController.h"
14 |
15 | @import Foundation;
16 | @import UIKit;@class KZPPlaygroundViewController;
17 |
18 | extern NSString *const KZPPlaygroundDidChangeImplementationNotification;
19 |
20 | //! adapt KZPActivePlayground in a KZPPlayground class that you want to use as active playground
21 | @protocol KZPActivePlayground
22 | @end
23 |
24 | @interface KZPPlayground : NSObject
25 | @property(nonatomic, strong, readonly, nonnull) UIView *worksheetView;
26 | @property(nonatomic, strong, readonly, nonnull) UIViewController *viewController;
27 | @property(nonatomic, strong, readonly, nonnull) KZPPlaygroundViewController *playgroundViewController;
28 |
29 | //! objects store that will be re-created with recompilation, use eg. instead of instance variables
30 | @property(nonatomic, strong, readonly, nonnull) NSMutableDictionary *transientObjects;
31 |
32 | - (nonnull instancetype)init NS_REQUIRES_SUPER NS_DESIGNATED_INITIALIZER;
33 |
34 | //! called only once
35 | - (void)setup;
36 |
37 | //! called on each code change
38 | - (void)run;
39 | @end
--------------------------------------------------------------------------------
/Pod/Classes/Playground/KZPPlayground.m:
--------------------------------------------------------------------------------
1 | //
2 | // Created by merowing on 22/10/14.
3 | //
4 | //
5 | //
6 |
7 |
8 | #import
9 | #import "KZPPlayground.h"
10 | #import "RSSwizzle.h"
11 | #import "SFDynamicCodeInjection.h"
12 | #import "KZPPlaygroundViewController.h"
13 |
14 | NSString *const KZPPlaygroundDidChangeImplementationNotification = @"KZPPlaygroundDidChangeImplementationNotification";
15 |
16 | @interface NSObject (KZPOverride)
17 | @end
18 |
19 | @implementation NSObject (KZPOverride)
20 | #pragma clang diagnostic push
21 | #pragma clang diagnostic ignored "-Wundeclared-selector"
22 | #pragma ide diagnostic ignored "UnresolvedMessage"
23 | + (void)load
24 | {
25 | //! no swizzling via dyci allowed e.g. device
26 | SEL selectorToSwizzle = @selector(performInjectionWithClass:);
27 | if (![SFDynamicCodeInjection.class instancesRespondToSelector:selectorToSwizzle]) {
28 | return;
29 | }
30 |
31 | RSSwizzleInstanceMethod(SFDynamicCodeInjection.class,
32 | selectorToSwizzle,
33 | RSSWReturnType(void),
34 | RSSWArguments(Class aClass),
35 | RSSWReplacement({
36 | RSSWCallOriginal(aClass);
37 | [[NSNotificationCenter defaultCenter] postNotificationName:KZPPlaygroundDidChangeImplementationNotification object:nil];
38 | }), 0, NULL);
39 |
40 | }
41 | #pragma clang diagnostic pop
42 |
43 | @end
44 |
45 | @interface NSObject (InjectMe)
46 | @end
47 |
48 | @implementation NSObject (InjectMe)
49 |
50 | + (void)injected {
51 | [NSObject cancelPreviousPerformRequestsWithTarget:[NSObject class] selector:@selector(postInjection) object:nil];
52 | [[NSObject class] performSelector: @selector(postInjection) withObject: nil afterDelay: 0.0001];
53 |
54 | }
55 |
56 | + (void)postInjection {
57 | [[NSNotificationCenter defaultCenter] postNotificationName:KZPPlaygroundDidChangeImplementationNotification object:nil];
58 | }
59 | @end
60 |
61 | @interface KZPPlayground ()
62 | @property(nonatomic, strong, readwrite) UIView *worksheetView;
63 | @property(nonatomic, strong, readwrite) UIViewController *viewController;
64 | @property(nonatomic, strong, readwrite) KZPPlaygroundViewController *playgroundViewController;
65 | @end
66 |
67 | @implementation KZPPlayground
68 | @synthesize transientObjects = _transientObjects;
69 |
70 | - (instancetype)init
71 | {
72 | self = [super init];
73 | if (self) {
74 | [self setup];
75 | }
76 |
77 | return self;
78 | }
79 |
80 | - (NSMutableDictionary *)transientObjects
81 | {
82 | return (_transientObjects = _transientObjects ?: [NSMutableDictionary new]);
83 | }
84 |
85 | - (void)setup
86 | {
87 |
88 | }
89 |
90 | - (void)run
91 | {
92 |
93 | }
94 |
95 | - (void)updateOnClassInjection
96 | {
97 |
98 | }
99 |
100 | - (void)updateOnResourceInjection:(NSString *)path {
101 | [[NSNotificationCenter defaultCenter] postNotificationName:KZPPlaygroundDidChangeImplementationNotification object:nil];
102 | }
103 |
104 | @end
105 |
--------------------------------------------------------------------------------
/Pod/Classes/Playground/KZPPlaygroundViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Krzysztof Zabłocki(http://twitter.com/merowing_) on 19/10/14.
3 | //
4 | //
5 | //
6 |
7 |
8 | @import Foundation;
9 | @import UIKit;
10 |
11 | @interface KZPPlaygroundViewController : UIViewController
12 | @property(nonatomic, assign) BOOL timelineHidden;
13 |
14 | + (instancetype)playgroundViewController;
15 | + (instancetype)newPlaygroundViewController;
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/Pod/Classes/Timeline/KZPTimelineViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Krzysztof Zabłocki(http://twitter.com/merowing_) on 19/10/14.
3 | //
4 | //
5 | //
6 |
7 |
8 | @import Foundation;
9 | @import UIKit;
10 |
11 | #import "KZPPlaygroundViewController.h"
12 |
13 | @interface KZPTimelineViewController : UIViewController
14 | + (KZPTimelineViewController *)sharedInstance;
15 |
16 | + (void)setSharedInstance:(KZPTimelineViewController *)sharedInstance;
17 |
18 | - (void)playgroundDidRun;
19 | - (void)playgroundSetupCompleted;
20 |
21 | - (CGFloat)maxWidthForSnapshotView;
22 |
23 | - (void)reset;
24 |
25 | - (void)addView:(UIView *)view;
26 |
27 | @end
--------------------------------------------------------------------------------
/Screenshots/playground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/krzysztofzablocki/Playgrounds/0b1494a04fed2cc7033f2a4f2113eef8b7f50b0f/Screenshots/playground.png
--------------------------------------------------------------------------------
/Screenshots/small_playground.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/krzysztofzablocki/Playgrounds/0b1494a04fed2cc7033f2a4f2113eef8b7f50b0f/Screenshots/small_playground.gif
--------------------------------------------------------------------------------
/SwiftExample/Podfile:
--------------------------------------------------------------------------------
1 | source 'https://github.com/CocoaPods/Specs.git'
2 |
3 | use_frameworks!
4 |
5 | target 'SwiftExample', :exclusive => true do
6 | pod "KZPlayground", :path => "../"
7 | pod 'Reveal-iOS-SDK'
8 | end
9 |
--------------------------------------------------------------------------------
/SwiftExample/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - dyci (0.1.5.6):
3 | - dyci/Injections (= 0.1.5.6)
4 | - dyci/Injections (0.1.5.6)
5 | - KZPlayground (0.3.2):
6 | - dyci (~> 0.1.5.6)
7 | - NHBalancedFlowLayout (~> 0.2)
8 | - RSSwizzle (~> 0.1.0)
9 | - NHBalancedFlowLayout (0.2)
10 | - Reveal-iOS-SDK (1.6.1)
11 | - RSSwizzle (0.1.0)
12 |
13 | DEPENDENCIES:
14 | - KZPlayground (from `../`)
15 | - Reveal-iOS-SDK
16 |
17 | EXTERNAL SOURCES:
18 | KZPlayground:
19 | :path: "../"
20 |
21 | SPEC CHECKSUMS:
22 | dyci: 099c2e6dc98abb8f21b370cabbf1443ff700608a
23 | KZPlayground: 20f4f672cf2a792a1e9fa73d6ff72d1a6dd7021b
24 | NHBalancedFlowLayout: fd253023c6754e605acdb180d50123e582cc62bb
25 | Reveal-iOS-SDK: ceae964076cebe3efe63e5e9abe3152efce46aa8
26 | RSSwizzle: d561958f595028bfcef98c7d55c318b3878a61c6
27 |
28 | COCOAPODS: 0.39.0
29 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/Headers/Private/KZPlayground/KZPActionComponent.h:
--------------------------------------------------------------------------------
1 | ../../../../../Pod/Classes/Components/Controls/Action/KZPActionComponent.h
--------------------------------------------------------------------------------
/SwiftExample/Pods/Headers/Private/KZPlayground/KZPAnimatorComponent.h:
--------------------------------------------------------------------------------
1 | ../../../../../Pod/Classes/Components/Animation/KZPAnimatorComponent.h
--------------------------------------------------------------------------------
/SwiftExample/Pods/Headers/Private/KZPlayground/KZPComponent.h:
--------------------------------------------------------------------------------
1 | ../../../../../Pod/Classes/Components/KZPComponent.h
--------------------------------------------------------------------------------
/SwiftExample/Pods/Headers/Private/KZPlayground/KZPImagePickerCollectionViewController.h:
--------------------------------------------------------------------------------
1 | ../../../../../Pod/Classes/Components/Images/ImagePicker/AssetBrowser/KZPImagePickerCollectionViewController.h
--------------------------------------------------------------------------------
/SwiftExample/Pods/Headers/Private/KZPlayground/KZPImagePickerComponent.h:
--------------------------------------------------------------------------------
1 | ../../../../../Pod/Classes/Components/Images/ImagePicker/KZPImagePickerComponent.h
--------------------------------------------------------------------------------
/SwiftExample/Pods/Headers/Private/KZPlayground/KZPPlayground+Internal.h:
--------------------------------------------------------------------------------
1 | ../../../../../Pod/Classes/Playground/KZPPlayground+Internal.h
--------------------------------------------------------------------------------
/SwiftExample/Pods/Headers/Private/KZPlayground/KZPPlayground.h:
--------------------------------------------------------------------------------
1 | ../../../../../Pod/Classes/Playground/KZPPlayground.h
--------------------------------------------------------------------------------
/SwiftExample/Pods/Headers/Private/KZPlayground/KZPPlaygroundViewController.h:
--------------------------------------------------------------------------------
1 | ../../../../../Pod/Classes/Playground/KZPPlaygroundViewController.h
--------------------------------------------------------------------------------
/SwiftExample/Pods/Headers/Private/KZPlayground/KZPPresenterComponent.h:
--------------------------------------------------------------------------------
1 | ../../../../../Pod/Classes/Components/Presenter/KZPPresenterComponent.h
--------------------------------------------------------------------------------
/SwiftExample/Pods/Headers/Private/KZPlayground/KZPPresenterInfoViewController.h:
--------------------------------------------------------------------------------
1 | ../../../../../Pod/Classes/Components/Presenter/KZPPresenterInfoViewController.h
--------------------------------------------------------------------------------
/SwiftExample/Pods/Headers/Private/KZPlayground/KZPSnapshotView.h:
--------------------------------------------------------------------------------
1 | ../../../../../Pod/Classes/Components/KZPSnapshotView.h
--------------------------------------------------------------------------------
/SwiftExample/Pods/Headers/Private/KZPlayground/KZPSynchronizationComponent.h:
--------------------------------------------------------------------------------
1 | ../../../../../Pod/Classes/Components/Synchronization/KZPSynchronizationComponent.h
--------------------------------------------------------------------------------
/SwiftExample/Pods/Headers/Private/KZPlayground/KZPTimelineViewController.h:
--------------------------------------------------------------------------------
1 | ../../../../../Pod/Classes/Timeline/KZPTimelineViewController.h
--------------------------------------------------------------------------------
/SwiftExample/Pods/Headers/Private/KZPlayground/KZPValueAdjustComponent.h:
--------------------------------------------------------------------------------
1 | ../../../../../Pod/Classes/Components/Controls/ValueAdjust/KZPValueAdjustComponent.h
--------------------------------------------------------------------------------
/SwiftExample/Pods/Headers/Private/NHBalancedFlowLayout/NHBalancedFlowLayout.h:
--------------------------------------------------------------------------------
1 | ../../../NHBalancedFlowLayout/NHBalancedFlowLayout/NHBalancedFlowLayout.h
--------------------------------------------------------------------------------
/SwiftExample/Pods/Headers/Private/NHBalancedFlowLayout/NHLinearPartition.h:
--------------------------------------------------------------------------------
1 | ../../../NHBalancedFlowLayout/NHBalancedFlowLayout/NHLinearPartition.h
--------------------------------------------------------------------------------
/SwiftExample/Pods/Headers/Private/RSSwizzle/RSSwizzle.h:
--------------------------------------------------------------------------------
1 | ../../../RSSwizzle/RSSwizzle/RSSwizzle.h
--------------------------------------------------------------------------------
/SwiftExample/Pods/Headers/Private/dyci/NSObject+DyCInjection.h:
--------------------------------------------------------------------------------
1 | ../../../dyci/Dynamic Code Injection/dyci/Classes/Injections/NSObject+DyCInjection.h
--------------------------------------------------------------------------------
/SwiftExample/Pods/Headers/Private/dyci/NSSet+ClassesList.h:
--------------------------------------------------------------------------------
1 | ../../../dyci/Dynamic Code Injection/dyci/Classes/Categories/NSSet+ClassesList.h
--------------------------------------------------------------------------------
/SwiftExample/Pods/Headers/Private/dyci/SFDynamicCodeInjection.h:
--------------------------------------------------------------------------------
1 | ../../../dyci/Dynamic Code Injection/dyci/Classes/SFDynamicCodeInjection.h
--------------------------------------------------------------------------------
/SwiftExample/Pods/Headers/Private/dyci/SFFileWatcher.h:
--------------------------------------------------------------------------------
1 | ../../../dyci/Dynamic Code Injection/dyci/Classes/FileWatcher/SFFileWatcher.h
--------------------------------------------------------------------------------
/SwiftExample/Pods/Headers/Private/dyci/SFFileWatcherDelegate.h:
--------------------------------------------------------------------------------
1 | ../../../dyci/Dynamic Code Injection/dyci/Classes/FileWatcher/SFFileWatcherDelegate.h
--------------------------------------------------------------------------------
/SwiftExample/Pods/Headers/Private/dyci/SFInjectionsNotificationsCenter.h:
--------------------------------------------------------------------------------
1 | ../../../dyci/Dynamic Code Injection/dyci/Classes/Notifications/SFInjectionsNotificationsCenter.h
--------------------------------------------------------------------------------
/SwiftExample/Pods/Headers/Private/dyci/UINib+StoryBoardSupport.h:
--------------------------------------------------------------------------------
1 | ../../../dyci/Dynamic Code Injection/dyci/Classes/Injections/UINib+StoryBoardSupport.h
--------------------------------------------------------------------------------
/SwiftExample/Pods/Headers/Private/dyci/UIViewController+XIBSupport.h:
--------------------------------------------------------------------------------
1 | ../../../dyci/Dynamic Code Injection/dyci/Classes/Injections/UIViewController+XIBSupport.h
--------------------------------------------------------------------------------
/SwiftExample/Pods/Headers/Public/Reveal-iOS-SDK/Reveal/IBANetServiceTypes.h:
--------------------------------------------------------------------------------
1 | ../../../../Reveal-iOS-SDK/Reveal-Framework-1.6.1/Reveal.framework/Versions/A/Headers/IBANetServiceTypes.h
--------------------------------------------------------------------------------
/SwiftExample/Pods/Headers/Public/Reveal-iOS-SDK/Reveal/IBARevealLoader.h:
--------------------------------------------------------------------------------
1 | ../../../../Reveal-iOS-SDK/Reveal-Framework-1.6.1/Reveal.framework/Versions/A/Headers/IBARevealLoader.h
--------------------------------------------------------------------------------
/SwiftExample/Pods/Headers/Public/Reveal-iOS-SDK/Reveal/IBARevealLogger.h:
--------------------------------------------------------------------------------
1 | ../../../../Reveal-iOS-SDK/Reveal-Framework-1.6.1/Reveal.framework/Versions/A/Headers/IBARevealLogger.h
--------------------------------------------------------------------------------
/SwiftExample/Pods/Headers/Public/Reveal-iOS-SDK/Reveal/Reveal.h:
--------------------------------------------------------------------------------
1 | ../../../../Reveal-iOS-SDK/Reveal-Framework-1.6.1/Reveal.framework/Versions/A/Headers/Reveal.h
--------------------------------------------------------------------------------
/SwiftExample/Pods/Local Podspecs/KZPlayground.podspec.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "KZPlayground",
3 | "version": "0.3.2",
4 | "summary": "Playgrounds but for Objective-C, with some extra coolness.",
5 | "description": "We all love Swift playgrounds, they are really great,\nbut since most of us still write Objective-C code, why not get benefits of rapid development with Objective-C Plagrounds?\nFast robust interations make it easy to prototype custom UI/Algorithms or even learn Objective-C or some new API.",
6 | "homepage": "https://github.com/krzysztofzablocki/KZPlayground",
7 | "license": "MIT",
8 | "authors": {
9 | "Krzysztof Zablocki": "krzysztof.zablocki@me.com"
10 | },
11 | "source": {
12 | "git": "https://github.com/krzysztofzablocki/KZPlayground.git",
13 | "tag": "0.3.2"
14 | },
15 | "social_media_url": "https://twitter.com/merowing_",
16 | "platforms": {
17 | "ios": "7.0"
18 | },
19 | "requires_arc": true,
20 | "source_files": [
21 | "Pod/Classes/**/*.h",
22 | "Pod/Classes/**/*.m"
23 | ],
24 | "resources": [
25 | "Pod/Assets/*"
26 | ],
27 | "dependencies": {
28 | "dyci": [
29 | "~> 0.1.5.6"
30 | ],
31 | "RSSwizzle": [
32 | "~> 0.1.0"
33 | ],
34 | "NHBalancedFlowLayout": [
35 | "~> 0.2"
36 | ]
37 | },
38 | "prepare_command": "cat << EOF > ../../.kick\n recipe :ruby\nKicker::Recipes::Ruby.runner_bin = 'bacon -q'\n\nprocess do |potential_files|\n files = potential_files.take_and_map do |file|\n if file =~ %r{^.*\\.(m|xib|strings)$}\n execute(\"/usr/bin/python #{File.expand_path(\"~/.dyci/scripts/dyci-recompile.py\")} '#{File.expand_path(file)}'\")\n puts \"KZPlayground: Recompiled #{file}\"\n file\n end\n end\nend\n\nprocess do |remaining_files|\n remaining_files.take_and_map do |file|\n puts \"KZPlayground: Ignored #{file}\"\n file\n end\nend\n\nstartup do\n log \"KZPlayground: Watching for file changes!\"\nend\nEOF"
39 | }
40 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - dyci (0.1.5.6):
3 | - dyci/Injections (= 0.1.5.6)
4 | - dyci/Injections (0.1.5.6)
5 | - KZPlayground (0.3.2):
6 | - dyci (~> 0.1.5.6)
7 | - NHBalancedFlowLayout (~> 0.2)
8 | - RSSwizzle (~> 0.1.0)
9 | - NHBalancedFlowLayout (0.2)
10 | - Reveal-iOS-SDK (1.6.1)
11 | - RSSwizzle (0.1.0)
12 |
13 | DEPENDENCIES:
14 | - KZPlayground (from `../`)
15 | - Reveal-iOS-SDK
16 |
17 | EXTERNAL SOURCES:
18 | KZPlayground:
19 | :path: "../"
20 |
21 | SPEC CHECKSUMS:
22 | dyci: 099c2e6dc98abb8f21b370cabbf1443ff700608a
23 | KZPlayground: 20f4f672cf2a792a1e9fa73d6ff72d1a6dd7021b
24 | NHBalancedFlowLayout: fd253023c6754e605acdb180d50123e582cc62bb
25 | Reveal-iOS-SDK: ceae964076cebe3efe63e5e9abe3152efce46aa8
26 | RSSwizzle: d561958f595028bfcef98c7d55c318b3878a61c6
27 |
28 | COCOAPODS: 0.39.0
29 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/NHBalancedFlowLayout/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2013 Niels de Hoog
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 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/NHBalancedFlowLayout/NHBalancedFlowLayout/NHBalancedFlowLayout.h:
--------------------------------------------------------------------------------
1 | //
2 | // BalancedFlowLayout.h
3 | // BalancedFlowLayout
4 | //
5 | // Created by Niels de Hoog on 31/10/13.
6 | // Copyright (c) 2013 Niels de Hoog. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | /**
12 | * The BalancedFlowLayout class is designed to display items of different sizes and aspect ratios in a grid, without wasting any visual space.
13 | * It takes the preferred sizes for the displayed items and a preferred row height as input to determine the optimal layout.
14 | *
15 | * In order to use this layout, the delegate for the collection view must implement the required methods in the BalancedFlowLayoutDelegate protocol.
16 | * Currently this class does not support supplementary or decoration views.
17 | *
18 | */
19 | @interface NHBalancedFlowLayout : UICollectionViewLayout
20 |
21 | // The preferred size for each row measured in the scroll direction
22 | @property (nonatomic) CGFloat preferredRowSize;
23 |
24 | // The size of each section's header. This maybe dynamically adjusted
25 | // per section via the protocol method referenceSizeForHeaderInSection.
26 | @property (nonatomic) CGSize headerReferenceSize;
27 |
28 | // The size of each section's header. This maybe dynamically adjusted
29 | // per section via the protocol method referenceSizeForFooterInSection.
30 | @property (nonatomic) CGSize footerReferenceSize;
31 |
32 | // The margins used to lay out content in a section.
33 | @property (nonatomic) UIEdgeInsets sectionInset;
34 |
35 | // The minimum spacing to use between lines of items in the grid.
36 | @property (nonatomic) CGFloat minimumLineSpacing;
37 |
38 | // The minimum spacing to use between items in the same row.
39 | @property (nonatomic) CGFloat minimumInteritemSpacing;
40 |
41 | // The scroll direction of the grid.
42 | @property (nonatomic) UICollectionViewScrollDirection scrollDirection;
43 |
44 | @end
45 |
46 |
47 | @protocol NHBalancedFlowLayoutDelegate
48 |
49 | @required
50 | - (CGSize)collectionView:(UICollectionView *)collectionView layout:(NHBalancedFlowLayout *)collectionViewLayout preferredSizeForItemAtIndexPath:(NSIndexPath *)indexPath;
51 |
52 | @end
--------------------------------------------------------------------------------
/SwiftExample/Pods/NHBalancedFlowLayout/NHBalancedFlowLayout/NHLinearPartition.h:
--------------------------------------------------------------------------------
1 | //
2 | // LinearPartition.h
3 | // BalancedFlowLayout
4 | //
5 | // Created by Niels de Hoog on 08-10-13.
6 | // Copyright (c) 2013 Niels de Hoog. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | /**
12 | * Partitions a sequence of non-negative integers into the required number of partitions.
13 | * Based on implementation in Python by Óscar López: http://stackoverflow.com/a/7942946
14 | * Example: [LinearPartition linearPartitionForSequence:@[9,2,6,3,8,5,8,1,7,3,4] numberOfPartitions:3] => @[@[9,2,6,3],@[8,5,8],@[1,7,3,4]]
15 | */
16 | @interface NHLinearPartition : NSObject
17 |
18 | + (NSArray *)linearPartitionForSequence:(NSArray *)sequence numberOfPartitions:(NSInteger)numberOfPartitions;
19 |
20 | @end
21 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/NHBalancedFlowLayout/NHBalancedFlowLayout/NHLinearPartition.m:
--------------------------------------------------------------------------------
1 | //
2 | // LinearPartition.m
3 | // BalancedFlowLayout
4 | //
5 | // Created by Niels de Hoog on 08-10-13.
6 | // Copyright (c) 2013 Niels de Hoog. All rights reserved.
7 | //
8 |
9 | #import "NHLinearPartition.h"
10 |
11 |
12 | #define NH_LP_TABLE_LOOKUP(table, i, j, rowsize) (table)[(i) * (rowsize) + (j)]
13 |
14 |
15 | @implementation NHLinearPartition
16 |
17 | /**
18 | * Returns a solution integer array for the linear partition problem
19 | *
20 | * @param sequence An array of NSNumber's
21 | * @param numPartitions The number of partitions wanted
22 | *
23 | * @return A C-style solution table
24 | */
25 | + (NSInteger *)linearPartitionTable:(NSArray *)sequence numPartitions:(NSInteger)numPartitions
26 | {
27 | NSInteger k = numPartitions;
28 | NSInteger n = [sequence count];
29 |
30 | // allocate a table buffer of n * k integers
31 | NSInteger tableSize = sizeof(NSInteger) * n * k;
32 | NSInteger *tmpTable = (NSInteger *)malloc(tableSize);
33 | memset(tmpTable, 0, tableSize);
34 |
35 | // allocate a solution buffer of (n - 1) * (k - 1) integers
36 | NSInteger solutionSize = sizeof(NSInteger) * (n - 1) * (k - 1);
37 | NSInteger *solution = (NSInteger *)malloc(solutionSize);
38 | memset(solution, 0, solutionSize);
39 |
40 | // fill table with initial values
41 | for (NSInteger i = 0; i < n; i++) {
42 | NSInteger offset = i? NH_LP_TABLE_LOOKUP(tmpTable, i - 1, 0, k) : 0;
43 | NH_LP_TABLE_LOOKUP(tmpTable, i, 0, k) = [sequence[i] integerValue] + offset;
44 | }
45 |
46 | for (NSInteger j = 0; j < k; j++) {
47 | NH_LP_TABLE_LOOKUP(tmpTable, 0, j, k) = [sequence[0] integerValue];
48 | }
49 |
50 | // calculate the costs and fill the solution buffer
51 | for (NSInteger i = 1; i < n; i++) {
52 | for (NSInteger j = 1; j < k; j++) {
53 | NSInteger currentMin = 0;
54 | NSInteger minX = NSIntegerMax;
55 |
56 | for (NSInteger x = 0; x < i; x++) {
57 | NSInteger c1 = NH_LP_TABLE_LOOKUP(tmpTable, x, j - 1, k);
58 | NSInteger c2 = NH_LP_TABLE_LOOKUP(tmpTable, i, 0, k) - NH_LP_TABLE_LOOKUP(tmpTable, x, 0, k);
59 | NSInteger cost = MAX(c1, c2);
60 |
61 | if (!x || cost < currentMin) {
62 | currentMin = cost;
63 | minX = x;
64 | }
65 | }
66 |
67 | NH_LP_TABLE_LOOKUP(tmpTable, i, j, k) = currentMin;
68 | NH_LP_TABLE_LOOKUP(solution, i - 1, j - 1, k - 1) = minX;
69 | }
70 | }
71 |
72 | // free the tmp table, we don't need it anymore
73 | free(tmpTable);
74 |
75 | return solution;
76 | }
77 |
78 | + (NSArray *)linearPartitionForSequence:(NSArray *)sequence numberOfPartitions:(NSInteger)numberOfPartitions
79 | {
80 | NSInteger n = [sequence count];
81 | NSInteger k = numberOfPartitions;
82 |
83 | if (k <= 0) return @[];
84 |
85 | if (k >= n) {
86 | NSMutableArray *partition = [[NSMutableArray alloc] init];
87 | [sequence enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
88 | [partition addObject:@[obj]];
89 | }];
90 | return [partition copy];
91 | }
92 |
93 | if (n == 1) {
94 | return @[sequence];
95 | }
96 |
97 | // get the solution table
98 | NSInteger *solution = [self linearPartitionTable:sequence numPartitions:numberOfPartitions];
99 | NSInteger solutionRowSize = numberOfPartitions - 1;
100 |
101 | k = k - 2;
102 | n = n - 1;
103 | NSMutableArray *answer = [NSMutableArray array];
104 |
105 | while (k >= 0) {
106 | if (n < 1) {
107 | [answer insertObject:@[] atIndex:0];
108 | } else {
109 | NSMutableArray *currentAnswer = [NSMutableArray array];
110 | for (NSInteger i = NH_LP_TABLE_LOOKUP(solution, n - 1, k, solutionRowSize) + 1, range = n + 1; i < range; i++) {
111 | [currentAnswer addObject:sequence[i]];
112 | }
113 | [answer insertObject:currentAnswer atIndex:0];
114 |
115 | n = NH_LP_TABLE_LOOKUP(solution, n - 1, k, solutionRowSize);
116 | }
117 |
118 | k = k - 1;
119 | }
120 |
121 | // free the solution table because we don't need it anymore
122 | free(solution);
123 |
124 | NSMutableArray *currentAnswer = [NSMutableArray array];
125 | for (NSInteger i = 0, range = n + 1; i < range; i++) {
126 | [currentAnswer addObject:sequence[i]];
127 | }
128 |
129 | [answer insertObject:currentAnswer atIndex:0];
130 |
131 | return [answer copy];
132 | }
133 |
134 | @end
135 |
136 |
137 |
138 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/NHBalancedFlowLayout/README.md:
--------------------------------------------------------------------------------
1 | NHBalancedFlowLayout
2 | ==================
3 |
4 | UICollectionViewLayout subclass for displaying items of different sizes in a grid without wasting any visual space. Inspired by: http://www.crispymtn.com/stories/the-algorithm-for-a-perfectly-balanced-photo-gallery
5 |
6 | ## Notes
7 | * Tested with iOS 7, but should be compatible with iOS6 as well
8 | * Works with iPhone and iPad
9 | * All interface orientations are supported
10 |
11 | ## Screenshots
12 |
13 |
14 |
15 |
16 | ## Installation
17 |
18 | The easiest way is to use CocoaPods. If you don't already, here's a [guide](http://guides.cocoapods.org/using/getting-started.html).
19 |
20 | pod 'NHBalancedFlowLayout', '~> 0.1.2'
21 |
22 | If you don't use CocoaPods, you'll need to copy the following files into your project:
23 |
24 | * NHBalancedFlowLayout.h
25 | * NHBalancedFlowLayout.m
26 | * NHLinearPartition.h
27 | * NHLinearPartition.m
28 |
29 | ## Credits
30 |
31 | Attributions for the photos in the same order as they appear in the demo:
32 |
33 | * http://www.flickr.com/photos/adriensifre/7162196453/
34 | * http://www.flickr.com/photos/ucumari/2949701552/
35 | * http://www.flickr.com/photos/ucumari/388370102/
36 | * http://www.flickr.com/photos/38659937@N06/3567549164/
37 | * http://www.flickr.com/photos/vinothchandar/5139245960/
38 | * http://www.flickr.com/photos/expressmonorail/3581442376/
39 | * http://www.flickr.com/photos/keithmwilliams/4465380932/
40 | * http://en.wikipedia.org/wiki/File:Bobcat-Texas-9110.jpg
41 | * http://www.flickr.com/photos/thecaucas/2390806406/
42 | * http://www.flickr.com/photos/ucumari/2342703987/
43 | * http://www.flickr.com/photos/ucumari/2317386162/
44 | * http://www.flickr.com/photos/ucumari/448815607/
45 | * http://www.flickr.com/photos/kshathriya/331847679/
46 | * http://www.flickr.com/photos/ucumari/367041320/
47 | * http://www.flickr.com/photos/da100fotos/465868860/
48 | * http://www.flickr.com/photos/hhoyer/3758550410/
49 | * http://www.flickr.com/photos/tambako/9314344697/
50 | * http://www.flickr.com/photos/sergiu_bacioiu/4485931477/
51 | * http://www.flickr.com/photos/matthileo/4077650329/
52 | * http://www.flickr.com/photos/markop/491027707/
53 | * http://www.flickr.com/photos/stevedave/3566325269/
54 | * http://www.flickr.com/photos/genista/127048347/
55 | * http://www.flickr.com/photos/wagner-machado-carlos-lemes/5540332691/
56 | * http://www.flickr.com/photos/29487767@N02/3438177701/
57 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/Pods.xcodeproj/xcshareddata/xcschemes/KZPlayground.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
45 |
46 |
52 |
53 |
55 |
56 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/RSSwizzle/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2013 Yan Rabovik
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is furnished
8 | to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in all
11 | copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
21 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/Reveal-iOS-SDK/Reveal-Framework-1.6.1/Reveal.framework/Headers:
--------------------------------------------------------------------------------
1 | Versions/Current/Headers
--------------------------------------------------------------------------------
/SwiftExample/Pods/Reveal-iOS-SDK/Reveal-Framework-1.6.1/Reveal.framework/Reveal:
--------------------------------------------------------------------------------
1 | Versions/Current/Reveal
--------------------------------------------------------------------------------
/SwiftExample/Pods/Reveal-iOS-SDK/Reveal-Framework-1.6.1/Reveal.framework/Versions/A/Headers/IBANetServiceTypes.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2014 Itty Bitty Apps Pty Ltd. All rights reserved.
3 |
4 | #ifndef reveal_core_IBANetServiceTypes_h
5 | #define reveal_core_IBANetServiceTypes_h
6 | #import
7 |
8 | typedef NS_ENUM(uint32_t, IBANetServiceInterface) {
9 | IBANetServiceInterfaceAny = kDNSServiceInterfaceIndexAny,
10 | IBANetServiceInterfaceLocalOnly = kDNSServiceInterfaceIndexLocalOnly,
11 | IBANetServiceInterfaceUnicast = kDNSServiceInterfaceIndexUnicast,
12 | IBANetServiceInterfaceP2P = kDNSServiceInterfaceIndexP2P
13 | };
14 |
15 | #endif
16 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/Reveal-iOS-SDK/Reveal-Framework-1.6.1/Reveal.framework/Versions/A/Headers/IBARevealLoader.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2013 Itty Bitty Apps. All rights reserved.
3 |
4 | #import
5 |
6 | extern NSString * const IBARevealLoaderRequestStartNotification;
7 | extern NSString * const IBARevealLoaderRequestStopNotification;
8 |
9 | extern NSString * const IBARevealLoaderSetOptionsNotification;
10 | extern NSString * const IBARevealLoaderOptionsLogLevelMaskKey;
11 |
12 | @interface IBARevealLoader : NSObject
13 |
14 | + (void)startServer;
15 | + (void)stopServer;
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/Reveal-iOS-SDK/Reveal-Framework-1.6.1/Reveal.framework/Versions/A/Headers/IBARevealLogger.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2013 Itty Bitty Apps Pty Ltd. All rights reserved.
2 | //
3 |
4 | #import
5 |
6 | CF_EXTERN_C_BEGIN
7 |
8 | /*!
9 | \brief The Reveal Log level bit flags.
10 | \discussion These flags are additive. i.e. you should bitwise OR them together.
11 |
12 | \seealso IBARevealLoggerSetLevelMask
13 | \seealso IBARevealLoggerGetLevelMask
14 |
15 | Example:
16 |
17 | // Enable Error, Warning and Info logger levels.
18 | IBARevealLoggerSetLevelMask(IBARevealLogLevelError|IBARevealLogLevelWarn|IBARevealLogLevelInfo);
19 |
20 | */
21 | typedef NS_OPTIONS(int32_t, IBARevealLogLevel)
22 | {
23 | IBARevealLogLevelNone = 0,
24 | IBARevealLogLevelDebug = (1 << 0),
25 | IBARevealLogLevelInfo = (1 << 1),
26 | IBARevealLogLevelWarn = (1 << 2),
27 | IBARevealLogLevelError = (1 << 3)
28 | };
29 |
30 | /*!
31 | \brief Set the Reveal logger level mask.
32 | \param mask A bit mask which is a combination of the IBARevealLogLevel enum options.
33 |
34 | \discussion If you do not wish to see log messages from Reveal you should call this function with an appropriate level mask as early in your application's lifecycle as possible. For example in your application's main() function.
35 |
36 | Example:
37 |
38 | // Enable Error, Warning and Info logger levels.
39 | IBARevealLoggerSetLevelMask(IBARevealLogLevelError|IBARevealLogLevelWarn|IBARevealLogLevelInfo);
40 |
41 | */
42 | CF_EXPORT void IBARevealLoggerSetLevelMask(int32_t mask);
43 |
44 | /*!
45 | \brief Get the current Reveal logger level mask.
46 | \return A bit mask representing the levels at which Reveal is currently logging.
47 | \discussion The default Reveal Logger level mask is IBARevealLogLevelError|IBARevealLogLevelWarn|IBARevealLogLevelInfo.
48 |
49 | Example:
50 |
51 | // Turn off the Info log level.
52 | IBARevealLoggerSetLevelMask(IBARevealLoggerGetLevelMask() & ~IBARevealLogLevelInfo);
53 |
54 | */
55 | CF_EXPORT int32_t IBARevealLoggerGetLevelMask(void);
56 |
57 | CF_EXTERN_C_END
58 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/Reveal-iOS-SDK/Reveal-Framework-1.6.1/Reveal.framework/Versions/A/Headers/Reveal.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2013 Itty Bitty Apps Pty Ltd. All rights reserved.
2 | //
3 |
4 | #import "IBARevealLogger.h"
5 | #import "IBARevealLoader.h"
6 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/Reveal-iOS-SDK/Reveal-Framework-1.6.1/Reveal.framework/Versions/A/Reveal:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/krzysztofzablocki/Playgrounds/0b1494a04fed2cc7033f2a4f2113eef8b7f50b0f/SwiftExample/Pods/Reveal-iOS-SDK/Reveal-Framework-1.6.1/Reveal.framework/Versions/A/Reveal
--------------------------------------------------------------------------------
/SwiftExample/Pods/Reveal-iOS-SDK/Reveal-Framework-1.6.1/Reveal.framework/Versions/Current:
--------------------------------------------------------------------------------
1 | A
--------------------------------------------------------------------------------
/SwiftExample/Pods/Target Support Files/KZPlayground/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 0.3.2
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/Target Support Files/KZPlayground/KZPlayground-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_KZPlayground : NSObject
3 | @end
4 | @implementation PodsDummy_KZPlayground
5 | @end
6 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/Target Support Files/KZPlayground/KZPlayground-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #endif
4 |
5 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/Target Support Files/KZPlayground/KZPlayground-umbrella.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | #import "KZPAnimatorComponent.h"
4 | #import "KZPActionComponent.h"
5 | #import "KZPValueAdjustComponent.h"
6 | #import "KZPImagePickerCollectionViewController.h"
7 | #import "KZPImagePickerComponent.h"
8 | #import "KZPComponent.h"
9 | #import "KZPSnapshotView.h"
10 | #import "KZPPresenterComponent.h"
11 | #import "KZPPresenterInfoViewController.h"
12 | #import "KZPSynchronizationComponent.h"
13 | #import "KZPPlayground+Internal.h"
14 | #import "KZPPlayground.h"
15 | #import "KZPPlaygroundViewController.h"
16 | #import "KZPTimelineViewController.h"
17 |
18 | FOUNDATION_EXPORT double KZPlaygroundVersionNumber;
19 | FOUNDATION_EXPORT const unsigned char KZPlaygroundVersionString[];
20 |
21 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/Target Support Files/KZPlayground/KZPlayground.modulemap:
--------------------------------------------------------------------------------
1 | framework module KZPlayground {
2 | umbrella header "KZPlayground-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/Target Support Files/KZPlayground/KZPlayground.xcconfig:
--------------------------------------------------------------------------------
1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/KZPlayground" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Reveal-iOS-SDK"
3 | PODS_ROOT = ${SRCROOT}
4 | SKIP_INSTALL = YES
--------------------------------------------------------------------------------
/SwiftExample/Pods/Target Support Files/NHBalancedFlowLayout/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 0.2
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/Target Support Files/NHBalancedFlowLayout/NHBalancedFlowLayout-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_NHBalancedFlowLayout : NSObject
3 | @end
4 | @implementation PodsDummy_NHBalancedFlowLayout
5 | @end
6 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/Target Support Files/NHBalancedFlowLayout/NHBalancedFlowLayout-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #endif
4 |
5 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/Target Support Files/NHBalancedFlowLayout/NHBalancedFlowLayout-umbrella.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | #import "NHBalancedFlowLayout.h"
4 | #import "NHLinearPartition.h"
5 |
6 | FOUNDATION_EXPORT double NHBalancedFlowLayoutVersionNumber;
7 | FOUNDATION_EXPORT const unsigned char NHBalancedFlowLayoutVersionString[];
8 |
9 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/Target Support Files/NHBalancedFlowLayout/NHBalancedFlowLayout.modulemap:
--------------------------------------------------------------------------------
1 | framework module NHBalancedFlowLayout {
2 | umbrella header "NHBalancedFlowLayout-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/Target Support Files/NHBalancedFlowLayout/NHBalancedFlowLayout.xcconfig:
--------------------------------------------------------------------------------
1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/NHBalancedFlowLayout" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Reveal-iOS-SDK"
3 | PODS_ROOT = ${SRCROOT}
4 | SKIP_INSTALL = YES
--------------------------------------------------------------------------------
/SwiftExample/Pods/Target Support Files/Pods-SwiftExample/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/Target Support Files/Pods-SwiftExample/Pods-SwiftExample-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_SwiftExample : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_SwiftExample
5 | @end
6 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/Target Support Files/Pods-SwiftExample/Pods-SwiftExample-frameworks.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
6 |
7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
8 |
9 | install_framework()
10 | {
11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
12 | local source="${BUILT_PRODUCTS_DIR}/$1"
13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
15 | elif [ -r "$1" ]; then
16 | local source="$1"
17 | fi
18 |
19 | local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
20 |
21 | if [ -L "${source}" ]; then
22 | echo "Symlinked..."
23 | source="$(readlink "${source}")"
24 | fi
25 |
26 | # use filter instead of exclude so missing patterns dont' throw errors
27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
29 |
30 | local basename
31 | basename="$(basename -s .framework "$1")"
32 | binary="${destination}/${basename}.framework/${basename}"
33 | if ! [ -r "$binary" ]; then
34 | binary="${destination}/${basename}"
35 | fi
36 |
37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device
38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
39 | strip_invalid_archs "$binary"
40 | fi
41 |
42 | # Resign the code if required by the build settings to avoid unstable apps
43 | code_sign_if_enabled "${destination}/$(basename "$1")"
44 |
45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
47 | local swift_runtime_libs
48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
49 | for lib in $swift_runtime_libs; do
50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
52 | code_sign_if_enabled "${destination}/${lib}"
53 | done
54 | fi
55 | }
56 |
57 | # Signs a framework with the provided identity
58 | code_sign_if_enabled() {
59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
60 | # Use the current code_sign_identitiy
61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\""
63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1"
64 | fi
65 | }
66 |
67 | # Strip invalid architectures
68 | strip_invalid_archs() {
69 | binary="$1"
70 | # Get architectures for current file
71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
72 | stripped=""
73 | for arch in $archs; do
74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then
75 | # Strip non-valid architectures in-place
76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1
77 | stripped="$stripped $arch"
78 | fi
79 | done
80 | if [[ "$stripped" ]]; then
81 | echo "Stripped $binary of architectures:$stripped"
82 | fi
83 | }
84 |
85 |
86 | if [[ "$CONFIGURATION" == "Debug" ]]; then
87 | install_framework "Pods-SwiftExample/KZPlayground.framework"
88 | install_framework "Pods-SwiftExample/NHBalancedFlowLayout.framework"
89 | install_framework "Pods-SwiftExample/RSSwizzle.framework"
90 | install_framework "Pods-SwiftExample/dyci.framework"
91 | fi
92 | if [[ "$CONFIGURATION" == "Release" ]]; then
93 | install_framework "Pods-SwiftExample/KZPlayground.framework"
94 | install_framework "Pods-SwiftExample/NHBalancedFlowLayout.framework"
95 | install_framework "Pods-SwiftExample/RSSwizzle.framework"
96 | install_framework "Pods-SwiftExample/dyci.framework"
97 | fi
98 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/Target Support Files/Pods-SwiftExample/Pods-SwiftExample-resources.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
5 |
6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
7 | > "$RESOURCES_TO_COPY"
8 |
9 | XCASSET_FILES=()
10 |
11 | realpath() {
12 | DIRECTORY="$(cd "${1%/*}" && pwd)"
13 | FILENAME="${1##*/}"
14 | echo "$DIRECTORY/$FILENAME"
15 | }
16 |
17 | install_resource()
18 | {
19 | case $1 in
20 | *.storyboard)
21 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
22 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
23 | ;;
24 | *.xib)
25 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
26 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
27 | ;;
28 | *.framework)
29 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
30 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
31 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
32 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
33 | ;;
34 | *.xcdatamodel)
35 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\""
36 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom"
37 | ;;
38 | *.xcdatamodeld)
39 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\""
40 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd"
41 | ;;
42 | *.xcmappingmodel)
43 | echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\""
44 | xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm"
45 | ;;
46 | *.xcassets)
47 | ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1")
48 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
49 | ;;
50 | /*)
51 | echo "$1"
52 | echo "$1" >> "$RESOURCES_TO_COPY"
53 | ;;
54 | *)
55 | echo "${PODS_ROOT}/$1"
56 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY"
57 | ;;
58 | esac
59 | }
60 |
61 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
62 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
63 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
64 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
65 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
66 | fi
67 | rm -f "$RESOURCES_TO_COPY"
68 |
69 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
70 | then
71 | case "${TARGETED_DEVICE_FAMILY}" in
72 | 1,2)
73 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
74 | ;;
75 | 1)
76 | TARGET_DEVICE_ARGS="--target-device iphone"
77 | ;;
78 | 2)
79 | TARGET_DEVICE_ARGS="--target-device ipad"
80 | ;;
81 | *)
82 | TARGET_DEVICE_ARGS="--target-device mac"
83 | ;;
84 | esac
85 |
86 | # Find all other xcassets (this unfortunately includes those of path pods and other targets).
87 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
88 | while read line; do
89 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then
90 | XCASSET_FILES+=("$line")
91 | fi
92 | done <<<"$OTHER_XCASSETS"
93 |
94 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
95 | fi
96 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/Target Support Files/Pods-SwiftExample/Pods-SwiftExample-umbrella.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 |
4 | FOUNDATION_EXPORT double Pods_SwiftExampleVersionNumber;
5 | FOUNDATION_EXPORT const unsigned char Pods_SwiftExampleVersionString[];
6 |
7 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/Target Support Files/Pods-SwiftExample/Pods-SwiftExample.debug.xcconfig:
--------------------------------------------------------------------------------
1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Reveal-iOS-SDK/Reveal-Framework-1.6.1"
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Reveal-iOS-SDK"
4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
5 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/KZPlayground.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/NHBalancedFlowLayout.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/RSSwizzle.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/dyci.framework/Headers" -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Reveal-iOS-SDK"
6 | OTHER_LDFLAGS = $(inherited) -ObjC -l"z" -framework "CFNetwork" -framework "CoreGraphics" -framework "KZPlayground" -framework "NHBalancedFlowLayout" -framework "QuartzCore" -framework "RSSwizzle" -framework "Reveal" -framework "dyci"
7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-SwiftExample
8 | PODS_ROOT = ${SRCROOT}/Pods
--------------------------------------------------------------------------------
/SwiftExample/Pods/Target Support Files/Pods-SwiftExample/Pods-SwiftExample.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_SwiftExample {
2 | umbrella header "Pods-SwiftExample-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/Target Support Files/Pods-SwiftExample/Pods-SwiftExample.release.xcconfig:
--------------------------------------------------------------------------------
1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Reveal-iOS-SDK/Reveal-Framework-1.6.1"
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Reveal-iOS-SDK"
4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
5 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/KZPlayground.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/NHBalancedFlowLayout.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/RSSwizzle.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/dyci.framework/Headers" -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Reveal-iOS-SDK"
6 | OTHER_LDFLAGS = $(inherited) -ObjC -l"z" -framework "CFNetwork" -framework "CoreGraphics" -framework "KZPlayground" -framework "NHBalancedFlowLayout" -framework "QuartzCore" -framework "RSSwizzle" -framework "Reveal" -framework "dyci"
7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-SwiftExample
8 | PODS_ROOT = ${SRCROOT}/Pods
--------------------------------------------------------------------------------
/SwiftExample/Pods/Target Support Files/RSSwizzle/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 0.1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/Target Support Files/RSSwizzle/RSSwizzle-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_RSSwizzle : NSObject
3 | @end
4 | @implementation PodsDummy_RSSwizzle
5 | @end
6 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/Target Support Files/RSSwizzle/RSSwizzle-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #endif
4 |
5 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/Target Support Files/RSSwizzle/RSSwizzle-umbrella.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | #import "RSSwizzle.h"
4 |
5 | FOUNDATION_EXPORT double RSSwizzleVersionNumber;
6 | FOUNDATION_EXPORT const unsigned char RSSwizzleVersionString[];
7 |
8 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/Target Support Files/RSSwizzle/RSSwizzle.modulemap:
--------------------------------------------------------------------------------
1 | framework module RSSwizzle {
2 | umbrella header "RSSwizzle-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/Target Support Files/RSSwizzle/RSSwizzle.xcconfig:
--------------------------------------------------------------------------------
1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/RSSwizzle" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Reveal-iOS-SDK"
3 | OTHER_LDFLAGS = -framework "Foundation"
4 | PODS_ROOT = ${SRCROOT}
5 | SKIP_INSTALL = YES
--------------------------------------------------------------------------------
/SwiftExample/Pods/Target Support Files/dyci/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 0.1.5.6
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/Target Support Files/dyci/dyci-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_dyci : NSObject
3 | @end
4 | @implementation PodsDummy_dyci
5 | @end
6 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/Target Support Files/dyci/dyci-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #endif
4 |
5 |
6 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/Target Support Files/dyci/dyci-umbrella.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | #import "NSSet+ClassesList.h"
4 | #import "SFFileWatcher.h"
5 | #import "SFFileWatcherDelegate.h"
6 | #import "UINib+StoryBoardSupport.h"
7 | #import "UIViewController+XIBSupport.h"
8 | #import "SFInjectionsNotificationsCenter.h"
9 | #import "SFDynamicCodeInjection.h"
10 | #import "NSObject+DyCInjection.h"
11 |
12 | FOUNDATION_EXPORT double dyciVersionNumber;
13 | FOUNDATION_EXPORT const unsigned char dyciVersionString[];
14 |
15 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/Target Support Files/dyci/dyci.modulemap:
--------------------------------------------------------------------------------
1 | framework module dyci {
2 | umbrella header "dyci-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/Target Support Files/dyci/dyci.xcconfig:
--------------------------------------------------------------------------------
1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/dyci" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Reveal-iOS-SDK"
3 | PODS_ROOT = ${SRCROOT}
4 | SKIP_INSTALL = YES
--------------------------------------------------------------------------------
/SwiftExample/Pods/dyci/Dynamic Code Injection/dyci/Classes/Categories/NSSet+ClassesList.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSSet+ClassesList(Classes)
3 | // Dynamic Code Injection
4 | //
5 | // Created by Paul Taykalo on 10/21/12.
6 | // Copyright (c) 2012 Stanfy LLC. All rights reserved.
7 | //
8 | #import
9 |
10 |
11 | #if TARGET_IPHONE_SIMULATOR
12 |
13 | @interface NSSet (ClassesList)
14 |
15 | /*
16 | Returns set of currently registered classes, wrapped with NSValue
17 | */
18 | + (NSMutableSet *)currentClassesSet;
19 |
20 |
21 | @end
22 |
23 | #endif
--------------------------------------------------------------------------------
/SwiftExample/Pods/dyci/Dynamic Code Injection/dyci/Classes/Categories/NSSet+ClassesList.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSSet+ClassesList(Classes)
3 | // Dynamic Code Injection
4 | //
5 | // Created by Paul Taykalo on 10/21/12.
6 | // Copyright (c) 2012 Stanfy LLC. All rights reserved.
7 | //
8 | #import
9 | #import "NSSet+ClassesList.h"
10 |
11 |
12 | #if TARGET_IPHONE_SIMULATOR
13 |
14 | @implementation NSSet (ClassesList)
15 |
16 | + (NSMutableSet *)currentClassesSet {
17 | NSMutableSet * classesSet = [NSMutableSet set];
18 |
19 | int classesCount = objc_getClassList(NULL, 0);
20 | Class * classes = NULL;
21 | if (classesCount > 0) {
22 | classes = (Class *) malloc(sizeof(Class) * classesCount);
23 | classesCount = objc_getClassList(classes, classesCount);
24 | for (int i = 0; i < classesCount; ++i) {
25 | NSValue * wrappedClass = [NSValue value:&classes[i] withObjCType:@encode(Class)];
26 | [classesSet addObject:wrappedClass];
27 | }
28 | free(classes);
29 | }
30 | return classesSet;
31 | }
32 |
33 | @end
34 |
35 | #endif
--------------------------------------------------------------------------------
/SwiftExample/Pods/dyci/Dynamic Code Injection/dyci/Classes/FileWatcher/SFFileWatcher.h:
--------------------------------------------------------------------------------
1 | //
2 | // SFFileWatcher.h
3 | // Dynamic Code Injection
4 | //
5 | // Created by adenisov on 16.10.12.
6 | // Copyright (c) 2012 Stanfy. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "SFFileWatcherDelegate.h"
11 |
12 | #if TARGET_IPHONE_SIMULATOR
13 |
14 | /*
15 | File watcher object.
16 | Watching for changes on the specified path
17 | */
18 | @interface SFFileWatcher : NSObject
19 |
20 | /*
21 | Path on which current watcher is watching
22 | */
23 | @property(nonatomic, readonly) NSString * watchingPath;
24 |
25 | /*
26 | Delegate that will be notified each time, as something changed
27 | */
28 | @property(nonatomic, assign) id delegate;
29 |
30 | /*
31 | Designated initializer
32 | Starts watching on specified path and with specified delegate
33 | */
34 | - (id)initWithFilePath:(NSString *)watchingFilePath delegate:(id)delegate;
35 | + (id)fileWatcherWithPath:(NSString *)watchingFilePath delegate:(id)delegate;
36 |
37 |
38 | @end
39 |
40 | #endif
--------------------------------------------------------------------------------
/SwiftExample/Pods/dyci/Dynamic Code Injection/dyci/Classes/FileWatcher/SFFileWatcher.m:
--------------------------------------------------------------------------------
1 | //
2 | // SFFileWatcher.m
3 | // Dynamic Code Injection
4 | //
5 | // Created by adenisov on 16.10.12.
6 | // Copyright (c) 2012 Stanfy. All rights reserved.
7 | //
8 |
9 | #import "SFFileWatcher.h"
10 |
11 | #if TARGET_IPHONE_SIMULATOR
12 |
13 | @implementation SFFileWatcher {
14 |
15 | /*
16 | Date on what last changes was loaded
17 | */
18 | NSDate *_lastLoadDate;
19 |
20 | /*
21 | Dispatching queue in which file watching operations will be performed
22 | */
23 | dispatch_queue_t _queue;
24 |
25 | /*
26 | Dispatch source of file changes notifications
27 | */
28 | dispatch_source_t _source;
29 | }
30 |
31 |
32 | + (id)fileWatcherWithPath:(NSString *)watchDirectory delegate:(id)delegate {
33 | return [[SFFileWatcher alloc] initWithFilePath:watchDirectory delegate:delegate];
34 | }
35 |
36 |
37 | - (id)initWithFilePath:(NSString *)watchingFilePath delegate:(id)delegate {
38 | self = [super init];
39 | if (self) {
40 | _watchingPath = watchingFilePath;
41 | _delegate = delegate;
42 | _lastLoadDate = [NSDate date];
43 |
44 | [self setupHandlerOnFileChange:_watchingPath];
45 |
46 | }
47 |
48 | return self;
49 |
50 | }
51 |
52 |
53 | - (void)setupHandlerOnFileChange:(NSString *)filePath {
54 |
55 | // Resolving file descriptor
56 | uintptr_t fd = (uintptr_t) open([filePath cStringUsingEncoding:NSUTF8StringEncoding], O_EVTONLY);
57 |
58 | // Setting up queued and source of dispatch events
59 | _queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
60 | _source = dispatch_source_create(DISPATCH_SOURCE_TYPE_VNODE,
61 | (uintptr_t) fd,
62 | DISPATCH_VNODE_WRITE,
63 | _queue);
64 |
65 | __block id weakSelf = self;
66 | dispatch_source_set_event_handler(_source, ^{
67 | dispatch_async(dispatch_get_main_queue(), ^{
68 | [weakSelf checkForFileCreationDate];
69 | });
70 | });
71 |
72 | dispatch_source_set_cancel_handler(_source, ^{
73 | close(fd);
74 | });
75 |
76 | dispatch_resume(_source);
77 | }
78 |
79 |
80 | - (void)checkForFileCreationDate {
81 | NSFileManager * fm = [NSFileManager defaultManager];
82 |
83 | NSArray * files = [fm contentsOfDirectoryAtPath:_watchingPath error:nil];
84 |
85 | // Using the most recent file, but date should be >> _lastLoadData
86 |
87 | for (NSString * file in files) {
88 | NSString * filePath = [_watchingPath stringByAppendingPathComponent:file];
89 | NSDictionary * fileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:filePath error:nil];
90 | NSDate * fileCreationDate = [fileAttributes fileCreationDate];
91 |
92 | // If new file has bigger creation date, then, let's notify our delegate about it
93 | NSTimeInterval diff = [_lastLoadDate timeIntervalSinceDate:fileCreationDate];
94 | if (diff < 0) {
95 | [self.delegate newFileWasFoundAtPath:filePath];
96 | _lastLoadDate = fileCreationDate;
97 | }
98 | }
99 | }
100 |
101 |
102 | @end
103 |
104 | #endif
--------------------------------------------------------------------------------
/SwiftExample/Pods/dyci/Dynamic Code Injection/dyci/Classes/FileWatcher/SFFileWatcherDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // SFFileWatcherDelegate.h
3 | // Dynamic Code Injection
4 | //
5 | // Created by adenisov on 16.10.12.
6 | // Copyright (c) 2012 Stanfy. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 |
12 | #if TARGET_IPHONE_SIMULATOR
13 |
14 | /*
15 | Object that get notified by SFFileWatcher, when some files are changed in the
16 | some directory
17 | */
18 | @protocol SFFileWatcherDelegate
19 |
20 | @optional
21 |
22 | /*
23 | This method will be called each time, when something changes in watching directory
24 | */
25 | - (void)newFileWasFoundAtPath:(NSString *)filePath;
26 |
27 | @end
28 |
29 | #endif
30 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/dyci/Dynamic Code Injection/dyci/Classes/Injections/NSObject+DyCInjection.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSObject+DyCInjection(DCInjection)
3 | // Dynamic Code Injection
4 | //
5 | // Created by Paul Taykalo on 10/21/12.
6 | // Copyright (c) 2012 Stanfy LLC. All rights reserved.
7 | //
8 | #import
9 |
10 | #if TARGET_IPHONE_SIMULATOR
11 |
12 | /*
13 | Methods that will be called on object, that are waiting for injection
14 | */
15 | @interface NSObject (DyCInjection)
16 |
17 |
18 | + (void)allowInjectionSubscriptionOnInitMethod;
19 |
20 | /*
21 | This method will be called in order to determine,
22 | do we need to subscribe to Injection notifications, or not
23 |
24 | By default all objects that have prefixes:
25 | _
26 | NS
27 | CF
28 | Web
29 | UI
30 | DOM
31 | SFInj
32 | OS_
33 |
34 | are skipped
35 |
36 | This behaviour can be changed in next releases
37 | */
38 | + (BOOL)shouldPerformRuntimeCodeInjectionOnObject:(id)instance;
39 |
40 |
41 |
42 | /*
43 | Will be called, when some class (X) will be injected in application runtime
44 | On All instances of class X, and instances of subclasses of X, this method will be called
45 | */
46 | - (void)updateOnClassInjection;
47 |
48 | /*
49 | This method will be called for all classes, that are waiting for resources changes.
50 | Before this method is called, Image cache is flushed, so you don't have to call memory warnings
51 | Resource that was injected is passed with parameter. But in general, you don't need to care
52 |
53 | */
54 | - (void)updateOnResourceInjection:(NSString *)resourcePath;
55 |
56 |
57 | @end
58 |
59 | #endif
--------------------------------------------------------------------------------
/SwiftExample/Pods/dyci/Dynamic Code Injection/dyci/Classes/Injections/NSObject+DyCInjection.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSObject+DyCInjection(DCInjection)
3 | // Dynamic Code Injection
4 | //
5 | // Created by Paul Taykalo on 10/21/12.
6 | // Copyright (c) 2012 Stanfy LLC. All rights reserved.
7 | //
8 |
9 | #if TARGET_IPHONE_SIMULATOR
10 |
11 | #import
12 | #import "NSObject+DyCInjection.h"
13 | //#import "SFDynamicCodeInjection.h"
14 | #import "SFInjectionsNotificationsCenter.h"
15 |
16 |
17 | void swizzle(Class c, SEL orig, SEL new) {
18 | Method origMethod = class_getInstanceMethod(c, orig);
19 | Method newMethod = class_getInstanceMethod(c, new);
20 | if (class_addMethod(c, orig, method_getImplementation(newMethod), method_getTypeEncoding(newMethod))) {
21 | class_replaceMethod(c, new, method_getImplementation(origMethod), method_getTypeEncoding(origMethod));
22 | } else {
23 | method_exchangeImplementations(origMethod, newMethod);
24 | }
25 | }
26 |
27 |
28 | @interface NSObject (DyCInjectionObserver)
29 |
30 | @end
31 |
32 |
33 | @implementation NSObject (DyCInjection)
34 |
35 | #pragma mark - Swizzling
36 |
37 | + (void)allowInjectionSubscriptionOnInitMethod {
38 | swizzle([NSObject class], @selector(init), @selector(_swizzledInit));
39 | swizzle([NSObject class], NSSelectorFromString(@"dealloc"), @selector(_swizzledDealloc));
40 |
41 | // Storyboard support
42 | swizzle(NSClassFromString(@"UINib"), @selector(instantiateWithOwner:options:), @selector(_swizzledInstantiateWithOwner:options:));
43 | }
44 |
45 |
46 | #pragma mark - Subscription check
47 |
48 | + (BOOL)shouldPerformRuntimeCodeInjectionOnObject:(__unsafe_unretained id)instance {
49 | if (!instance) {
50 | return NO;
51 | }
52 |
53 | #warning We should skip more than just NS, CF, and private classes
54 | char const * className = object_getClassName(instance);
55 |
56 | switch (className[0]) {
57 | case '_':
58 | return NO;
59 | case 'N':
60 | if (className[1] == 'S') {
61 | return NO;
62 | }
63 | break;
64 | case 'C':
65 | if (className[1] == 'A' ||
66 | className[1] == 'F' ) {
67 | return NO;
68 | }
69 | break;
70 | case 'U':
71 | if (className[1] == 'I') {
72 | // Allowing to inject UIViewControllers
73 | if (strcmp(className, "UIViewController") == 0) {
74 | return YES;
75 | }
76 | if (strcmp(className, "UITableViewController") == 0) {
77 | return YES;
78 | }
79 | return NO;
80 | }
81 | break;
82 | case 'W':
83 | if (className[1] == 'e' && className[2] == 'b') {
84 | return NO;
85 | }
86 | break;
87 | case 'D':
88 | if (className[1] == 'O' && className[2] == 'M') {
89 | return NO;
90 | }
91 | break;
92 | case 'S':
93 | if (className[1] == 'F' && className[2] == 'I' && className[3] == 'n' && className[4] == 'j') {
94 | return NO;
95 | }
96 | break;
97 | case 'O':
98 | if (className[1] == 'S' && className[2] == '_') {
99 | return NO;
100 | }
101 | break;
102 |
103 | default:
104 | break;
105 | }
106 |
107 | // Disable injection on NSManagedObject object classes
108 | // They have slightly different lifecycle...
109 | Class clz = NSClassFromString(@"NSManagedObject");
110 | if (clz && [instance isKindOfClass:clz]) {
111 | return NO;
112 | }
113 |
114 | return YES;
115 | }
116 |
117 | #pragma mark - On Injection methods
118 |
119 | - (void)updateOnClassInjection {
120 |
121 | }
122 |
123 |
124 | - (void)updateOnResourceInjection:(NSString *)resourcePath {
125 |
126 | }
127 |
128 |
129 | #pragma mark - Swizzled methods
130 |
131 | - (id)_swizzledInit {
132 |
133 | // Calling previous init
134 |
135 | id result = self;
136 | result = [result _swizzledInit];
137 |
138 | if (result) {
139 |
140 | // In case, if we are in need to inject
141 | if ([NSObject shouldPerformRuntimeCodeInjectionOnObject:result]) {
142 | SFInjectionsNotificationsCenter * notificationCenter = [SFInjectionsNotificationsCenter sharedInstance];
143 | [notificationCenter addObserver:result];
144 | }
145 |
146 | }
147 | return result;
148 | }
149 |
150 | - (void)_swizzledDealloc {
151 |
152 | if ([NSObject shouldPerformRuntimeCodeInjectionOnObject:self]) {
153 | [[SFInjectionsNotificationsCenter sharedInstance] removeObserver:self];
154 | }
155 |
156 | // Swizzled methods are fun
157 | // Calling previous dealloc implementation
158 | [self _swizzledDealloc];
159 |
160 | }
161 |
162 | @end
163 |
164 | #endif
165 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/dyci/Dynamic Code Injection/dyci/Classes/Injections/UINib+StoryBoardSupport.h:
--------------------------------------------------------------------------------
1 | //
2 | // UINib(StoryBoardSupport)
3 | // dyci
4 | //
5 | // Created by Paul Taykalo on 5/27/13.
6 | // Copyright (c) 2012 Stanfy LLC. All rights reserved.
7 | //
8 | #import
9 | #import
10 |
11 |
12 | #if TARGET_IPHONE_SIMULATOR
13 |
14 | /*
15 | It seems that storyboard passing some options, when instantiating the nibs
16 | So, we would save those, and reuse after injections
17 | */
18 | @interface UINib (StoryBoardSupport)
19 |
20 |
21 | /*
22 | Returns options, saved for the owner
23 | */
24 | + (NSDictionary *)optionsByOwner:(id)owner;
25 |
26 | @end
27 |
28 | #endif
--------------------------------------------------------------------------------
/SwiftExample/Pods/dyci/Dynamic Code Injection/dyci/Classes/Injections/UINib+StoryBoardSupport.m:
--------------------------------------------------------------------------------
1 | //
2 | // UINib(StoryBoardSupport)
3 | // dyci
4 | //
5 | // Created by Paul Taykalo on 5/27/13.
6 | // Copyright (c) 2012 Stanfy LLC. All rights reserved.
7 | //
8 | #import "UINib+StoryBoardSupport.h"
9 |
10 | #if TARGET_IPHONE_SIMULATOR
11 |
12 |
13 | @implementation UINib (StoryBoardSupport)
14 |
15 | static NSMutableDictionary * cachedOptions;
16 |
17 | - (NSArray *)_swizzledInstantiateWithOwner:(id)owner options:(NSDictionary *)options {
18 |
19 | //
20 | if (!cachedOptions) {
21 | cachedOptions = [[NSMutableDictionary alloc] init];
22 | }
23 |
24 | // Saving options per owner (View Controller address)
25 | if ( owner && options) {
26 | [cachedOptions setObject:options forKey:[NSString stringWithFormat:@"%0x", owner]];
27 | }
28 |
29 | NSArray *items = [self _swizzledInstantiateWithOwner:owner options:options];
30 | return items;
31 | }
32 |
33 |
34 | + (NSDictionary *)optionsByOwner:(id)owner {
35 | NSString * optionsKey = [NSString stringWithFormat:@"%0x", owner];
36 | return cachedOptions[optionsKey];
37 | }
38 |
39 |
40 | @end
41 |
42 | #endif
--------------------------------------------------------------------------------
/SwiftExample/Pods/dyci/Dynamic Code Injection/dyci/Classes/Injections/UIViewController+XIBSupport.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIViewController+XIBSupport.h
3 | // Dynamic Code Ibjection
4 | //
5 | // Created by Paul Taykalo on 11/30/12.
6 | // Copyright (c) 2012 Stanfy. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 |
12 | #if TARGET_IPHONE_SIMULATOR
13 |
14 | /*
15 | This category allows Xibs to be injected in runtime
16 | */
17 | @interface UIViewController (XIBSupport)
18 |
19 | /*
20 | Overriden updateOnResource Injection
21 | this method will check, if injected path is same as our xib,
22 | And will reinitialize xib with new nib instance
23 |
24 | This functionality is experimental. So, in case if it isn't working,
25 | describe the steps, and setup and issue on the Github
26 | https://github.com/DyCI/dyci-main/issues?sort=updated&state=open
27 | */
28 | - (void)updateOnResourceInjection:(NSString *)path;
29 |
30 | @end
31 |
32 | #endif
33 |
--------------------------------------------------------------------------------
/SwiftExample/Pods/dyci/Dynamic Code Injection/dyci/Classes/Notifications/SFInjectionsNotificationsCenter.h:
--------------------------------------------------------------------------------
1 | //
2 | // SFInjectionsNotificationsCenter.h
3 | // dyci-framework
4 | //
5 | // Created by Paul Taykalo on 6/1/13.
6 | // Copyright (c) 2013 Stanfy. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | #if TARGET_IPHONE_SIMULATOR
12 |
13 | @protocol SFInjectionObserver
14 |
15 | /*
16 | Will be called, when some class (X) will be injected in application runtime
17 | On All instances of class X, and instances of subclasses of X, this method will be called
18 | */
19 | - (void)updateOnClassInjection;
20 |
21 | /*
22 | This method will be called for all classes, that are waiting for resources changes.
23 | Before this method is called, Image cache is flushed, so you don't have to call memory warnings
24 | Resource that was injected is passed with parameter. But in general, you don't need to care
25 | */
26 | - (void)updateOnResourceInjection:(NSString *)resourcePath;
27 |
28 | @end
29 |
30 |
31 | /*
32 | This notification center will notify classes about new infection code available
33 | Live classes about new code
34 | This one was made because it seems sometimes classes doesn't remove themself as observers from
35 | Notification Center. And we'll try to understand why it's so
36 |
37 | Also it'll try to understand which classes should be filtered from observing
38 | */
39 | @interface SFInjectionsNotificationsCenter : NSObject
40 |
41 | /*
42 | Returns notification center instance
43 | */
44 | + (instancetype)sharedInstance;
45 |
46 | - (void)addObserver:(id)observer;
47 | - (void)removeObserver:(id)observer;
48 |
49 | /*
50 | This will notify about class injection
51 | */
52 | - (void)notifyOnClassInjection:(Class)class;
53 |
54 | /*
55 | This will notiy all registered classes about that some resource was injected
56 | */
57 | - (void)notifyOnResourceInjection:(NSString *)resourceInjection;
58 |
59 | @end
60 |
61 | #endif
--------------------------------------------------------------------------------
/SwiftExample/Pods/dyci/Dynamic Code Injection/dyci/Classes/Notifications/SFInjectionsNotificationsCenter.m:
--------------------------------------------------------------------------------
1 | //
2 | // SFInjectionsNotificationsCenter.m
3 | // dyci-framework
4 | //
5 | // Created by Paul Taykalo on 6/1/13.
6 | // Copyright (c) 2013 Stanfy. All rights reserved.
7 | //
8 |
9 | #import "SFInjectionsNotificationsCenter.h"
10 |
11 | #if TARGET_IPHONE_SIMULATOR
12 |
13 | @implementation SFInjectionsNotificationsCenter {
14 | NSMutableDictionary * _observers;
15 | }
16 |
17 |
18 | + (instancetype)sharedInstance {
19 | static SFInjectionsNotificationsCenter * _instance = nil;
20 | if (!_instance) {
21 | _instance = [[self alloc] init];
22 | _instance->_observers = [NSMutableDictionary dictionary];
23 | }
24 | return _instance;
25 | }
26 |
27 |
28 | - (void)addObserver:(id)observer {
29 | [self addObserver:observer forClass:[observer class]];
30 | }
31 |
32 |
33 | - (void)removeObserver:(id)observer {
34 | [self removeObserver:observer ofClass:[observer class]];
35 | }
36 |
37 |
38 | - (void)removeObserver:(id)observer ofClass:(Class)class {
39 | @synchronized (_observers) {
40 | NSMutableSet * observersPerClass = [_observers objectForKey:class];
41 | if (observersPerClass) {
42 | @synchronized (observersPerClass) {
43 | [observersPerClass removeObject:observer];
44 | }
45 | }
46 | }
47 | }
48 |
49 |
50 | - (void)addObserver:(id)observer forClass:(Class)class {
51 | if (!class) {
52 | return;
53 | }
54 | @synchronized (_observers) {
55 | NSMutableSet * observersPerClass = [_observers objectForKey:class];
56 | if (!observersPerClass) {
57 | observersPerClass = (__bridge_transfer NSMutableSet *) CFSetCreateMutable(nil, 0, nil);
58 | [_observers setObject:observersPerClass forKey:class];
59 | }
60 | @synchronized (observersPerClass) {
61 | [observersPerClass addObject:observer];
62 | }
63 | }
64 | }
65 |
66 |
67 | /*
68 | This will notify about class injection
69 | */
70 | - (void)notifyOnClassInjection:(Class)injectedClass {
71 | int idx = 0;
72 | @synchronized (_observers) {
73 | for (NSMutableSet * observersPerClass in [_observers allValues]) {
74 | @synchronized (observersPerClass) {
75 | id anyObject = [observersPerClass anyObject];
76 | int localIdx = 0;
77 | if ([anyObject isKindOfClass:injectedClass]) {
78 | for (id observer in observersPerClass) {
79 | [observer updateOnClassInjection];
80 | idx++;
81 | localIdx++;
82 | }
83 | NSLog(@"%d (%@) class instanses were notified on Class Injection : ", localIdx, NSStringFromClass([anyObject class]));
84 | }
85 | }
86 | }
87 | }
88 |
89 | NSLog(@"%d instanses were notified on Class Injection by injecting class: (%@)", idx, NSStringFromClass(injectedClass));
90 | }
91 |
92 |
93 | /*
94 | This will notiy all registered classes about that some resource was injected
95 | */
96 | - (void)notifyOnResourceInjection:(NSString *)resourceInjection {
97 | int idx = 0;
98 | @synchronized (_observers) {
99 | for (NSMutableSet * observersPerClass in [_observers allValues]) {
100 | @synchronized (observersPerClass) {
101 | for (id observer in observersPerClass) {
102 | [observer updateOnResourceInjection:resourceInjection];
103 | idx++;
104 | }
105 | }
106 | }
107 | }
108 | NSLog(@"%d classes instanses were notified on REsource Injection", idx);
109 | }
110 |
111 |
112 | @end
113 |
114 |
115 | #endif
--------------------------------------------------------------------------------
/SwiftExample/Pods/dyci/Dynamic Code Injection/dyci/Classes/SFDynamicCodeInjection.h:
--------------------------------------------------------------------------------
1 | //
2 | // SFDynamicCodeInjection
3 | // Nemlig-iPad
4 | //
5 | // Created by Paul Taykalo on 10/7/12.
6 | // Copyright (c) 2012 Stanfy LLC. All rights reserved.
7 | //
8 | #import
9 |
10 | @interface SFDynamicCodeInjection : NSObject
11 |
12 | /*
13 | Enables dynamic runtime
14 | */
15 | + (void)enable;
16 |
17 | /*
18 | Disables dynamic runtime
19 | */
20 | + (void)disable;
21 |
22 |
23 | @end
--------------------------------------------------------------------------------
/SwiftExample/Pods/dyci/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 Stanfy LLC
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.
--------------------------------------------------------------------------------
/SwiftExample/Pods/dyci/README.md:
--------------------------------------------------------------------------------
1 | # WARNING
2 | **Please, Read this.**
3 | Uninstall dyci before updating Xcode.
4 | In other case, you'll need to reinstall it :(
5 | We're currenlty working on [this issue](https://github.com/DyCI/dyci-main/issues/8)...
6 | If you've already expirienced this issue - remove and reinstall Xcode.
7 |
8 | # dyci
9 | Dynamic code injection tool.
10 | Allows you to inject your code into running iOS application, whithout restarting it.
11 |
12 | ## Installation
13 | If you already know, what this tool is about, you can move to [Installation page](https://github.com/DyCI/dyci-main/wiki/Installation)
14 |
15 | ## Adding to your project
16 | After installation, you need to add dyci library to your project
17 | If you are using [CocoaPods](https://github.com/CocoaPods/CocoaPods), then, just add this line to your PodFile
18 |
19 | `pod 'dyci', :git => 'https://github.com/DyCI/dyci-main.git'`
20 |
21 | If not, then, you can add dyci in [other ways](https://github.com/DyCI/dyci-main/wiki/Using-dyci)
22 |
23 | ## Reasons, why do you need this tool
24 | * It's good for applying small logic changes
25 | * It's good for quick small fixes on big projects.
26 | * It's good for debugging purposes. Remember, you can inject any code at runtime. Logging is the code also.
27 |
28 | ## Differences from other tools
29 | * You need minimum moves to enable dyci
30 | * You aren't writing some kind of script, you are writing your code!
31 | * You don't need to prepare/modify/lock your code for dyci
32 | * Your changes are always saved (They will not be discarded on next run)
33 |
34 | ## How it works
35 | If you curious about How [how it works](https://github.com/DyCI/dyci-main/wiki/How-it-Works), you can read about it in [wiki](https://github.com/DyCI/dyci-main/wiki/How-it-Works).
36 |
37 | ##Example
38 | There's one example in sources
39 | There's video about Tic-Tac-Toe game creation without project restart
40 | [Video at Youtube](https://www.youtube.com/watch?v=8nyEpAqUug4)
41 |
42 |
43 | ##Some points of view
44 | 1. Dyci is not about loading new code in application.
45 | 2. Dyci is about speeding up development.
46 | 3. Each time, you are using dyci, it saves your time.
47 |
48 |
49 | ##WARNING
50 | Please, do not use this tool in your real applications, that you about to publish in App Store. Dyci won't work on devices by default. It was made for purpose. Dynamic code injection is good for development, but it will leave huge security hole if you put it in your application. Please, do not :) I warned you.
51 |
52 | #FAQ
53 | If you have some questions, before asking them , make sure that they aren't listed [here](https://github.com/DyCI/dyci-main/wiki/FAQ)
54 |
55 |
56 |
--------------------------------------------------------------------------------
/SwiftExample/SwiftExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/SwiftExample/SwiftExample.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/SwiftExample/SwiftExample/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // SwiftExample
4 | //
5 | // Created by Krzysztof Zabłocki on 03/11/15.
6 | // Copyright © 2015 pixle. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import KZPlayground
11 |
12 | @UIApplicationMain
13 | class AppDelegate: UIResponder, UIApplicationDelegate {
14 |
15 | var window: UIWindow?
16 |
17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
18 | window = UIWindow(frame: UIScreen.main.bounds)
19 | window?.rootViewController = KZPPlaygroundViewController.new()
20 | window?.makeKeyAndVisible()
21 | return true
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/SwiftExample/SwiftExample/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "ipad",
35 | "size" : "29x29",
36 | "scale" : "1x"
37 | },
38 | {
39 | "idiom" : "ipad",
40 | "size" : "29x29",
41 | "scale" : "2x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "40x40",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "40x40",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "76x76",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "76x76",
61 | "scale" : "2x"
62 | }
63 | ],
64 | "info" : {
65 | "version" : 1,
66 | "author" : "xcode"
67 | }
68 | }
--------------------------------------------------------------------------------
/SwiftExample/SwiftExample/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/SwiftExample/SwiftExample/Assets.xcassets/background.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "background.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/SwiftExample/SwiftExample/Assets.xcassets/background.imageset/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/krzysztofzablocki/Playgrounds/0b1494a04fed2cc7033f2a4f2113eef8b7f50b0f/SwiftExample/SwiftExample/Assets.xcassets/background.imageset/background.png
--------------------------------------------------------------------------------
/SwiftExample/SwiftExample/Assets.xcassets/content.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "scrollList.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/SwiftExample/SwiftExample/Assets.xcassets/content.imageset/scrollList.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/krzysztofzablocki/Playgrounds/0b1494a04fed2cc7033f2a4f2113eef8b7f50b0f/SwiftExample/SwiftExample/Assets.xcassets/content.imageset/scrollList.png
--------------------------------------------------------------------------------
/SwiftExample/SwiftExample/Assets.xcassets/statusBar.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "statusBar.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/SwiftExample/SwiftExample/Assets.xcassets/statusBar.imageset/statusBar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/krzysztofzablocki/Playgrounds/0b1494a04fed2cc7033f2a4f2113eef8b7f50b0f/SwiftExample/SwiftExample/Assets.xcassets/statusBar.imageset/statusBar.png
--------------------------------------------------------------------------------
/SwiftExample/SwiftExample/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/SwiftExample/SwiftExample/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/SwiftExample/SwiftExample/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/SwiftExample/iOSInjectionProject/BundleContents.h:
--------------------------------------------------------------------------------
1 | //
2 | // BundleContents.h
3 | // InjectionBundle
4 | //
5 | // Created by John Holdsworth on 17/01/2012.
6 | // Copyright (c) 2012 John Holdsworth. All rights reserved.
7 | //
8 |
9 | // place any definitions you want available to all injections here
10 |
--------------------------------------------------------------------------------
/SwiftExample/iOSInjectionProject/BundleContents.m:
--------------------------------------------------------------------------------
1 | /*
2 | Generated for Injection of class implementations
3 | */
4 |
5 | #define INJECTION_NOIMPL
6 | #define INJECTION_BUNDLE InjectionBundle9
7 |
8 | #define INJECTION_ENABLED
9 | #import "/tmp/injectionforxcode/BundleInjection.h"
10 |
11 | #undef _instatic
12 | #define _instatic extern
13 |
14 | #undef _inglobal
15 | #define _inglobal extern
16 |
17 | #undef _inval
18 | #define _inval( _val... ) /* = _val */
19 |
20 | #import "BundleContents.h"
21 |
22 | extern
23 | #if __cplusplus
24 | "C" {
25 | #endif
26 | int injectionHook(void);
27 | #if __cplusplus
28 | };
29 | #endif
30 |
31 | @interface InjectionBundle9 : NSObject
32 | @end
33 | @implementation InjectionBundle9
34 |
35 | + (void)load {
36 | Class bundleInjection = NSClassFromString(@"BundleInjection");
37 | [bundleInjection autoLoadedNotify:0 hook:(void *)injectionHook];
38 | }
39 |
40 | @end
41 |
42 | int injectionHook() {
43 | NSLog( @"injectionHook():" );
44 | [InjectionBundle9 load];
45 | return YES;
46 | }
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/SwiftExample/iOSInjectionProject/InjectionBundle-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | English
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | com.johnholdsworth.${PRODUCT_NAME:rfc1034identifier}
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | ${PRODUCT_NAME}
17 | CFBundlePackageType
18 | BNDL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | NSHumanReadableCopyright
26 | Copyright © 2012-2014 John Holdsworth. All rights reserved.
27 | NSPrincipalClass
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/SwiftExample/iOSInjectionProject/InjectionBundle-Prefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // Prefix header for all source files of the 'InjectionBundle' target in the 'InjectionBundle' project
3 | //
4 |
5 | #ifdef __OBJC__
6 | #import
7 | #endif
8 |
--------------------------------------------------------------------------------
/SwiftExample/iOSInjectionProject/x86_64/built.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/krzysztofzablocki/Playgrounds/0b1494a04fed2cc7033f2a4f2113eef8b7f50b0f/SwiftExample/iOSInjectionProject/x86_64/built.txt
--------------------------------------------------------------------------------
/SwiftExample/iOSInjectionProject/x86_64/identity.txt:
--------------------------------------------------------------------------------
1 | /Users/merowing/Library/Developer/Xcode/DerivedData/SwiftExample-biegeyiatvnfylfnucrxgfhtbsyu/Build/Products/Debug-iphonesimulator/SwiftExample.app
2 |
3 |
--------------------------------------------------------------------------------
/SwiftExample/iOSInjectionProject/x86_64/injecting_class.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/krzysztofzablocki/Playgrounds/0b1494a04fed2cc7033f2a4f2113eef8b7f50b0f/SwiftExample/iOSInjectionProject/x86_64/injecting_class.o
--------------------------------------------------------------------------------