Kal Calendar for Universal App

216 Views Asked by At

I am updating my app to a universal app but there is something wrong with the Kal Calendar:

enter image description here

From this answer it says I should change:

const CGSize kTileSize = { 46.f, 44.f }; 

to

const CGSize kTileSize = { 109.0f, 109.0f };

but then it looks great on iPad but not iPhone. How can I make the Kal Calendar for both iPhone and iPad?

Any help will be appreciated!

Thank you!

2

There are 2 best solutions below

0
Rok Jarc On BEST ANSWER

You can't use a constant in this case - you will have to define the value at runtime.

Initialize kTileSize as an ivar of the class where it is defined.

And then in constructor of that class do someting like:

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
    kTileSize = {109.0f, 109.0f};
}
else
{
    kTileSize = {46.f, 44.f}; 
}
0
mashi On

Hi I have done a modification for Kal calendar and it has all the functionalities as below.

  1. UI changes for the Universal application
  2. UI for orientation changes

Please find it here.... https://github.com/maheshidesilva/KalExt