• Skip to main content
  • Skip to primary sidebar

Ravi Shankar

Tweaking Apps

  • Swift
  • Tech Tips

Unable to simultaneously satisfy constraints.

October 17, 2019 By Ravi Shankar

A common error that we would see when using Auto Layout is

Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don’t want.

Debugging the verbose shown in the console might look difficult but if you closely go through the messages you should be able to identify the issue.

Let us take the following Auto Layout Constraint error messages.

Try this:
(1) look at each constraint and try to figure out which you don’t expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
“<NSLayoutConstraint:0x281862940 UIImageView:0x14ddb28e0.width == UIImageView:0x14ddb28e0.height (active)>”,
“<NSLayoutConstraint:0x28181c190 V:|-(5)-[UIImageView:0x14ddb28e0] (active, names: ‘|’:UITableViewCellContentView:0x14ddb2750 )>”,
“<NSLayoutConstraint:0x28181cc30 UIImageView:0x14ddb28e0.width == 0.22*UITableViewCellContentView:0x14ddb2750.width (active)>”,
“<NSLayoutConstraint:0x28181eb20 V:[UIImageView:0x14ddb28e0]-(5)-| (active, names: ‘|’:UITableViewCellContentView:0x14ddb2750 )>”,
“<NSLayoutConstraint:0x28186e080 ‘UIView-Encapsulated-Layout-Height’ UITableViewCellContentView:0x14ddb2750.height == 93 (active)>”,
“<NSLayoutConstraint:0x28186e030 ‘UIView-Encapsulated-Layout-Width’ UITableViewCellContentView:0x14ddb2750.width == 375 (active)>”
)

Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x281862940 UIImageView:0x14ddb28e0.width == UIImageView:0x14ddb28e0.height (active)>

The constraints associated with this UIImageView are

This error is result of more than one constraints staistying the same condition. The last line in the log message tells one of the constraint causes this issues. “width == height”. Now identify the second constraint which tries to set the width of this imageview.

There are two constraints trying to set the width for the image view, 1. Propotional Width to and 2. Aspect Ratio. After removing the unwanted constraint and you are good to go.

Let us see one more example for the Constraint errors.

(
“<NSLayoutConstraint:0x281818f00 UIButton:0x14ddb7fe0’BOOK’.height == 50 (active)>”,
“<NSLayoutConstraint:0x28186c050 V:|-(20)-[UIButton:0x14ddb7fe0’BOOK’] (active, names: ‘|’:UITableViewCellContentView:0x14ddb7e50 )>”,
“<NSLayoutConstraint:0x28186c0a0 V:[UIButton:0x14ddb7fe0’BOOK’]-(20)-| (active, names: ‘|’:UITableViewCellContentView:0x14ddb7e50 )>”,
“<NSLayoutConstraint:0x28181aad0 ‘UIView-Encapsulated-Layout-Height’ UITableViewCellContentView:0x14ddb7e50.height == 90.5 (active)>”
)

Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x281818f00 UIButton:0x14ddb7fe0’BOOK’.height == 50 (active)>

 

The last line gives a clue, there are two constraints trying to set the height of the BOOK button. And if you look at the constraints for the BOOK button, you can find 1. Top and Bottom constraints are set for button and 2. Height constraint is also set for Button. Removing any one of the constraint would fix the problem.

Filed Under: Auto Layout, Constraints, NSLayoutConstraint

Upload missing dSYMs to see crashes

October 17, 2019 By Ravi Shankar

If you are using Firebase Crasyltics in your app and if bitcode is enabled then you might see this message

“Upload missing dSYMs to see crashes” when trying to view reported crash in Firebase Crashlytics. In order the see the stack trace, you can try uploading the dSYMs files.

Compress .dSYMs files.

  • Launch Xcode Organizer.
  • Select the App on the Right hand side and navigate to the version which caused the crash.
  • Right click on the version and select Show in Finder.

  • Right click the archive file and select “Show Package Contents”.
  • Copy all the dSYMs files to another location.
  • Compress the file and upload the compress file to Firebase to see see the stack trace.

iTunesConnect

Another option is to download dSYMs files from iTunes Connect.

Select your App -> Activity section -> Select the Version -> Download dSYSM

Filed Under: Crash, dSYMs, Firebase

Protect WhatsApp with Touch ID in iPhone

February 17, 2019 By Ravi Shankar Leave a Comment

Now you can lock WhatsApp on your iPhone with Touch ID. If your phone is being accessed by family memebers then this would be quite helpful to prevent other users from accessing your WhatsApp message.

