I'm a beginner to swift 3 and cocoapods and i want to implement this https://github.com/luowenxing/MTImagePicker image picker for my project.
I've installed the pod into my project and am using the .xcworkspace file.
However, I'm facing problems as i've errors like:
No such module 'MTImagePicker'
Use of unresolved identifier 'MTImagePickerController'
Use of undeclared type 'MTImagePickerAssetsModel'
I've moved the MTImagePicker folder into my project as instructed.
But I'm still having this problem.
Any help is much appreciated.
Thank you so much!
Edited:
Podfile
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'BPMatters' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for BPMatters
source 'https://github.com/CocoaPods/Specs.git'
pod 'MTImagePicker', '~> 1.0.1'
target 'BPMattersTests' do
inherit! :search_paths
# Pods for testing
end
target 'BPMattersUITests' do
inherit! :search_paths
# Pods for testing
end
end
#objc protocol MTImagePickerControllerDelegate:NSObjectProtocol {
// Implement it when setting source to MTImagePickerSource.ALAsset
optional func imagePickerController(picker:MTImagePickerController, didFinishPickingWithAssetsModels models:[MTImagePickerAssetsModel])
// Implement it when setting source to MTImagePickerSource.Photos
#available(iOS 8.0, *)
optional func imagePickerController(picker:MTImagePickerController, didFinishPickingWithPhotosModels models:[MTImagePickerPhotosModel])
optional func imagePickerControllerDidCancel(picker: MTImagePickerController)
}
///third party image picker////
func thirdPartyImagePicker(){
let imagePicker = MTImagePickerController.instance
imagePicker.mediaTypes = [MTImagePickerMediaType.Photo,MTImagePickerMediaType.Video]
imagePicker.imagePickerDelegate = self
imagePicker.maxCount = 10 // max select count
imagePicker.defaultShowCameraRoll = true // when set to true would show Camera Roll Album like WeChat by default.
//default is MTImagePickerSource.ALAsset
imagePicker.source = MTImagePickerSource.ALAsset
//imagePicker.source = MTImagePickerSource.Photos (Work on iOS8+)
self.presentViewController(imagePicker, animated: true, completion: nil)
}
///third party image picker end///
Screenshot of Terminal after pod install
Solution: I got my stuffs working by doing this: https://stackoverflow.com/a/39435421/7498313
I marked Faris Sbahi's answer as the correct answer as I believe his answers can help beginners like me to set up the cocoapods and implementation of the project.
Thank you so much! :)
import MTImagePicker at the top of your class.
Update your Podfile to
Podfile
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
use_frameworks!
target 'BPMatters' do
# Pods for BPMatters
pod 'MTImagePicker', '~> 1.0.1'
end
target 'BPMattersTests' do
inherit! :search_paths
# Pods for testing
end
target 'BPMattersUITests' do
inherit! :search_paths
# Pods for testing
end
After updating your Podfile to this, run pod install and ensure no errors are returned. After doing so, open the xcworkspace file and when you attempt to build ensure that the target is BPMatters.
Be sure that in the side pane you see something like this:
With a folder for MTImagePicker
Related
My application uses log4j but OkHttpClient uses java util logging. So apart from log4j.properties, I created a logging.properties file with the following contents:
handlers=java.util.logging.FileHandler
.level=FINE
okhttp3.internal.http2.level=FINE
java.util.logging.FileHandler.pattern = logs/%hjava%u.log
java.util.logging.FileHandler.limit = 50000
java.util.logging.FileHandler.count = 1
java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter
java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
I then added this to jvm params used for starting the application -Djava.util.logging.config.file="file://${BASE_DIR}/logging.properties"
But I don't see any new folders being created as indicated by the Filehandler. Any one know why?
But I don't see any new folders being created as indicated by the Filehandler. Any one know why?
The FileHandler will not create any new folders. A directory must be created before the FileHandler will create a file.
The system property requires a path to file that is located on the filesystem It will not expand system properties or environment variables by using the dollar sign syntax.
You can use a relative path based off of the working directory or you have to use an absolute path to the logging.properties. The logging properties can not be packaged inside of an archive.
If you want to work around this limitation then you want to create a custom config class and use the java.util.logging.config.class property in conjunction with the java.util.logging.config.file property. You then write a class that reads the file://${BASE_DIR}/logging.properties and performs the needed transformation into a path to a file. Then update the configuration if you are using JDK9 or newer. On older versions you need to use readConfiguration and add code to work work around limitations of the LogManager
We are trying to use the latest Draw.io repository, and modify the javascript client side code to change some of its behaviors for an improved UX. But, the only up to date source we can find is here:
https://github.com/jgraph/draw.io/tree/master/war/js
You'll notice that several of the source files are already minified, such as app.min.js
We found an old non-minified version of draw.io from 5 years ago:
https://github.com/vmassol/draw.io
But it looks like it's missing a lot of functionality..
Does anyone have more information about this? Is there a way to get the non-minified source of the up to date version? Just how much functionality is missing from the old version? Or, do we misunderstand something, and the minified files, like app.min.js are just pre-built products from the source that's in the rest of the directories?
Thanks!
The minified and non-minified (NM) sources are both in the project. The NM sources mostly live in the diagramly folder (the old name for draw.io) and the GraphEditor folder.
If you look in the build file, you can see which sources go into which *.min.js files.
The GraphEditor source serve as the base stack under draw.io. It used to be maintained as a cut-down editor, just not any longer.
i managed to run the app from the unminified modifying the index.html as follows:
// Changes paths for local development environment
if (urlParams['dev'] == '1') {
// Used to request grapheditor/mxgraph sources in dev mode
//the line below was: var mxDevUrl = document.location.protocol + '//devhost.jgraph.com/mxgraph2';
var mxDevUrl = document.location.origin + '/mxgraph';
// Used to request draw.io sources in dev mode
//the line below was : var drawDevUrl = document.location.protocol + '//devhost.jgraph.com/drawio/src/main/webapp/';
var drawDevUrl = document.location.origin + '/drawio/src/main/webapp/';
...
//The line below was: var geBasePath = mxDevUrl + '/javascript/examples/grapheditor/www/js';
var geBasePath = drawDevUrl + '/js/mxgraph';
var mxBasePath = mxDevUrl + '/javascript/src';
...
}
To make everything work I had to start an http-server (es. nodejs http-server module) at mxgraph and drawio repos parent.
I want to build my Dojo JavaScript code that I have carefully structured into packages into a single JavaScript file. I'm a little confused as to how to do it.
For now I have this:
var profile = {
...
layers: {
'app': {
include: [
'dojo/module1',
'dojo/module2',
...,
'dojo/moduleN',
'package2/module1',
'package2/module2',
...,
'package2/moduleN'
]
}
}
...
};
Do I really have to manually add all the modules to the app layer? Can't I just say "all", or better yet, "all referenced"? I don't want to include the dojo/something modul if I don't use it. Also, in my release folder, that's all I would like to have - one file.
So - can this even be achieved? Clean Dojo automatic build of only referenced modules into a single (minified and obfuscated of course) JavaScript file?
Take a look at the examples in the Layers section of this build tutorial:
It’s also possible to create a custom build of dojo.js; this is particularly relevant when using AMD, since by default (for backwards compatibility), the dojo/main module is added automatically by the build system to dojo.js, which wastes space by loading modules that your code may not actually use. In order to create a custom build of dojo.js, you simply define it as a separate layer, setting both customBase and boot to true:
var profile = {
layers: {
"dojo/dojo": {
include: [ "dojo/dojo", "app/main" ],
customBase: true,
boot: true
}
}
};
You can include an entire "app" in a single layer by including the root of that app (or module). Note that if a module in that app is not explicitly required by that app, it would have to be included manually. See the second example in the Layers section in the above tutorial for an illustration of that.
You can also define packages to include in your layers, if you want to change or customize the layout of your project:
packages: [
{name:'dojo', location:'other/dojotoolkit/location/dojo'},
/* ... */
],
layers: {
'dojo/dojo': { include: ['dojo/dojo'] },
/* ... */
}
You don't have to specify all the modules, if the module you add already has dependencies on others. For example, if you include 'app/MainApplication' to a layer, the builder would include all the modules that app/MainApplication depens on. If your MainApplication.js touches everything in your project, everything would be included.
During the build of a layer, dojo parses require() and define() calls in every module. Then it builds the dependency tree. Nls resources are also included.
In your code, you should name your layer as a file in existing package. In my build, it caused errors when I name a layer with a single word. You should code
var profile =
layers: {
'existingPackage/fileName': {
...
}
}
If you want to have exacltly one file, you have to include 'dojo/dojo' in your layer and specify customBase and boot flags.
Dojo always build every package before building layers. You will always have dojo and dijit folders in your release directory containing minified versions of dojo filies in them.
Just copy the layer file you need and delete everything other.
I'm having issue getting this set up.
My podfile:
platform :ios
pod 'cocos2d', '2.1'
pod 'box2d', '2.3.0'
Unfortunately, we need CC_ENABLE_BOX2D_INTEGRATION to be turned on, as it's set to 0 by default.
I tried adding a post_install hook to the podfile like so:
post_install do |installer_representation|
installer_representation.project.targets.each do |target|
if target.name == 'Pods-cocos2d'
target.build_configurations.each do |config|
s = config.build_settings['GCC_PREPROCESSOR_DEFINITIONS']
if s == nil
s = [ '$(inherited)' ]
end
s.push('CC_ENABLE_BOX2D_INTEGRATION=1');
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = s
end
end
end
end
It adds the flag as expected to the Pods-cocos2d target, however it does not seem to be inherited at any point by my main project, in spite of the $(inherited) variable in GCC_PREPROCESSOR_DEFINITIONS.
Even then, if I manually edit the CC_ENABLE_BOX2D_INTEGRATION to on, I get linker errors saying that CCPhysicsSprite cannot be found.
Has anyone successfully set up these two libraries to work together with cocoapods?
CCPhysicsSprite is not a part of Box2d, it is extension of cocos2d. Maybe you not included the file into the project?
I am using wamp 2.0 and trying to install XDebug extension for php. I have followed all steps written here http://wiki.netbeans.org/HowToConfigureXDebug#How_to_configure_xdebug_with_WAMP
but still its not working.
Any suggestion how to fix this?
please follow the instructions at http://xdebug.org/find-binary.php
cheers,
Derick
If you're just debugging a local session using wampserver 3.0.6 and php 7.0.10 using xdebug, there's almost no need to edit your php.ini manually (more on that later).
You may activate xdebug.remote_enable from the tray icon menu. Having done so should yield something like the following output in php.ini (it's at the absolute end of the file):
; XDEBUG Extension
[xdebug]
zend_extension ="C:/wamp64/bin/php/php7.0.10/zend_ext/php_xdebug-2.4.1-7.0-vc14-x86_64.dll"
xdebug.remote_enable = On
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir ="C:/wamp64/tmp"
xdebug.show_local_vars=0
From there, the only thing you need to specifically add yourself (at least when using the php-debug extension in VS Code) to php.ini is:
xdebug.remote_autostart = 1
Don't forget to restart wampserver after that. If you need to connect remotely to another host, you would probably need som variation of (replace 127.0.0.1 with remote IP):
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
But that is pretty much outside the scope of my answer since that opens up a whole new can of worms IMHO
Follow instructions on http://xdebug.org/find-binary.php as Derick mentioned, but when configuring xdebug on Wampserver 3.0.0 I also had to add the following code to my php.ini.
xdebug.remote_enable=true
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.profiler_enable=0
xdebug.profiler_output_dir = C:\wamp\tmp
for php 7 the configuration variables were renamed my final working configuration ended up like this:
xdebug.mode = develop,debug,profile
xdebug.start_with_request=yes
xdebug.output_dir =c:/wamp64/tmp
xdebug.show_local_vars = 1
xdebug.log=c:/wamp64/logs/xdebug.log
xdebug.log_level = 10
xdebug.client_host=localhost
xdebug.client_port=9000