This commit is contained in:
Sami Samhuri 2015-05-03 16:10:13 -07:00
parent dcb83ce6da
commit e24cbd9aac
53 changed files with 3735 additions and 2097 deletions

View file

@ -9,6 +9,7 @@ target :Blog do
pod 'YapDatabase'
pod 'libextobjc'
pod 'ObjectiveSugar'
pod 'dyci'
end
target :BlogTests do

View file

@ -4,6 +4,9 @@ PODS:
- CocoaLumberjack/Core (1.9.2)
- CocoaLumberjack/Extensions (1.9.2):
- CocoaLumberjack/Core
- dyci (0.1.5.6):
- dyci/Injections (= 0.1.5.6)
- dyci/Injections (0.1.5.6)
- libextobjc (0.4.1):
- libextobjc/EXTADT (= 0.4.1)
- libextobjc/EXTConcreteProtocol (= 0.4.1)
@ -92,6 +95,7 @@ PODS:
- YapDatabase/common
DEPENDENCIES:
- dyci
- libextobjc
- Mantle
- ObjectiveSugar
@ -100,6 +104,7 @@ DEPENDENCIES:
SPEC CHECKSUMS:
CocoaLumberjack: 628fca2e88ef06f7cf6817309aa405f325d9a6fa
dyci: 099c2e6dc98abb8f21b370cabbf1443ff700608a
libextobjc: a650fc1bf489a3d3a9bc2e621efa3e1006fc5471
Mantle: 17de73ef929db2234d76fde2aacfb89ab11c61e8
ObjectiveSugar: a6a25f23d657c19df0a0b972466d5b5ca9f5295c
@ -107,4 +112,4 @@ SPEC CHECKSUMS:
PromiseKit: b333c1baae651ed1fdfb4f6f4ef18d7ca118931e
YapDatabase: 13566c87dc9226a0f15d755edba08e8ad94cac9f
COCOAPODS: 0.36.4
COCOAPODS: 0.37.0.rc.2

View file

@ -0,0 +1 @@
../../../dyci/Dynamic Code Injection/dyci/Classes/Injections/NSObject+DyCInjection.h

View file

@ -0,0 +1 @@
../../../dyci/Dynamic Code Injection/dyci/Classes/Categories/NSSet+ClassesList.h

View file

@ -0,0 +1 @@
../../../dyci/Dynamic Code Injection/dyci/Classes/SFDynamicCodeInjection.h

1
Pods/Headers/Private/dyci/SFFileWatcher.h generated Symbolic link
View file

@ -0,0 +1 @@
../../../dyci/Dynamic Code Injection/dyci/Classes/FileWatcher/SFFileWatcher.h

View file

@ -0,0 +1 @@
../../../dyci/Dynamic Code Injection/dyci/Classes/FileWatcher/SFFileWatcherDelegate.h

View file

@ -0,0 +1 @@
../../../dyci/Dynamic Code Injection/dyci/Classes/Notifications/SFInjectionsNotificationsCenter.h

View file

@ -0,0 +1 @@
../../../dyci/Dynamic Code Injection/dyci/Classes/Injections/UINib+StoryBoardSupport.h

View file

@ -0,0 +1 @@
../../../dyci/Dynamic Code Injection/dyci/Classes/Injections/UIViewController+XIBSupport.h

View file

@ -0,0 +1 @@
../../../dyci/Dynamic Code Injection/dyci/Classes/Injections/NSObject+DyCInjection.h

View file

@ -0,0 +1 @@
../../../dyci/Dynamic Code Injection/dyci/Classes/Categories/NSSet+ClassesList.h

View file

@ -0,0 +1 @@
../../../dyci/Dynamic Code Injection/dyci/Classes/SFDynamicCodeInjection.h

1
Pods/Headers/Public/dyci/SFFileWatcher.h generated Symbolic link
View file

@ -0,0 +1 @@
../../../dyci/Dynamic Code Injection/dyci/Classes/FileWatcher/SFFileWatcher.h

View file

@ -0,0 +1 @@
../../../dyci/Dynamic Code Injection/dyci/Classes/FileWatcher/SFFileWatcherDelegate.h

View file

@ -0,0 +1 @@
../../../dyci/Dynamic Code Injection/dyci/Classes/Notifications/SFInjectionsNotificationsCenter.h

View file

@ -0,0 +1 @@
../../../dyci/Dynamic Code Injection/dyci/Classes/Injections/UINib+StoryBoardSupport.h

View file

@ -0,0 +1 @@
../../../dyci/Dynamic Code Injection/dyci/Classes/Injections/UIViewController+XIBSupport.h

7
Pods/Manifest.lock generated
View file

@ -4,6 +4,9 @@ PODS:
- CocoaLumberjack/Core (1.9.2)
- CocoaLumberjack/Extensions (1.9.2):
- CocoaLumberjack/Core
- dyci (0.1.5.6):
- dyci/Injections (= 0.1.5.6)
- dyci/Injections (0.1.5.6)
- libextobjc (0.4.1):
- libextobjc/EXTADT (= 0.4.1)
- libextobjc/EXTConcreteProtocol (= 0.4.1)
@ -92,6 +95,7 @@ PODS:
- YapDatabase/common
DEPENDENCIES:
- dyci
- libextobjc
- Mantle
- ObjectiveSugar
@ -100,6 +104,7 @@ DEPENDENCIES:
SPEC CHECKSUMS:
CocoaLumberjack: 628fca2e88ef06f7cf6817309aa405f325d9a6fa
dyci: 099c2e6dc98abb8f21b370cabbf1443ff700608a
libextobjc: a650fc1bf489a3d3a9bc2e621efa3e1006fc5471
Mantle: 17de73ef929db2234d76fde2aacfb89ab11c61e8
ObjectiveSugar: a6a25f23d657c19df0a0b972466d5b5ca9f5295c
@ -107,4 +112,4 @@ SPEC CHECKSUMS:
PromiseKit: b333c1baae651ed1fdfb4f6f4ef18d7ca118931e
YapDatabase: 13566c87dc9226a0f15d755edba08e8ad94cac9f
COCOAPODS: 0.36.4
COCOAPODS: 0.37.0.rc.2

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
#include "Pods-Blog-CocoaLumberjack.xcconfig"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/CocoaLumberjack" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/Mantle" "${PODS_ROOT}/Headers/Public/OMGHTTPURLRQ" "${PODS_ROOT}/Headers/Public/ObjectiveSugar" "${PODS_ROOT}/Headers/Public/PromiseKit" "${PODS_ROOT}/Headers/Public/YapDatabase" "${PODS_ROOT}/Headers/Public/libextobjc"
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/CocoaLumberjack" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/Mantle" "${PODS_ROOT}/Headers/Public/OMGHTTPURLRQ" "${PODS_ROOT}/Headers/Public/ObjectiveSugar" "${PODS_ROOT}/Headers/Public/PromiseKit" "${PODS_ROOT}/Headers/Public/YapDatabase" "${PODS_ROOT}/Headers/Public/dyci" "${PODS_ROOT}/Headers/Public/libextobjc"
OTHER_LDFLAGS = -ObjC
PODS_ROOT = ${SRCROOT}
SKIP_INSTALL = YES

View file