Steps to enable Touch ID for WhatsApp

  1. Tap Settings on your WhatsApp app.

  2. In the Setting screen, navigate to Privacy option.

  3. Scrolled down the Privacy screen and select Screen Lock from the list.

  4. Now this will have the option to enable or disable Touch ID for WhatsApp. This also provides option to set the time of lock to appear whether immediately or after certain time.

Filed Under: iPhone, WhatsApp Tagged With: iphone, TouchID, WhatsApp

How to rename multiple files on a Mac

February 14, 2019 By Ravi Shankar Leave a Comment

Let us say you are scanning documents using a printer connected to a Mac. And when scanning multiple pages of the same document, the pages gets scanned with the default name followed by a ordered number.

As shown in the above screenshot, the filename starts with Screenshot and prefixed with some numbers.

Rename all files at once

All these files can be renamed all at once using below mentioned steps.

  1. Select all files and right click the selected items.

  2. Select Rename n items options from the listed menus.
  3. Provide a name in the Custom Format field. Let us name this as PropertyDocument.

  4. Enter the start number for the pages then click Rename button.

Now all the files will appear with name as PropertyDocument followed by a number.

Filed Under: Blogging

Journey with Swift

October 29, 2017 By Ravi Shankar

This is about my journey as a Swift developer and some of the points discussed here could be useful to anyone who want to re-invent themselves as a software developer or if they want start a career as a Software developer.

Past experience

I have been working in Software industry for years in wide range of technologies. Like many I felt the need for a change and wanted to switch over to the latest technologies. I was interested in iOS app development though I started with Objective-C within a year switched to Swift.

Be an early adopter

Choosing the technology matters and if you are one of the early adopter then you get new opportunities quickly. Being one of the early adapter of Swift helped me a lot to get noticed quickly. Also if the technology has the backing of some big corporates then you will grow with the technology.

Blog a learning tool

I started writing simple tutorials in Swift and shared this with the wider audience through my blog. This helped me to articulate the concepts well and also get valuable feedback from readers. In the later stage I got many opportunities/leads through my blog. Check out Ash Furrow and Kristina Thai talks on the benefiting of writing a blog.

Stay focussed

After picking up iOS/Swift, I got distracted time and again with Android and other hybrid platforms. But remember the process of learning any technology is the same and you are not going to achieve your goal by focussing on different platforms at the same time. Stay focussed to reach your goal quickly.

Build a portfolio

Another way of building confidence is to publish apps under your name. You can start with simple apps and increase the features as you gain more and more experience. I sometimes felt embarrased with the choice of initial apps that I made and the code that I wrote. It is quite natural to feel that way as long you keep learning continuously

Eat Swift, Sleep Swift, Breathe Swift

Don’t put all your eggs in one basket. I was working as a Objective-C developer but quit the job to focus only on Swift. There were not many gigs available during the first year hence become an iOS mentor. The best way to keep learning is by teaching others. This allowed me to spend all my time in learning and practising Swift.

Networking and team events

Join local meet-ups learn from other like minded people. If possible attend conferences where you get a chance to meet some international speakers as well. Participate in Hackathons and test your ability in new technologies by conceptualising the app idea in to MVP in the short period of time.

Take up new opportunities

I got a lead through my blog for reviewing a Swift book and also to co-author a Udemy course. Don’t hesitate to take up new opportunities as long as it aligns with your technology. This can alway add up to your portfolio and online presence.

Hard work, dedication!

After many unsuccessful bidding finally I got a small prototype work in Swift. The client again awarded me a full fledged project which later become a full-time work. Even if it is a small gig, hard work and dedication definitely pays off.

 

I want to end with one quote this is especially for the people in their 30s & 40s. You can become or re-invent yourself as software developer at any age. “Age is no barrier. It’s a limitation you put on your mind”. Don’t compare yourself with other developers know your strength and work around your limitations. Happy Coding!!

Filed Under: ios, iOS Developer, Software Developer, Swift

My first iOS developer conference – try! Swift Tokyo 2017

October 28, 2017 By Ravi Shankar 2 Comments

Attending conference is one way of keeping yourself up to date with the latest trends in any industry. This is true for every software developer as well. After re-skilling myself and picking up iOS development I wanted to attend some good conferences but not many were happening in India. Heard a lot about try! Swift from Alvin and Giridharan and registered for try! Swift Tokyo.

Conference

I needed a visa to travel to Japan and the organisers were quick to help me out. Thanks to Katsumi and Natasha for the paper work, the level of commitment shown to sort this out gave me a glimpse of what to expect in the conference.

