SF Images

How do we reference the SF Symbol image Name in IOS

iOSImage.SystemImage(cloud.moon,2,iosimage.SystemImageWeights.Regular,Nil,Nil)

Put the name in quotes.

Thanks Greg, it’s the obvious things that trip me up as I only get to program every few weeks so I appreciate the Forum’s patience.

Also can you reference SF images to become the icons in note? I’m guessing no as they don’t show up but thought I’d check

Return Array(PlaneImage, HeartImage, iOSImage.SystemImage(“clould.sun”,2,iosimage.SystemImageWeights.Regular,Nil,Nil))

I’m not sure what you mean by this. Could you elaborate or give a different example?

BTW “clould.sun” is not a valid name. Try “cloud.sun” instead.

Sorry about the typo

I thought you might be able to use the SF images as icons in the Xojo Notes project instead of the Plane, Heat and Yield images

[quote=471031:@Martin Fitzgibbons]Sorry about the typo

I thought you might be able to use the SF images as icons in the Xojo Notes project instead of the Plane, Heat and Yield images[/quote]
That should work, just remember that SF Images are only available on ios13, so you’ll need to provide the fallback image for earlier versions.

I’ve tried the following to try and see an image which works fine but when I referenced it directly in the Return Array it came up as Nil

Var SFimage As iOSImage
SFimage = iOSImage.SystemImage(“ant”,12,iosimage.SystemImageWeights.Regular,Nil,Nil)

Var SFimage2 As iOSImage
SFimage2 = iOSImage.SystemImage(“tortoise”,12,iosimage.SystemImageWeights.Regular,Nil,Nil)

Var SFimage3 As iOSImage
SFimage3 = iOSImage.SystemImage(“hare”,12,iosimage.SystemImageWeights.Regular,Nil,Nil)

If System.Version >= “13.0.0” Then
Return Array(SFImage, SFImage2, SFImage3)
else
Return Array(PlaneImage, HeartImage, YieldImage)
end if

You can do all of that in one line. For example:

Return Array(PlaneImage, HeartImage, iOSImage.SystemImage("cloud.sun", 24, iOSImage.SystemImageWeights.Regular, Nil, PlaneImage))

Obviously you could replace the other two images as well. That last parameter is where you put the fallback image for non-iOS 13 devices, that Greg mentioned.

Also, if you haven’t already, don’t forget to download the SF Symbols.app for macOS. https://developer.apple.com/design/resources/

Thanks Gavin… neat :slight_smile:

One last question on my Xojo Notes implementation.

On the List View my Icons are Blue but on the Detailed view they are Black. I can’t see anywhere that handles the color change.
I tried changing the second last parameter to Color.rgb(0,0,0) but that made no difference??

[quote=471084:@Martin Fitzgibbons]Thanks Gavin… neat :slight_smile:

One last question on my Xojo Notes implementation.

On the List View my Icons are Blue but on the Detailed view they are Black. I can’t see anywhere that handles the color change.
I tried changing the second last parameter to Color.rgb(0,0,0) but that made no difference??[/quote]

You might want to try the tenplatecolor as colorgroup parameter, pass it a colorgroup

http://documentation.xojo.com/api/deprecated/iosimage.html#iosimage-systemimage

Thanks Derek, I can’t find an example of how to set up a color group. Can you post a sample or point me somewhere?

Right click in the navigator and select Add ColorGroup.

Conclusion: if God doesn’t know, just ask Greg O’Lone

Thanks Paul those links were great especially the video.
Group Colors is only for IOS will it be implemented for Desktop or is it not needed?

[quote=472241:@Martin Fitzgibbons]Thanks Paul those links were great especially the video.
Group Colors is only for IOS will it be implemented for Desktop or is it not needed?[/quote]
It will come to Web and Desktop in a future version of Xojo.

Not sure if this should be a new thread or if it is related to the SF images.
I notice that the Xojo Notes example behaves how I would expect in Dark Mode with the icons in list view being grey and on the details page they are white in the selection area. The navigation area is Blue Highlight.
But when I changed the icons to SF Symbols on list view in my app they take on the Highlight color of Blue not grey as in the example App.
How do I control this?
https://www.crosswordwizard.com.au/Files/SF%20Symbols1.png
https://www.crosswordwizard.com.au/Files/SF%20Symbols2.png