@ -1,6 +1,6 @@
#include "Pods-Blog-Mantle.xcconfig"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Mantle" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/Mantle" "${PODS_ROOT}/Headers/Public/OMGHTTPURLRQ" "${PODS_ROOT}/Headers/Public/ObjectiveSugar" "${PODS_ROOT}/Headers/Public/PromiseKit" "${PODS_ROOT}/Headers/Public/YapDatabase" "${PODS_ROOT}/Headers/Public/libextobjc"
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Mantle" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/Mantle" "${PODS_ROOT}/Headers/Public/OMGHTTPURLRQ" "${PODS_ROOT}/Headers/Public/ObjectiveSugar" "${PODS_ROOT}/Headers/Public/PromiseKit" "${PODS_ROOT}/Headers/Public/YapDatabase" "${PODS_ROOT}/Headers/Public/dyci" "${PODS_ROOT}/Headers/Public/libextobjc"
OTHER_LDFLAGS = ${PODS_BLOG_MANTLE_OTHER_LDFLAGS} -ObjC
PODS_ROOT = ${SRCROOT}
SKIP_INSTALL = YES

View file

@ -1,6 +1,6 @@
#include "Pods-Blog-OMGHTTPURLRQ.xcconfig"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/OMGHTTPURLRQ" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/Mantle" "${PODS_ROOT}/Headers/Public/OMGHTTPURLRQ" "${PODS_ROOT}/Headers/Public/ObjectiveSugar" "${PODS_ROOT}/Headers/Public/PromiseKit" "${PODS_ROOT}/Headers/Public/YapDatabase" "${PODS_ROOT}/Headers/Public/libextobjc"
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/OMGHTTPURLRQ" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/Mantle" "${PODS_ROOT}/Headers/Public/OMGHTTPURLRQ" "${PODS_ROOT}/Headers/Public/ObjectiveSugar" "${PODS_ROOT}/Headers/Public/PromiseKit" "${PODS_ROOT}/Headers/Public/YapDatabase" "${PODS_ROOT}/Headers/Public/dyci" "${PODS_ROOT}/Headers/Public/libextobjc"
OTHER_LDFLAGS = -ObjC
PODS_ROOT = ${SRCROOT}
SKIP_INSTALL = YES

View file

@ -1,6 +1,6 @@
#include "Pods-Blog-ObjectiveSugar.xcconfig"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/ObjectiveSugar" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/Mantle" "${PODS_ROOT}/Headers/Public/OMGHTTPURLRQ" "${PODS_ROOT}/Headers/Public/ObjectiveSugar" "${PODS_ROOT}/Headers/Public/PromiseKit" "${PODS_ROOT}/Headers/Public/YapDatabase" "${PODS_ROOT}/Headers/Public/libextobjc"
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/ObjectiveSugar" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/Mantle" "${PODS_ROOT}/Headers/Public/OMGHTTPURLRQ" "${PODS_ROOT}/Headers/Public/ObjectiveSugar" "${PODS_ROOT}/Headers/Public/PromiseKit" "${PODS_ROOT}/Headers/Public/YapDatabase" "${PODS_ROOT}/Headers/Public/dyci" "${PODS_ROOT}/Headers/Public/libextobjc"
OTHER_LDFLAGS = -ObjC
PODS_ROOT = ${SRCROOT}
SKIP_INSTALL = YES

View file

@ -1,6 +1,6 @@
#include "Pods-Blog-PromiseKit.xcconfig"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 ${PODS_BLOG_PROMISEKIT_GCC_PREPROCESSOR_DEFINITIONS}
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/PromiseKit" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/Mantle" "${PODS_ROOT}/Headers/Public/OMGHTTPURLRQ" "${PODS_ROOT}/Headers/Public/ObjectiveSugar" "${PODS_ROOT}/Headers/Public/PromiseKit" "${PODS_ROOT}/Headers/Public/YapDatabase" "${PODS_ROOT}/Headers/Public/libextobjc"
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/PromiseKit" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/Mantle" "${PODS_ROOT}/Headers/Public/OMGHTTPURLRQ" "${PODS_ROOT}/Headers/Public/ObjectiveSugar" "${PODS_ROOT}/Headers/Public/PromiseKit" "${PODS_ROOT}/Headers/Public/YapDatabase" "${PODS_ROOT}/Headers/Public/dyci" "${PODS_ROOT}/Headers/Public/libextobjc"
OTHER_LDFLAGS = ${PODS_BLOG_PROMISEKIT_OTHER_LDFLAGS} -ObjC
PODS_ROOT = ${SRCROOT}
SKIP_INSTALL = YES

View file

@ -1,6 +1,6 @@
#include "Pods-Blog-YapDatabase.xcconfig"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/YapDatabase" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/Mantle" "${PODS_ROOT}/Headers/Public/OMGHTTPURLRQ" "${PODS_ROOT}/Headers/Public/ObjectiveSugar" "${PODS_ROOT}/Headers/Public/PromiseKit" "${PODS_ROOT}/Headers/Public/YapDatabase" "${PODS_ROOT}/Headers/Public/libextobjc"
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/YapDatabase" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/Mantle" "${PODS_ROOT}/Headers/Public/OMGHTTPURLRQ" "${PODS_ROOT}/Headers/Public/ObjectiveSugar" "${PODS_ROOT}/Headers/Public/PromiseKit" "${PODS_ROOT}/Headers/Public/YapDatabase" "${PODS_ROOT}/Headers/Public/dyci" "${PODS_ROOT}/Headers/Public/libextobjc"
OTHER_LDFLAGS = ${PODS_BLOG_YAPDATABASE_OTHER_LDFLAGS} -ObjC
PODS_ROOT = ${SRCROOT}
SKIP_INSTALL = YES

View file

@ -0,0 +1,6 @@
#include "Pods-Blog-dyci.xcconfig"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/dyci" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/Mantle" "${PODS_ROOT}/Headers/Public/OMGHTTPURLRQ" "${PODS_ROOT}/Headers/Public/ObjectiveSugar" "${PODS_ROOT}/Headers/Public/PromiseKit" "${PODS_ROOT}/Headers/Public/YapDatabase" "${PODS_ROOT}/Headers/Public/dyci" "${PODS_ROOT}/Headers/Public/libextobjc"
OTHER_LDFLAGS = -ObjC
PODS_ROOT = ${SRCROOT}
SKIP_INSTALL = YES

View file

@ -0,0 +1,5 @@
#import <Foundation/Foundation.h>
@interface PodsDummy_Pods_Blog_dyci : NSObject
@end
@implementation PodsDummy_Pods_Blog_dyci
@end

View file

@ -0,0 +1,6 @@
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#endif
#import "Pods-Blog-environment.h"

View file

@ -1,6 +1,6 @@
#include "Pods-Blog-libextobjc.xcconfig"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/libextobjc" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/Mantle" "${PODS_ROOT}/Headers/Public/OMGHTTPURLRQ" "${PODS_ROOT}/Headers/Public/ObjectiveSugar" "${PODS_ROOT}/Headers/Public/PromiseKit" "${PODS_ROOT}/Headers/Public/YapDatabase" "${PODS_ROOT}/Headers/Public/libextobjc"
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/libextobjc" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/Mantle" "${PODS_ROOT}/Headers/Public/OMGHTTPURLRQ" "${PODS_ROOT}/Headers/Public/ObjectiveSugar" "${PODS_ROOT}/Headers/Public/PromiseKit" "${PODS_ROOT}/Headers/Public/YapDatabase" "${PODS_ROOT}/Headers/Public/dyci" "${PODS_ROOT}/Headers/Public/libextobjc"
OTHER_LDFLAGS = -ObjC
PODS_ROOT = ${SRCROOT}
SKIP_INSTALL = YES

View file

