Views without any layout constraints may clip their content or overlap other views

2019-09-23 Thread Gabriel Zachmann via Cocoa-dev
Recently, I am getting lots of warnings saying
"Views without any layout constraints may clip their content or overlap other 
views"
when I build my screen saver.

In my case, I ons't think that warning is really important, since the GUI is 
not resizable
(it's just an options pane in the screensavers section of system preferences).

I have googled , but could not find a good solution.
I found a post on stackoverflow , but the solution advertised there did not 
work for me.
( They recommended to 
  Editor > Resolve Auto Layout Issues > Add Missing Constraints
but that made things worse in my case, I got many more warnings afterwards.)

I already tried adding constraints to some of the elements (views) that produce 
a warning,
but then I get many other warnings, such as "Frame for ... will be different at 
run time" or
"vertical position is ambiguous" , etc.)

Any ideas, what I can try?

Thanks a lot in advance.

Best regards, Gabriel



smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Views without any layout constraints may clip their content or overlap other views

2019-09-23 Thread Richard Charles via Cocoa-dev


> On Sep 23, 2019, at 8:06 AM, Gabriel Zachmann via Cocoa-dev 
>  wrote:
> 
> Recently, I am getting lots of warnings saying
> "Views without any layout constraints may clip their content or overlap other 
> views"
> when I build my screen saver.

Try this. In Xcode navigator select the xib file then select one of the objects 
in the file. It can be any object in the file such as the window, the first 
responder, the file's owner, etc.

In the right side panel file inspector a section will appear titled "Interface 
Builder Document". In this section deselect "Use Auto Layout".

--Richard Charles

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Animating bounds/position when layer.transform is set, or how to orient an image

2019-09-23 Thread Gabriel Zachmann via Cocoa-dev
Have a layer that displays an image and has some animations attached.
The animations modify layer.bounds (just the size changes) 
and layer.position .

Everything works fine, EXCEPT when the image's orientation EXIF flag is set.

So, I am also setting the layer.transform to a transformation that brings the 
image into its correct, upright orientation.
This works, EXCEPT that the animations are now off. They still do some 
animations , but the bounds and positions
are not correct any more.

Below are some code excerpts to make this more concrete
and to show how I attempted to deal with the orientation flag of the images.

My main questions are:
Does anyone have experience with this case, i.e., animations of layers that 
show images that have a non-upright EXIF orientation?
Is there a better/different way of handling non-upright EXIF orientation flags 
of images, something other than setting the transformation of the layer 
(layer.transform) ?

All hints and insights will be highly appreciated.

Best regards, Gabriel


Encl:

Here are more details.

Here is a code excerpt:

CALayer * imgLayer = [CALayer layer];
imgLayer.contents= (__bridge id) imageRef;
imgLayer.anchorPoint  = CGPointMake( 0.0, 0.0 );
CGAffineTransform img_trf = ... compute a CGAffineTransform based on the EXIF 
orientation flag (in [1,8])   (*)
imgLayer.transform = CATransform3DMakeAffineTransform( img_trf );

CABasicAnimation * anim = ... set up the animation(s)

... compute NSRect from_rect, to_rect  that will be used to set up the 
animations of the layer ...
from_rect = CGRectApplyAffineTransform( from_rect, img_trf );
anim.fromValue = [NSValue valueWithRect: from_rect ];
to_rect = CGRectApplyAffineTransform( to_rect, img_trf );
anim.toValue = [NSValue valueWithRect: to_rect ];

NSPoint fromPos = NSMakePoint( ... );
fromPos = CGPointApplyAffineTransform( fromPos, img_trf );
anim.fromValue = [NSValue valueWithPoint: fromPos];
... similarly for anim.toValue ...


