Signup/Sign In

Answers

All questions must be answered. Here are the Answers given by this user in the Forum.

Simplest solution:

iOS 10 & up, Swift:

***button.transform = CGAffineTransform(scaleX: -1.0, y: 1.0)
button.titleLabel?.transform = CGAffineTransform(scaleX: -1.0, y: 1.0)
button.imageView?.transform = CGAffineTransform(scaleX: -1.0, y: 1.0)***

Before iOS 10, Swift/Obj-C:

***button.transform = CGAffineTransformMakeScale(-1.0, 1.0);
button.titleLabel.transform = CGAffineTransformMakeScale(-1.0, 1.0);
button.imageView.transform = CGAffineTransformMakeScale(-1.0, 1.0);***

iOS 9 & up, Swift: (Recommended)

***button.semanticContentAttribute = .forceRightToLeft***
3 years ago
I found out setting the gesture to disabled only doesn't always work. It does work, but for me it only did after I once used the backgesture. Second time it wouldn't trigger the backgesture.

Fix for me was to delegate the gesture and implement the shouldbegin method to return NO:
***
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];

// Disable iOS 7 back gesture
if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.enabled = NO;
self.navigationController.interactivePopGestureRecognizer.delegate = self;
}
}

- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];

// Enable iOS 7 back gesture
if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.enabled = YES;
self.navigationController.interactivePopGestureRecognizer.delegate = nil;
}
}

- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
{
return NO;
}***
3 years ago
The way I've handled it so far: in UITextFieldDelegate

***func textField(textField: UITextField, shouldChangeCharactersInRange range: NSRange, replacementString string: String) -> Bool
{
// text hasn't changed yet, you have to compute the text AFTER the edit yourself
let updatedString = (textField.text as NSString?)?.stringByReplacingCharactersInRange(range, withString: string)

// do whatever you need with this updated string (your code)


// always return true so that changes propagate
return true
}***

Swift4 version

***func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
let updatedString = (textField.text as NSString?)?.replacingCharacters(in: range, with: string)
return true
}***
3 years ago
The only solution worked for me:

1. Close Xcode project
2. Using finder go to project folder
3. Right click on .xcodeproj and choose "Show Package Contents"
4. Right click on project.pbxproj go on "Open With" and choose TextEdit
5. Now search for your Provision Profile instanceId specified in the error message.
6. Delete all found texts and let Provisioning Profiles clean.
7. Save & Close
8. Open Xcode
9. Enable automatically manage signing
Enjoy! Hope it will be useful!
3 years ago
I had this problem too. I just set my deployment target to 4.3 and left only armv7 architecture and it worked. At point almost everyone has 5, so 4.3 is fine.
3 years ago
It worked after I change from **DB_HOST=localhost** to **DB_HOST=127.0.0.1** at .env file
3 years ago
***public function __construct() {
$parameters = func_get_args();
...
}

$o = new MyClass('One', 'Two', 3);***

Now $paramters will be an array with the values 'One', 'Two', 3.

Edit,

I can add that

***func_num_args()***
will give you the number of parameters to the function.
3 years ago
Add the following in your index.php file. I first came across this when I moved my application from my XAMPP server to Apache 2.2 and PHP 5.4...

I would advise you do it in your index.php file instead of the php.ini file.

***if( ! ini_get('date.timezone') )
{
date_default_timezone_set('GMT');
}***
3 years ago
PHP_EOL (string) The correct 'End Of Line' symbol for this platform. Available since PHP 4.3.10 and PHP 5.0.2

You can use this constant when you read or write text files on the server's filesystem.

Line endings do not matter in most cases as most software are capable of handling text files regardless of their origin. You ought to be consistent with your code.

If line endings matter, explicitly specify the line endings instead of using the constant. For example:

HTTP headers must be separated by \r\n
CSV files should use \r\n as row separator
3 years ago
You can use calc:

If you just enter calc with no other arguments it enters an interactive mode where you can just keep doing math. You exit this by typing exit:

***C-style arbitrary precision calculator (version 2.12.3.3)
Calc is open software. For license details type: help copyright
[Type "exit" to exit, or "help" for help.]

; 2+4
6
; 3+5
8
; 3.4+5
8.4
; 2^4
16
; exit***

Or you use it with the expression as an argument and it will provide the answer and then exit
***$calc 2 + 4
6
$***
calc is similar to bc, I just like the way it behave as default better
3 years ago
I am using the openssl command, the swiss army knife of cryptography.
***openssl rand -base64 12***

or
***openssl rand -hex 12***
3 years ago
You can use pure bash for that, but it's better to use find:

***find . -maxdepth 1 -type d -exec echo {} \;***
(find additionally will include hidden directories)
3 years ago