@ -106,6 +106,30 @@ with or without modification, are permitted provided that the following conditio
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
## dyci
The MIT License (MIT)
Copyright (c) 2014 Stanfy LLC
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
## libextobjc
**Copyright (c) 2012 - 2014 Justin Spahr-Summers**

View file

@ -141,6 +141,34 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>FooterText</key>
<string>The MIT License (MIT)
Copyright (c) 2014 Stanfy LLC
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.</string>
<key>Title</key>
<string>dyci</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>FooterText</key>
<string>**Copyright (c) 2012 - 2014 Justin Spahr-Summers**

View file

@ -156,6 +156,20 @@
#define COCOAPODS_VERSION_MINOR_YapDatabase_standard 6
#define COCOAPODS_VERSION_PATCH_YapDatabase_standard 1
// dyci
#define COCOAPODS_POD_AVAILABLE_dyci
// This library does not follow semantic-versioning,
// so we were not able to define version macros.
// Please contact the author.
// Version: 0.1.5.6.
// dyci/Injections
#define COCOAPODS_POD_AVAILABLE_dyci_Injections
// This library does not follow semantic-versioning,
// so we were not able to define version macros.
// Please contact the author.
// Version: 0.1.5.6.
// libextobjc
#define COCOAPODS_POD_AVAILABLE_libextobjc
#define COCOAPODS_VERSION_MAJOR_libextobjc 0

View file

@ -1,6 +1,6 @@
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 $(inherited) PMK_CALAYER=1 $(inherited) PMK_NSNOTIFICATIONCENTER=1 $(inherited) PMK_NSURLCONNECTION=1 $(inherited) PMK_PAUSE=1 $(inherited) PMK_UIACTIONSHEET=1 $(inherited) PMK_UIALERTVIEW=1 $(inherited) PMK_UIVIEW=1 $(inherited) PMK_UIVIEWCONTROLLER=1 $(inherited) PMK_UNTIL=1 $(inherited) PMK_WHEN=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/Mantle" "${PODS_ROOT}/Headers/Public/OMGHTTPURLRQ" "${PODS_ROOT}/Headers/Public/ObjectiveSugar" "${PODS_ROOT}/Headers/Public/PromiseKit" "${PODS_ROOT}/Headers/Public/YapDatabase" "${PODS_ROOT}/Headers/Public/libextobjc"
OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/CocoaLumberjack" -isystem "${PODS_ROOT}/Headers/Public/Mantle" -isystem "${PODS_ROOT}/Headers/Public/OMGHTTPURLRQ" -isystem "${PODS_ROOT}/Headers/Public/ObjectiveSugar" -isystem "${PODS_ROOT}/Headers/Public/PromiseKit" -isystem "${PODS_ROOT}/Headers/Public/YapDatabase" -isystem "${PODS_ROOT}/Headers/Public/libextobjc"
OTHER_LDFLAGS = $(inherited) -ObjC -weak_library /usr/lib/libc++.dylib -l"Pods-Blog-CocoaLumberjack" -l"Pods-Blog-Mantle" -l"Pods-Blog-OMGHTTPURLRQ" -l"Pods-Blog-ObjectiveSugar" -l"Pods-Blog-PromiseKit" -l"Pods-Blog-YapDatabase" -l"Pods-Blog-libextobjc" -l"sqlite3" -framework "Foundation" -framework "QuartzCore" -framework "UIKit" -weak_framework "AssetsLibrary"
HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/Mantle" "${PODS_ROOT}/Headers/Public/OMGHTTPURLRQ" "${PODS_ROOT}/Headers/Public/ObjectiveSugar" "${PODS_ROOT}/Headers/Public/PromiseKit" "${PODS_ROOT}/Headers/Public/YapDatabase" "${PODS_ROOT}/Headers/Public/dyci" "${PODS_ROOT}/Headers/Public/libextobjc"
OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/CocoaLumberjack" -isystem "${PODS_ROOT}/Headers/Public/Mantle" -isystem "${PODS_ROOT}/Headers/Public/OMGHTTPURLRQ" -isystem "${PODS_ROOT}/Headers/Public/ObjectiveSugar" -isystem "${PODS_ROOT}/Headers/Public/PromiseKit" -isystem "${PODS_ROOT}/Headers/Public/YapDatabase" -isystem "${PODS_ROOT}/Headers/Public/dyci" -isystem "${PODS_ROOT}/Headers/Public/libextobjc"
OTHER_LDFLAGS = $(inherited) -ObjC -weak_library /usr/lib/libc++.dylib -l"Pods-Blog-CocoaLumberjack" -l"Pods-Blog-Mantle" -l"Pods-Blog-OMGHTTPURLRQ" -l"Pods-Blog-ObjectiveSugar" -l"Pods-Blog-PromiseKit" -l"Pods-Blog-YapDatabase" -l"Pods-Blog-dyci" -l"Pods-Blog-libextobjc" -l"sqlite3" -framework "Foundation" -framework "QuartzCore" -framework "UIKit" -weak_framework "AssetsLibrary"
OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS)
PODS_ROOT = ${SRCROOT}/Pods

View file

@ -1,6 +1,6 @@
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 $(inherited) PMK_CALAYER=1 $(inherited) PMK_NSNOTIFICATIONCENTER=1 $(inherited) PMK_NSURLCONNECTION=1 $(inherited) PMK_PAUSE=1 $(inherited) PMK_UIACTIONSHEET=1 $(inherited) PMK_UIALERTVIEW=1 $(inherited) PMK_UIVIEW=1 $(inherited) PMK_UIVIEWCONTROLLER=1 $(inherited) PMK_UNTIL=1 $(inherited) PMK_WHEN=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/Mantle" "${PODS_ROOT}/Headers/Public/OMGHTTPURLRQ" "${PODS_ROOT}/Headers/Public/ObjectiveSugar" "${PODS_ROOT}/Headers/Public/PromiseKit" "${PODS_ROOT}/Headers/Public/YapDatabase" "${PODS_ROOT}/Headers/Public/libextobjc"
OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/CocoaLumberjack" -isystem "${PODS_ROOT}/Headers/Public/Mantle" -isystem "${PODS_ROOT}/Headers/Public/OMGHTTPURLRQ" -isystem "${PODS_ROOT}/Headers/Public/ObjectiveSugar" -isystem "${PODS_ROOT}/Headers/Public/PromiseKit" -isystem "${PODS_ROOT}/Headers/Public/YapDatabase" -isystem "${PODS_ROOT}/Headers/Public/libextobjc"
OTHER_LDFLAGS = $(inherited) -ObjC -weak_library /usr/lib/libc++.dylib -l"Pods-Blog-CocoaLumberjack" -l"Pods-Blog-Mantle" -l"Pods-Blog-OMGHTTPURLRQ" -l"Pods-Blog-ObjectiveSugar" -l"Pods-Blog-PromiseKit" -l"Pods-Blog-YapDatabase" -l"Pods-Blog-libextobjc" -l"sqlite3" -framework "Foundation" -framework "QuartzCore" -framework "UIKit" -weak_framework "AssetsLibrary"
HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CocoaLumberjack" "${PODS_ROOT}/Headers/Public/Mantle" "${PODS_ROOT}/Headers/Public/OMGHTTPURLRQ" "${PODS_ROOT}/Headers/Public/ObjectiveSugar" "${PODS_ROOT}/Headers/Public/PromiseKit" "${PODS_ROOT}/Headers/Public/YapDatabase" "${PODS_ROOT}/Headers/Public/dyci" "${PODS_ROOT}/Headers/Public/libextobjc"
OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/CocoaLumberjack" -isystem "${PODS_ROOT}/Headers/Public/Mantle" -isystem "${PODS_ROOT}/Headers/Public/OMGHTTPURLRQ" -isystem "${PODS_ROOT}/Headers/Public/ObjectiveSugar" -isystem "${PODS_ROOT}/Headers/Public/PromiseKit" -isystem "${PODS_ROOT}/Headers/Public/YapDatabase" -isystem "${PODS_ROOT}/Headers/Public/dyci" -isystem "${PODS_ROOT}/Headers/Public/libextobjc"
OTHER_LDFLAGS = $(inherited) -ObjC -weak_library /usr/lib/libc++.dylib -l"Pods-Blog-CocoaLumberjack" -l"Pods-Blog-Mantle" -l"Pods-Blog-OMGHTTPURLRQ" -l"Pods-Blog-ObjectiveSugar" -l"Pods-Blog-PromiseKit" -l"Pods-Blog-YapDatabase" -l"Pods-Blog-dyci" -l"Pods-Blog-libextobjc" -l"sqlite3" -framework "Foundation" -framework "QuartzCore" -framework "UIKit" -weak_framework "AssetsLibrary"
OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS)
PODS_ROOT = ${SRCROOT}/Pods