So, for instance, if orientation==2, this means that the image is horizontally 
flipped.
So, the transformation img_trf I compute is
  img_trf = CGAffineTransformMake(-1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
i.e., the x-coord is flipped.
The CGRectApplyAffineTransform() call does not change the rectangles, which is 
reasonable.
The x-coord of fromPos and toPos are flipped (sign is inverted), as expected.
BUT the animation does not do what it should , the image is way off the screen.


I have, of course, also tried without any transformations on the bounds 
(from_rect, to_rect)
and without transforming anim.fromValue, anim.toValue.
But then the (oriented) image was completely invisible , maybe way off the 
screen.
So, it seems that the CALayer's transformation machinery does not take care of 
adjusting bounds/position when a layer's transform is set.






smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Views without any layout constraints may clip their content or overlap other views

2019-09-23 Thread James Walker via Cocoa-dev

On 9/23/19 8:30 AM, Richard Charles via Cocoa-dev wrote:



On Sep 23, 2019, at 8:06 AM, Gabriel Zachmann via Cocoa-dev 
 wrote:

Recently, I am getting lots of warnings saying
"Views without any layout constraints may clip their content or overlap other 
views"
when I build my screen saver.


Try this. In Xcode navigator select the xib file then select one of the objects 
in the file. It can be any object in the file such as the window, the first 
responder, the file's owner, etc.

In the right side panel file inspector a section will appear titled "Interface Builder 
Document". In this section deselect "Use Auto Layout".



The "Use Auto Layout" checkbox is not present in Xcode 11.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Views without any layout constraints may clip their content or overlap other views

2019-09-23 Thread Laurent Daudelin via Cocoa-dev
OH?!? That’s why I can’t find it. And now that you mention Xcode 11, I remember 
having to install the command line tools a couple of days ago. It must have 
been automatically updated as it is my current setting in the App Store app.

Thanks James, I won’t search for it anymore!

-Laurent.
-- 
Laurent Daudelin
laur...@nemesys-soft.com 
Skype: LaurentDaudelin  
iMessage – WhatsApp – Viber – Line  
Logiciels Némésys Software  
http://www.nemesys-soft.com/ 

> On Sep 23, 2019, at 16:08, James Walker via Cocoa-dev 
>  wrote:
> 
> On 9/23/19 8:30 AM, Richard Charles via Cocoa-dev wrote:
>>> On Sep 23, 2019, at 8:06 AM, Gabriel Zachmann via Cocoa-dev 
>>>  wrote:
>>> 
>>> Recently, I am getting lots of warnings saying
>>> "Views without any layout constraints may clip their content or overlap 
>>> other views"
>>> when I build my screen saver.
>> Try this. In Xcode navigator select the xib file then select one of the 
>> objects in the file. It can be any object in the file such as the window, 
>> the first responder, the file's owner, etc.
>> In the right side panel file inspector a section will appear titled 
>> "Interface Builder Document". In this section deselect "Use Auto Layout".
> 
> 
> The "Use Auto Layout" checkbox is not present in Xcode 11.
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/laurent%40nemesys-soft.com
> 
> This email sent to laur...@nemesys-soft.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Xcode 11 can't make an objective-C subclass any more?

2019-09-23 Thread James Walker via Cocoa-dev
Am I losing my mind, or is there no longer a good way to create a new 
Objective-C subclass?  If I go to create a new Objective-C file, I am 
offered the file type options: Empty File, Category, Protocol, 
Extension.  No subclass.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Xcode 11 can't make an objective-C subclass any more?

2019-09-23 Thread Jens Alfke via Cocoa-dev


> On Sep 23, 2019, at 2:19 PM, James Walker via Cocoa-dev 
>  wrote:
> 
> Am I losing my mind, or is there no longer a good way to create a new 
> Objective-C subclass?  If I go to create a new Objective-C file, I am offered 
> the file type options: Empty File, Category, Protocol, Extension.  No 
> subclass.

Choose "Cocoa Class" in the first page of the assistant, not "Objective-C" file.
AFAIK it's always been like this…

—Jens
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Xcode 11 can't make an objective-C subclass any more?

2019-09-23 Thread James Walker via Cocoa-dev

On 9/23/19 2:23 PM, Jens Alfke wrote:



On Sep 23, 2019, at 2:19 PM, James Walker via Cocoa-dev 
mailto:cocoa-dev@lists.apple.com>> wrote:


Am I losing my mind, or is there no longer a good way to create a new 
Objective-C subclass?  If I go to create a new Objective-C file, I am 
offered the file type options: Empty File, Category, Protocol, 
Extension.  No subclass.


Choose "Cocoa Class" in the first page of the assistant, not 
"Objective-C" file.

AFAIK it's always been like this…


OK, thanks.  I guess I am losing my mind.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Views without any layout constraints may clip their content or overlap other views

2019-09-23 Thread Quincey Morris via Cocoa-dev
> On Sep 23, 2019, at 13:58 , Laurent Daudelin via Cocoa-dev 
>  wrote:
> 
> OH?!? That’s why I can’t find it. And now that you mention Xcode 11, I 
> remember having to install the command line tools a couple of days ago. It 
> must have been automatically updated as it is my current setting in the App 
> Store app.

> 

> Thanks James, I won’t search for it anymore!


From the Xcode 11 release notes:

> NSView  and UIView 
>  have a layout mode 
> option in the Size inspector to explicitly opt into “translates autoresizing 
> mask into constraints”. The default setting is “Automatic”, which is the 
> existing behavior. “Automatic” implies that “translate autoresizing mask into 
> constraints” is off when a view affect by constraints in the storyboard or 
> .xib file, but on if unconstrained. (37352354)
> Improved the reliability of Auto Layout constraint generation with “Add 
> Missing Constraints”. (43694622)


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com