I had arrived a day earlier and was able to attend the Tokyo Skytree tour followed by a reception at Pivotal labs arranged for all the international attendees. This was like an ice breaker and I got introduced to few of the attendees and speakers as well.

The conference was for 2 days + 1 day for workshops and hackathon. Each session was scheduled for 25 minutes followed by office hours with the speaker where you get a chance to clarify your queries and have detailed discussion with some renowned speakers. They had also scheduled lighning talks with duration of 5 minutes each. This was a huge conference with 700+ attendess, great speakers and well organised one as well.

Hackathon and Workshop

After the 2 day conference all the attendees had a chance to participate in hackathon. This gave me a chance to work with some bright Japanese developers. There were also some workshops conducted by Realm, IBM, Build a cross-platform 2D game with Swift by @ewingfighter and React Native workshop by orta

Why should anyone attend?

  • Networking with attendees and speakers, use the office hours after talk to clarify the queries with the speakers.
  • You can participate in the social events after conference. trySwift are the best at this.
  • If you are interested in job opportunities then you have chance to meet companies as many sponsors were doing recruitment as well
  • Get up to speed in new iOS technologies and chance to know about some exciting startups.
  • You can also participate in the local Swift and iOS community events.
  • On a side note you have a chance to explore country and interact with people.

It was worth the money spent and would recommend this for all iOS developer especailly try! Swift conferences.

Now try! Swift has come to India as well !! Register Now

Filed Under: Conference, ios, Networking, Swift, try! Swift

How to link Aadhaar with PAN

June 12, 2017 By Ravi Shankar Leave a Comment

Central Board of Direct Taxes, Government of India has made Aadhaar mandatory for filing returns. Income Tax India website is now providing option to link your Aadhaar card with your PAN card. These are following ways one can link Aadhaar with their PAN card.

Open https://incometaxindiaefiling.gov.in/ in a web browser and you should see the following option to link your Aadhaar card with PAN

You can also directly access the linking page by following this URL – https://incometaxindiaefiling.gov.in/e-Filing/Services/LinkAadhaarHome.html. This should display the following page asking for details about your PAN and Aadhaar.

After entering the details, click Link Aadhaar option. If your Aadhaar and PAN card name matches then the linking will be successful otherwise you will be asked to correct name details in either PAN or Aadhaar. For example in the Aadhar card if the name was entered as “S Ravishankar” and in PAN if it was “S Ravi Shankar” then you will have to update your name in PAN or Aadhaar.

Another way to access the Aadhaar, Pan linking page is by login to IncomeTaxFilling website. After login to the website, click Profile Settings and select Link Aadhaar from menu list.

This should display a page asking for details about your Aadhaar number and name given in your Aadhaar card. After entering the required details click Link Aadhaar to complete associating your PAN with Aadhaar.

Filed Under: Aadhaar, IncomeTaxIndia, PAN Tagged With: Link

Moto G5 Plus – How to use OTG (USB On The Go)

May 2, 2017 By Ravi Shankar Leave a Comment

Moto G5 Plus comes with a OTG support, where you can copy the files from your pen drive (and vice versa) by connecting it to your phone via the OTG cable. There are lot of OTG cable available in the market based on the brands. Some of the pen drive nowadays comes with the OTG support where you can attach the pen drive directly to the phone.

Here are few steps on how to use the feature. Once you plug in your pen drive via the OTG cable you get the notification on your phone. You can either explore or eject the device which is connected.

Screenshot_20170422-145304.png

Click on Explore, where it shows the contents of the pen drive. Try copy some files from your phone and then tap the menu icon from the top left corner and select the pen drive and move it. The same can be done by copying the files from the pen drive to your phone as well. Once you are done with the copying from the notification area, tap Eject to remove the pen drive safely.

Filed Under: Android, Moto Tagged With: Moto G5 Plus

  1. Pages:
  2. «
  3. 1
  4. 2
  5. 3
  6. 4
  7. 5
  8. 6
  9. 7
  10. 8
  11. ...
  12. 44
  13. »
« Previous Page
Next Page »

Primary Sidebar

TwitterLinkedin

Recent Posts

  • How to block keywords in Jio broadband
  • How to disable opening an app automatically at login in Mac
  • How to set preferred Wifi network on Mac
  • Attribute Unavailable: Estimated section warning before iOS 11.0
  • How to recover Firefox password from Time Machine backup

Pages

  • About
  • Privacy Policy
  • Terms and Conditions

Copyright 2022 © rshankar.com

Terms and Conditions - Privacy Policy