View file

@ -0,0 +1,23 @@
//
// NSSet+ClassesList(Classes)
// Dynamic Code Injection
//
// Created by Paul Taykalo on 10/21/12.
// Copyright (c) 2012 Stanfy LLC. All rights reserved.
//
#import <Foundation/Foundation.h>
#if TARGET_IPHONE_SIMULATOR
@interface NSSet (ClassesList)
/*
Returns set of currently registered classes, wrapped with NSValue
*/
+ (NSMutableSet *)currentClassesSet;
@end
#endif

View file

@ -0,0 +1,35 @@
//
// NSSet+ClassesList(Classes)
// Dynamic Code Injection
//
// Created by Paul Taykalo on 10/21/12.
// Copyright (c) 2012 Stanfy LLC. All rights reserved.
//
#import <objc/runtime.h>
#import "NSSet+ClassesList.h"
#if TARGET_IPHONE_SIMULATOR
@implementation NSSet (ClassesList)
+ (NSMutableSet *)currentClassesSet {
NSMutableSet * classesSet = [NSMutableSet set];
int classesCount = objc_getClassList(NULL, 0);
Class * classes = NULL;
if (classesCount > 0) {
classes = (Class *) malloc(sizeof(Class) * classesCount);
classesCount = objc_getClassList(classes, classesCount);
for (int i = 0; i < classesCount; ++i) {
NSValue * wrappedClass = [NSValue value:&classes[i] withObjCType:@encode(Class)];
[classesSet addObject:wrappedClass];
}
free(classes);
}
return classesSet;
}
@end
#endif

View file

@ -0,0 +1,40 @@
//
// SFFileWatcher.h
// Dynamic Code Injection
//
// Created by adenisov on 16.10.12.
// Copyright (c) 2012 Stanfy. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "SFFileWatcherDelegate.h"
#if TARGET_IPHONE_SIMULATOR
/*
File watcher object.
Watching for changes on the specified path
*/
@interface SFFileWatcher : NSObject
/*
Path on which current watcher is watching
*/
@property(nonatomic, readonly) NSString * watchingPath;
/*
Delegate that will be notified each time, as something changed
*/
@property(nonatomic, assign) id<SFFileWatcherDelegate> delegate;
/*
Designated initializer
Starts watching on specified path and with specified delegate
*/
- (id)initWithFilePath:(NSString *)watchingFilePath delegate:(id<SFFileWatcherDelegate>)delegate;
+ (id)fileWatcherWithPath:(NSString *)watchingFilePath delegate:(id<SFFileWatcherDelegate>)delegate;
@end
#endif

View file

@ -0,0 +1,104 @@
//
// SFFileWatcher.m
// Dynamic Code Injection
//
// Created by adenisov on 16.10.12.
// Copyright (c) 2012 Stanfy. All rights reserved.
//
#import "SFFileWatcher.h"
#if TARGET_IPHONE_SIMULATOR
@implementation SFFileWatcher {
/*
Date on what last changes was loaded
*/
NSDate *_lastLoadDate;
/*
Dispatching queue in which file watching operations will be performed
*/
dispatch_queue_t _queue;
/*
Dispatch source of file changes notifications
*/
dispatch_source_t _source;
}
+ (id)fileWatcherWithPath:(NSString *)watchDirectory delegate:(id<SFFileWatcherDelegate>)delegate {
return [[SFFileWatcher alloc] initWithFilePath:watchDirectory delegate:delegate];
}
- (id)initWithFilePath:(NSString *)watchingFilePath delegate:(id<SFFileWatcherDelegate>)delegate {
self = [super init];
if (self) {
_watchingPath = watchingFilePath;
_delegate = delegate;
_lastLoadDate = [NSDate date];
[self setupHandlerOnFileChange:_watchingPath];
}
return self;
}
- (void)setupHandlerOnFileChange:(NSString *)filePath {
// Resolving file descriptor
uintptr_t fd = (uintptr_t) open([filePath cStringUsingEncoding:NSUTF8StringEncoding], O_EVTONLY);
// Setting up queued and source of dispatch events
_queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
_source = dispatch_source_create(DISPATCH_SOURCE_TYPE_VNODE,
(uintptr_t) fd,
DISPATCH_VNODE_WRITE,
_queue);
__block id weakSelf = self;
dispatch_source_set_event_handler(_source, ^{
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf checkForFileCreationDate];
});
});
dispatch_source_set_cancel_handler(_source, ^{
close(fd);
});
dispatch_resume(_source);
}
- (void)checkForFileCreationDate {
NSFileManager * fm = [NSFileManager defaultManager];
NSArray * files = [fm contentsOfDirectoryAtPath:_watchingPath error:nil];
// Using the most recent file, but date should be >> _lastLoadData
for (NSString * file in files) {
NSString * filePath = [_watchingPath stringByAppendingPathComponent:file];
NSDictionary * fileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:filePath error:nil];
NSDate * fileCreationDate = [fileAttributes fileCreationDate];
// If new file has bigger creation date, then, let's notify our delegate about it
NSTimeInterval diff = [_lastLoadDate timeIntervalSinceDate:fileCreationDate];
if (diff < 0) {
[self.delegate newFileWasFoundAtPath:filePath];
_lastLoadDate = fileCreationDate;
}
}
}
@end
#endif

View file

@ -0,0 +1,29 @@
//
// SFFileWatcherDelegate.h
// Dynamic Code Injection
//
// Created by adenisov on 16.10.12.
// Copyright (c) 2012 Stanfy. All rights reserved.
//
#import <Foundation/Foundation.h>
#if TARGET_IPHONE_SIMULATOR
/*
Object that get notified by SFFileWatcher, when some files are changed in the
some directory
*/
@protocol SFFileWatcherDelegate<NSObject>
@optional
/*
This method will be called each time, when something changes in watching directory
*/
- (void)newFileWasFoundAtPath:(NSString *)filePath;
@end
#endif

View file

@ -0,0 +1,59 @@
//
// NSObject+DyCInjection(DCInjection)
// Dynamic Code Injection
//
// Created by Paul Taykalo on 10/21/12.
// Copyright (c) 2012 Stanfy LLC. All rights reserved.
//
#import <Foundation/Foundation.h>
#if TARGET_IPHONE_SIMULATOR
/*
Methods that will be called on object, that are waiting for injection
*/
@interface NSObject (DyCInjection)
+ (void)allowInjectionSubscriptionOnInitMethod;
/*
This method will be called in order to determine,
do we need to subscribe to Injection notifications, or not
By default all objects that have prefixes:
_
NS
CF
Web
UI
DOM
SFInj
OS_
are skipped
This behaviour can be changed in next releases
*/
+ (BOOL)shouldPerformRuntimeCodeInjectionOnObject:(id)instance;
/*
Will be called, when some class (X) will be injected in application runtime
On All instances of class X, and instances of subclasses of X, this method will be called
*/
- (void)updateOnClassInjection;
/*
This method will be called for all classes, that are waiting for resources changes.
Before this method is called, Image cache is flushed, so you don't have to call memory warnings
Resource that was injected is passed with parameter. But in general, you don't need to care
*/
- (void)updateOnResourceInjection:(NSString *)resourcePath;
@end
#endif

View file

@ -0,0 +1,164 @@
//
// NSObject+DyCInjection(DCInjection)
// Dynamic Code Injection
//
// Created by Paul Taykalo on 10/21/12.
// Copyright (c) 2012 Stanfy LLC. All rights reserved.
//
#if TARGET_IPHONE_SIMULATOR
#import <objc/runtime.h>
#import "NSObject+DyCInjection.h"
//#import "SFDynamicCodeInjection.h"
#import "SFInjectionsNotificationsCenter.h"
void swizzle(Class c, SEL orig, SEL new) {
Method origMethod = class_getInstanceMethod(c, orig);
Method newMethod = class_getInstanceMethod(c, new);
if (class_addMethod(c, orig, method_getImplementation(newMethod), method_getTypeEncoding(newMethod))) {
class_replaceMethod(c, new, method_getImplementation(origMethod), method_getTypeEncoding(origMethod));
} else {
method_exchangeImplementations(origMethod, newMethod);
}
}
@interface NSObject (DyCInjectionObserver) <SFInjectionObserver>
@end
@implementation NSObject (DyCInjection)
#pragma mark - Swizzling
+ (void)allowInjectionSubscriptionOnInitMethod {
swizzle([NSObject class], @selector(init), @selector(_swizzledInit));
swizzle([NSObject class], NSSelectorFromString(@"dealloc"), @selector(_swizzledDealloc));
// Storyboard support
swizzle(NSClassFromString(@"UINib"), @selector(instantiateWithOwner:options:), @selector(_swizzledInstantiateWithOwner:options:));
}
#pragma mark - Subscription check
+ (BOOL)shouldPerformRuntimeCodeInjectionOnObject:(__unsafe_unretained id)instance {
if (!instance) {
return NO;
}
#warning We should skip more than just NS, CF, and private classes
char const * className = object_getClassName(instance);
switch (className[0]) {
case '_':
return NO;
case 'N':
if (className[1] == 'S') {
return NO;
}
break;
case 'C':
if (className[1] == 'A' ||
className[1] == 'F' ) {
return NO;
}
break;
case 'U':
if (className[1] == 'I') {
// Allowing to inject UIViewControllers
if (strcmp(className, "UIViewController") == 0) {
return YES;
}
if (strcmp(className, "UITableViewController") == 0) {
return YES;
}
return NO;
}
break;
case 'W':
if (className[1] == 'e' && className[2] == 'b') {
return NO;
}
break;
case 'D':
if (className[1] == 'O' && className[2] == 'M') {
return NO;
}
break;
case 'S':
if (className[1] == 'F' && className[2] == 'I' && className[3] == 'n' && className[4] == 'j') {
return NO;
}
break;
case 'O':
if (className[1] == 'S' && className[2] == '_') {
return NO;
}
break;
default:
break;
}
// Disable injection on NSManagedObject object classes
// They have slightly different lifecycle...
Class clz = NSClassFromString(@"NSManagedObject");
if (clz && [instance isKindOfClass:clz]) {
return NO;
}
return YES;
}
#pragma mark - On Injection methods
- (void)updateOnClassInjection {
}
- (void)updateOnResourceInjection:(NSString *)resourcePath {
}
#pragma mark - Swizzled methods
- (id)_swizzledInit {
// Calling previous init
id result = self;
result = [result _swizzledInit];
if (result) {
// In case, if we are in need to inject
if ([NSObject shouldPerformRuntimeCodeInjectionOnObject:result]) {
SFInjectionsNotificationsCenter * notificationCenter = [SFInjectionsNotificationsCenter sharedInstance];
[notificationCenter addObserver:result];
}
}
return result;
}
- (void)_swizzledDealloc {
if ([NSObject shouldPerformRuntimeCodeInjectionOnObject:self]) {
[[SFInjectionsNotificationsCenter sharedInstance] removeObserver:self];
}
// Swizzled methods are fun
// Calling previous dealloc implementation
[self _swizzledDealloc];
}
@end
#endif

View file

@ -0,0 +1,28 @@
//
// UINib(StoryBoardSupport)
// dyci
//
// Created by Paul Taykalo on 5/27/13.
// Copyright (c) 2012 Stanfy LLC. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#if TARGET_IPHONE_SIMULATOR
/*
It seems that storyboard passing some options, when instantiating the nibs
So, we would save those, and reuse after injections
*/
@interface UINib (StoryBoardSupport)
/*
Returns options, saved for the owner
*/
+ (NSDictionary *)optionsByOwner:(id)owner;
@end
#endif

View file

@ -0,0 +1,42 @@
//
// UINib(StoryBoardSupport)
// dyci
//
// Created by Paul Taykalo on 5/27/13.
// Copyright (c) 2012 Stanfy LLC. All rights reserved.
//
#import "UINib+StoryBoardSupport.h"
#if TARGET_IPHONE_SIMULATOR
@implementation UINib (StoryBoardSupport)
static NSMutableDictionary * cachedOptions;
- (NSArray *)_swizzledInstantiateWithOwner:(id)owner options:(NSDictionary *)options {
//
if (!cachedOptions) {
cachedOptions = [[NSMutableDictionary alloc] init];
}
// Saving options per owner (View Controller address)
if ( owner && options) {
[cachedOptions setObject:options forKey:[NSString stringWithFormat:@"%0x", owner]];
}
NSArray *items = [self _swizzledInstantiateWithOwner:owner options:options];
return items;
}
+ (NSDictionary *)optionsByOwner:(id)owner {
NSString * optionsKey = [NSString stringWithFormat:@"%0x", owner];
return cachedOptions[optionsKey];
}
@end
#endif

View file

@ -0,0 +1,32 @@
//
// UIViewController+XIBSupport.h
// Dynamic Code Ibjection
//
// Created by Paul Taykalo on 11/30/12.
// Copyright (c) 2012 Stanfy. All rights reserved.
//
#import <UIKit/UIKit.h>
#if TARGET_IPHONE_SIMULATOR
/*
This category allows Xibs to be injected in runtime
*/
@interface UIViewController (XIBSupport)
/*
Overriden updateOnResource Injection
this method will check, if injected path is same as our xib,
And will reinitialize xib with new nib instance
This functionality is experimental. So, in case if it isn't working,
describe the steps, and setup and issue on the Github
https://github.com/DyCI/dyci-main/issues?sort=updated&state=open
*/
- (void)updateOnResourceInjection:(NSString *)path;
@end
#endif

View file

@ -0,0 +1,156 @@
//
// UIViewController+XIBSupport.m
// Dynamic Code Ibjection
//
// Created by Paul Taykalo on 11/30/12.
// Copyright (c) 2012 Stanfy. All rights reserved.
//
#import "UIViewController+XIBSupport.h"
#import "SFDynamicCodeInjection.h"
#import "UINib+StoryBoardSupport.h"
#if TARGET_IPHONE_SIMULATOR
@interface SFDynamicCodeInjection (Private)
+ (id)sharedInstance;
- (void)flushBundleCache:(NSBundle *)bundle;
@end
@implementation UIViewController (XIBSupport)
- (void)updateOnResourceInjection:(NSString *)path {
NSString * extension = [path pathExtension];
if ([extension isEqualToString:@"nib"] ||
[extension isEqualToString:@"xib"]) {
[self updateOnXIBInjectionWithPath:path];
}
if ([extension isEqualToString:@"storyboardc"]) {
[self updateOnStoryboardInjectionWithPath:path];
}
}
- (void)updateOnXIBInjectionWithPath:(NSString *)path {
NSString * resourceName = [[path lastPathComponent] stringByDeletingPathExtension];
NSString * nibName = [self nibName];
// Checking if it is our nib was ibjected
if ([nibName isEqualToString:resourceName]) {
// If so... let's check if we loaded our view already
if ([self isViewLoaded]) {
// Saving view "state"
CGRect oldFrame = self.view.frame;
UIView * superview = self.view.superview;
NSUInteger index = [[superview subviews] indexOfObject:self.view];
// Removing it from the superview
[[self view] removeFromSuperview];
// Reinitializing controller with new nib
[[NSBundle mainBundle] loadNibNamed:nibName owner:self options:nil];
// Resouring view state
[superview insertSubview:self.view atIndex:index];
self.view.frame = oldFrame;
} else {
// If view wasn't loaded yet, then simply reinializing contoller with new xib
[[NSBundle mainBundle] loadNibNamed:nibName owner:self options:nil];
}
}
}
- (void)updateOnStoryboardInjectionWithPath:(NSString *)path {
NSString * name = [[path lastPathComponent] stringByDeletingPathExtension];
NSLog(@"Loading injected storyboard");
UIStoryboard * injectedStoryBoard = [UIStoryboard storyboardWithName:name bundle:nil];
NSLog(@"Injected storyboard : %@", injectedStoryBoard);
if (self.storyboard && injectedStoryBoard) {
// Keys
NSString * kBundle = @"bundle";
NSString * kStoryboardFileName = @"storyboardFileName";
NSString * kDesignatedEntryPointIdentifier = @"designatedEntryPointIdentifier";
NSString * kIdentifierToNibNameMap = @"identifierToNibNameMap";
NSString * kIdentifierToUINibMap = @"identifierToUINibMap";
// Flushing keys
NSBundle * storyboardBundle = [self.storyboard valueForKey:kBundle];
[[SFDynamicCodeInjection sharedInstance] flushBundleCache:storyboardBundle];
NSString * injectedFileName = [injectedStoryBoard valueForKey:kStoryboardFileName];
NSString * originalFileName = [self.storyboard valueForKey:kStoryboardFileName];
if ([injectedFileName isEqualToString:originalFileName]) {
// Let's use KVO in inappropriate way
for (NSString * key in @[ kDesignatedEntryPointIdentifier, kIdentifierToNibNameMap, kIdentifierToUINibMap ]) {
id value = [injectedStoryBoard valueForKey:key];
[[self storyboard] setValue:value forKey:key];
}
}
// Nibname for sotryboard will be like
// XXXX.storyboarc/YYYY
// XXXX - Storyboard name
// YYYY - nib name (This one is really tricky)
NSString * nibName = [NSString stringWithFormat:@"%@.storyboardc/%@", name, self.nibName];
NSBundle * bundle = [self nibBundle] ? : [NSBundle mainBundle];
NSDictionary * options = [UINib optionsByOwner:self];
UINib * nib = [UINib nibWithNibName:nibName bundle:bundle];
NSLog(@"Injecting view Controller for nibName : %@. bundle : %@", nibName, bundle);
if ([self isViewLoaded]) {
// Saving view "state"
CGRect oldFrame = self.view.frame;
UIView * superview = self.view.superview;
NSUInteger index = [[superview subviews] indexOfObject:self.view];
[self viewWillDisappear:NO];
// Removing it from the superview
[[self view] removeFromSuperview];
[self viewDidDisappear:NO];
// Reinitializing controller with new nib
[nib instantiateWithOwner:self options:options];
self.view.frame = oldFrame;
[[self view] setNeedsLayout];
[[self view] layoutIfNeeded];
[self viewWillAppear:NO];
// Restoring view state
[superview insertSubview:self.view atIndex:index];
[self viewDidAppear:NO];
} else {
// If view wasn't loaded yet, then simply reinitializing controller with new xib
[nib instantiateWithOwner:self options:options];
}
}
}
@end
#endif

View file

@ -0,0 +1,61 @@
//
// SFInjectionsNotificationsCenter.h
// dyci-framework
//
// Created by Paul Taykalo on 6/1/13.
// Copyright (c) 2013 Stanfy. All rights reserved.
//
#import <Foundation/Foundation.h>
#if TARGET_IPHONE_SIMULATOR
@protocol SFInjectionObserver <NSObject>
/*
Will be called, when some class (X) will be injected in application runtime
On All instances of class X, and instances of subclasses of X, this method will be called
*/
- (void)updateOnClassInjection;
/*
This method will be called for all classes, that are waiting for resources changes.
Before this method is called, Image cache is flushed, so you don't have to call memory warnings
Resource that was injected is passed with parameter. But in general, you don't need to care
*/
- (void)updateOnResourceInjection:(NSString *)resourcePath;
@end
/*
This notification center will notify classes about new infection code available
Live classes about new code
This one was made because it seems sometimes classes doesn't remove themself as observers from
Notification Center. And we'll try to understand why it's so
Also it'll try to understand which classes should be filtered from observing
*/
@interface SFInjectionsNotificationsCenter : NSObject
/*
Returns notification center instance
*/
+ (instancetype)sharedInstance;
- (void)addObserver:(id<SFInjectionObserver>)observer;
- (void)removeObserver:(id<SFInjectionObserver>)observer;
/*
This will notify about class injection
*/
- (void)notifyOnClassInjection:(Class)class;
/*
This will notiy all registered classes about that some resource was injected
*/
- (void)notifyOnResourceInjection:(NSString *)resourceInjection;
@end
#endif

View file

@ -0,0 +1,115 @@
//
// SFInjectionsNotificationsCenter.m
// dyci-framework
//
// Created by Paul Taykalo on 6/1/13.
// Copyright (c) 2013 Stanfy. All rights reserved.
//
#import "SFInjectionsNotificationsCenter.h"
#if TARGET_IPHONE_SIMULATOR
@implementation SFInjectionsNotificationsCenter {
NSMutableDictionary * _observers;
}
+ (instancetype)sharedInstance {
static SFInjectionsNotificationsCenter * _instance = nil;
if (!_instance) {
_instance = [[self alloc] init];
_instance->_observers = [NSMutableDictionary dictionary];
}
return _instance;
}
- (void)addObserver:(id<SFInjectionObserver>)observer {
[self addObserver:observer forClass:[observer class]];
}
- (void)removeObserver:(id<SFInjectionObserver>)observer {
[self removeObserver:observer ofClass:[observer class]];
}
- (void)removeObserver:(id<SFInjectionObserver>)observer ofClass:(Class)class {
@synchronized (_observers) {
NSMutableSet * observersPerClass = [_observers objectForKey:class];
if (observersPerClass) {
@synchronized (observersPerClass) {
[observersPerClass removeObject:observer];
}
}
}
}
- (void)addObserver:(id<SFInjectionObserver>)observer forClass:(Class)class {
if (!class) {
return;
}
@synchronized (_observers) {
NSMutableSet * observersPerClass = [_observers objectForKey:class];
if (!observersPerClass) {
observersPerClass = (__bridge_transfer NSMutableSet *) CFSetCreateMutable(nil, 0, nil);
[_observers setObject:observersPerClass forKey:class];
}
@synchronized (observersPerClass) {
[observersPerClass addObject:observer];
}
}
}
/*
This will notify about class injection
*/
- (void)notifyOnClassInjection:(Class)injectedClass {
int idx = 0;
@synchronized (_observers) {
for (NSMutableSet * observersPerClass in [_observers allValues]) {
@synchronized (observersPerClass) {
id anyObject = [observersPerClass anyObject];
int localIdx = 0;
if ([anyObject isKindOfClass:injectedClass]) {
for (id<SFInjectionObserver> observer in observersPerClass) {
[observer updateOnClassInjection];
idx++;
localIdx++;
}
NSLog(@"%d (%@) class instanses were notified on Class Injection : ", localIdx, NSStringFromClass([anyObject class]));
}
}
}
}
NSLog(@"%d instanses were notified on Class Injection by injecting class: (%@)", idx, NSStringFromClass(injectedClass));
}
/*
This will notiy all registered classes about that some resource was injected
*/
- (void)notifyOnResourceInjection:(NSString *)resourceInjection {
int idx = 0;
@synchronized (_observers) {
for (NSMutableSet * observersPerClass in [_observers allValues]) {
@synchronized (observersPerClass) {
for (id<SFInjectionObserver> observer in observersPerClass) {
[observer updateOnResourceInjection:resourceInjection];
idx++;
}
}
}
}
NSLog(@"%d classes instanses were notified on REsource Injection", idx);
}
@end
#endif

View file

@ -0,0 +1,23 @@
//
// SFDynamicCodeInjection
// Nemlig-iPad
//
// Created by Paul Taykalo on 10/7/12.
// Copyright (c) 2012 Stanfy LLC. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface SFDynamicCodeInjection : NSObject
/*
Enables dynamic runtime
*/
+ (void)enable;
/*
Disables dynamic runtime
*/
+ (void)disable;
@end

View file

@ -0,0 +1,348 @@
//
// SFDynamicCodeInjection
// Dynamic Code Injection
//
// Created by Paul Taykalo on 10/7/12.
// Copyright (c) 2012 Stanfy LLC. All rights reserved.
//
#import <objc/runtime.h>
#import "SFDynamicCodeInjection.h"
#include <dlfcn.h>
#import "SFFileWatcher.h"
#import "NSSet+ClassesList.h"
#import "NSObject+DyCInjection.h"
#import "SFInjectionsNotificationsCenter.h"
#if TARGET_IPHONE_SIMULATOR
@interface SFDynamicCodeInjection () <SFFileWatcherDelegate>
@end
@implementation SFDynamicCodeInjection {
BOOL _enabled;
SFFileWatcher * _dciDirectoryFileWatcher;
}
+ (void)load {
[self enable];
NSLog(@"============================================");
NSLog(@"DYCI : Dynamic Code Injection was started...");
NSLog(@"To disable it, paste next line in your application:didFinishLaunching: method : \n\n"
"[NSClassFromString(@\"SFDynamicCodeInjection\") performSelector:@selector(disable)];\n\n");
NSLog(@" or");
NSLog(@"Simply remove dyci from dependencies");
NSLog(@"============================================");
}
+ (SFDynamicCodeInjection *)sharedInstance {
static SFDynamicCodeInjection * _instance = nil;
@synchronized (self) {
if (_instance == nil) {
_instance = [[self alloc] init];
}
}
return _instance;
}
+ (void)enable {
if (![self sharedInstance]->_enabled) {
[self sharedInstance]->_enabled = YES;
// Swizzling init and dealloc methods
[NSObject allowInjectionSubscriptionOnInitMethod];
NSString * dciDirectoryPath = [self dciDirectoryPath];
// Saving application bundle path, to have ability to inject
// Resources, xibs, etc
[self saveCurrentApplicationBundlePath:dciDirectoryPath];
// Setting up watcher, to get in touch with director contents
[self sharedInstance]->_dciDirectoryFileWatcher =
[SFFileWatcher fileWatcherWithPath:dciDirectoryPath
delegate:[self sharedInstance]];
}
}
+ (void)disable {
if ([self sharedInstance]->_enabled) {
[self sharedInstance]->_enabled = NO;
// Re-swizzling init and dealloc methods
[NSObject allowInjectionSubscriptionOnInitMethod];
// Removing file watcher
[self sharedInstance]->_dciDirectoryFileWatcher.delegate = nil;
[self sharedInstance]->_dciDirectoryFileWatcher = nil;
NSLog(@"============================================");
NSLog(@"DYCI : Dynamic Code Injection was stopped ");
NSLog(@"============================================");
}
}
#pragma mark - Checking for Library
+ (NSString *)dciDirectoryPath {
char * userENV = getenv("USER");
NSString * dciDirectoryPath = nil;
if (userENV != NULL) {
dciDirectoryPath = [NSString stringWithFormat:@"/Users/%s/.dyci/", userENV];
} else {
// Fallback to the path, since, we cannot get USER variable
NSString * userDirectoryPath = [@"~" stringByExpandingTildeInPath];
// Assume default installation, which will have /Users/{username}/ structure
NSArray * simUserDirectoryPathComponents = [userDirectoryPath pathComponents];
if (simUserDirectoryPathComponents.count > 3) {
// Get first 3 components
NSMutableArray * macUserDirectoryPathComponents = [[simUserDirectoryPathComponents subarrayWithRange:NSMakeRange(0, 3)] mutableCopy];
[macUserDirectoryPathComponents addObject:@".dyci"];
dciDirectoryPath = [NSString pathWithComponents:macUserDirectoryPathComponents];
}
}
NSLog(@"DYCI directory path is : %@", dciDirectoryPath);
return dciDirectoryPath;
}
#pragma mark - Injections
/*
Injecting in all classes, that were found in specified set
*/
- (void)performInjectionWithClassesInSet:(NSMutableSet *)classesSet {
for (NSValue * classWrapper in classesSet) {
Class clz;
[classWrapper getValue:&clz];
NSString * className = NSStringFromClass(clz);
if ([className hasPrefix:@"__"] && [className hasSuffix:@"__"]) {
// Skip some O_o classes
} else {
[self performInjectionWithClass:clz];
NSLog(@"Class was successfully injected");
}
}
}
- (void)performInjectionWithClass:(Class)injectedClass {
// Parsing it's method
// This is really fun
// Even if we load two instances of classes with the same name :)
// NSClassFromString Will return FIRST(Original) Instance. And this is cool!
NSString * className = [NSString stringWithFormat:@"%s", class_getName(injectedClass)];
Class originalClass = NSClassFromString(className);
// Replacing instance methods
[self replaceMethodsOfClass:originalClass withMethodsOfClass:injectedClass];
// Additionally we need to update Class methods (not instance methods) implementations
[self replaceMethodsOfClass:object_getClass(originalClass) withMethodsOfClass:object_getClass(injectedClass)];
// Notifying about new classes logic
NSLog(@"Class (%@) and their subclasses instances would be notified with", NSStringFromClass(originalClass));
NSLog(@" - (void)updateOnClassInjection ");
[[SFInjectionsNotificationsCenter sharedInstance] notifyOnClassInjection:originalClass];
}
- (void)replaceMethodsOfClass:(Class)originalClass withMethodsOfClass:(Class)injectedClass {
if (originalClass != injectedClass) {
NSLog(@"Injecting %@ class : %@", class_isMetaClass(injectedClass) ? @"meta" : @"", NSStringFromClass(injectedClass));
// Original class methods
int i = 0;
unsigned int mc = 0;
Method * injectedMethodsList = class_copyMethodList(injectedClass, &mc);
for (i = 0; i < mc; i++) {
Method m = injectedMethodsList[i];
SEL selector = method_getName(m);
const char * types = method_getTypeEncoding(m);
IMP injectedImplementation = method_getImplementation(m);
// Replacing old implementation with new one
class_replaceMethod(originalClass, selector, injectedImplementation, types);
}
}
}
#pragma mark - Helpers
+ (void)saveCurrentApplicationBundlePath:(NSString *)dyciPath {
NSString * filePathWithBundleInformation = [dyciPath stringByAppendingPathComponent:@"bundle"];
NSString * mainBundlePath = [[NSBundle mainBundle] resourcePath];
[mainBundlePath writeToFile:filePathWithBundleInformation
atomically:NO
encoding:NSUTF8StringEncoding
error:nil];
}
#pragma mark - Privat API's
/*
This one was found by searching on Github private headers
*/
- (void)flushUIImageCache {
#warning Fix this
[NSClassFromString(@"UIImage") performSelector:@selector(_flushSharedImageCache)];
}
/*
And this one was found Here
http://michelf.ca/blog/2010/killer-private-eraser/
Thanks to Michel
*/
extern void _CFBundleFlushBundleCaches(CFBundleRef bundle) __attribute__((weak_import));
- (void)flushBundleCache:(NSBundle *)bundle {
// Check if we still have this function
if (_CFBundleFlushBundleCaches != NULL) {
CFURLRef bundleURL;
CFBundleRef myBundle;
// Make a CFURLRef from the CFString representation of the
// bundles path.
bundleURL = CFURLCreateWithFileSystemPath(
kCFAllocatorDefault,
(CFStringRef)[bundle bundlePath],
kCFURLPOSIXPathStyle,
true );
// Make a bundle instance using the URLRef.
myBundle = CFBundleCreate( kCFAllocatorDefault, bundleURL );
_CFBundleFlushBundleCaches(myBundle);
CFRelease(myBundle);
CFRelease(bundleURL);
}
}
#pragma mark - SFLibWatcherDelegate
- (void)newFileWasFoundAtPath:(NSString *)filePath {
NSLog(@"New file injection detected at path : %@", filePath);
if ([[filePath lastPathComponent] isEqualToString:@"resource"]) {
NSLog(@" ");
NSLog(@" ================================================= ");
NSLog(@"New resource was injected");
NSLog(@"All classes will be notified with");
NSLog(@" - (void)updateOnResourceInjection:(NSString *)path ");
NSLog(@" ");
NSString * injectedResourcePath =
[NSString stringWithContentsOfFile:filePath
encoding:NSUTF8StringEncoding
error:nil];
// Flushing UIImage cache
[self flushUIImageCache];
if ([[injectedResourcePath pathExtension] isEqualToString:@"strings"]) {
[self flushBundleCache:[NSBundle mainBundle]];
}
[[SFInjectionsNotificationsCenter sharedInstance] notifyOnResourceInjection:injectedResourcePath];
}
// If its library
// Sometimes... we got notification with temporary file
// dci12123.dylib.ld_1237sj
NSString * dciDynamicLibraryPath = filePath;
if (![[dciDynamicLibraryPath pathExtension] isEqualToString:@"dylib"]) {
dciDynamicLibraryPath = [dciDynamicLibraryPath stringByDeletingPathExtension];
}
if ([[dciDynamicLibraryPath pathExtension] isEqualToString:@"dylib"]) {
NSLog(@" ");
NSLog(@" ================================================= ");
NSLog(@"Found new DCI ... Loading");
NSMutableSet * classesSet = [NSMutableSet currentClassesSet];
void * libHandle = dlopen([dciDynamicLibraryPath cStringUsingEncoding:NSUTF8StringEncoding],
RTLD_NOW | RTLD_GLOBAL);
char * err = dlerror();
if (libHandle) {
NSLog(@"DYCI was successfully loaded");
NSLog(@"Searching classes to inject");
// Retrieving difference between old classes list and
// current classes list
NSMutableSet * currentClassesSet = [NSMutableSet currentClassesSet];
[currentClassesSet minusSet:classesSet];
[self performInjectionWithClassesInSet:currentClassesSet];
} else {
NSLog(@"Couldn't load file Error : %s", err);
}
NSLog(@" ");
dlclose(libHandle);
}
}
@end
#else
@implementation SFDynamicCodeInjection {
}
+ (void)enable {
NSLog(@"DYCI: Sorry, Dynamic Code Ibjection is not available on devices");
}
+ (void)disable {
NSLog(@"DYCI: Sorry, Dynamic Code Ibjection is not available on devices");
}
@end
#endif

21
Pods/dyci/LICENSE.md generated Normal file
View file

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2014 Stanfy LLC
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

55
Pods/dyci/README.md generated Normal file
View file

@ -0,0 +1,55 @@
# WARNING
**Please, Read this.**
Uninstall dyci before updating Xcode.
In other case, you'll need to reinstall it :(
We're currenlty working on [this issue](https://github.com/DyCI/dyci-main/issues/8)...
If you've already expirienced this issue - remove and reinstall Xcode.
# dyci
Dynamic code injection tool.
Allows you to inject your code into running iOS application, whithout restarting it.
## Installation
If you already know, what this tool is about, you can move to [Installation page](https://github.com/DyCI/dyci-main/wiki/Installation)
## Adding to your project
After installation, you need to add dyci library to your project
If you are using [CocoaPods](https://github.com/CocoaPods/CocoaPods), then, just add this line to your PodFile
`pod 'dyci', :git => 'https://github.com/DyCI/dyci-main.git'`
If not, then, you can add dyci in [other ways](https://github.com/DyCI/dyci-main/wiki/Using-dyci)
## Reasons, why do you need this tool
* It's good for applying small logic changes
* It's good for quick small fixes on big projects.
* It's good for debugging purposes. Remember, you can inject any code at runtime. Logging is the code also.
## Differences from other tools
* You need minimum moves to enable dyci
* You aren't writing some kind of script, you are writing your code!
* You don't need to prepare/modify/lock your code for dyci
* Your changes are always saved (They will not be discarded on next run)
## How it works
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).
##Example
There's one example in sources
There's video about Tic-Tac-Toe game creation without project restart
[Video at Youtube](https://www.youtube.com/watch?v=8nyEpAqUug4)
##Some points of view
1. Dyci is not about loading new code in application.
2. Dyci is about speeding up development.
3. Each time, you are using dyci, it saves your time.
##WARNING
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.
#FAQ
If you have some questions, before asking them , make sure that they aren't listed [here](https://github.com/DyCI/dyci-main/wiki/FAQ)