I have validated the extension‘s json file. But the icon is not showing up in edge. How do I fix that? - microsoft-edge

My previous question.
The answer quite helped, but I am still having trouble with the icon.
It shows up as an common puzzle icon in edge, but I need it‘s icon to change.
It looks like:
I have validated it with this, but it shows as "valid".
till now, I‘m at:
{
"name": "The hey say extension",
"version":"0.0.0.1",
"manifest_version":2,
"description":"I say “hey”, when you click on me!",
"browser_action":{
"default_popup":"HeySay settings and play.html",
"default_icon":"HeySay icon!🙂.png" //this is not working
}
}
can anyone leave the required code as an answer? thanks.
Note: Don‘t recommend "default_icon": , because I tried that, and it simply doesn‘t work.
Also, making extensions and manifests need a programming head! I have one, but edge is creating serious problems.

The compatibility table at MDN has the following note for Edge/default_icon (emphasis mine):
Partial support
SVG icons are not supported.
'default_icon' must be an object, with explicit sizes.
So you must use the alternate form that specifies sizes (or at least a single size):
"browser_action":{
"default_popup":"HeySay settings and play.html",
"default_icon": {
"32": "HeySay icon!🙂.png"
}
}
The size of 32 seems to be guaranteed to be supported; your icon should be scaled down to fit. If you specify the actual dimensions (53) it might not work.
Of course, it's best if you actually have icons for at least sizes 32x32 and 64x64 in those exact resolutions.

Related

Is it possible to change color of bottom horizontal line of iPhone X series within app?

is it possible to change color of bottom horizontal line of iPhone X series within app(inside app only)? my client is asking to change color of this line, and i am not able to find any related topic or solution.
Thanks.
No, I don't think it is. That's drawn by the system, and is not part of your app. Apple does not let apps change things outside of that app's "sandbox".
Edit:
I found a long article on the subject online:
https://medium.freecodecamp.org/reverse-engineering-the-iphone-x-home-indicator-color-a4c112f84d34
It seems it's called the "home indicator" and this author supports my suspicion that you can't change its color.
Edit #2
As Matt points out, the color of the home indicator changes automatically. The system has logic in it that tries to keep enough contrast between the home indicator and the area around it so that it's clearly visible. See the article I linked for more on that subject than you probably wanted to know.
You can only remove it:
override var prefersHomeIndicatorAutoHidden: Bool {
return true
}
The color is applied automatically.

Using PDFs for icon images in Xcode 7.2

I'm attempting to use PDF files as icons in an app I'm working on. The issue I'm encountering is I'm getting inconsistent tint colors.
If I set a button image from interface builder, the icon image shows up black at runtime. Every time. Regardless of what I attempt to set from interface builder.
I tried setting my button icon image via code and instead of showing up black, it's white:
let myGraphicFile = UIImage(named: "myPDFImage")
let myButtonImage = myGraphicFile?.imageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate)
myButton.setImage(myButtonImage, forState: .Normal)
From code, regardless of what I attempt to set the tint to, it's always white from code.
I discovered this post relating to Xcode 6.x, but I think it might be dated, as I'm able to partially do it, but I can't set the tint.
Use PDF in XCode for an AppIcon (.appiconset collection)
I create the icons in Inkscape, save as PDF 1.5. I add the file to Images.xcassets. In Images.xcassets' attributes inspector, I'm setting:
Devices to Universal
Scale factor to Single Vector.
Summary: I can get it to show up and scale properly, but it's either black from interface builder or white from code. I suspect I'm missing something re: how to save the file from Inkscape.
Thank you for reading. If you have any suggestions, I welcome them.
I have figured out how to create vector icons with Inkscape. When you use PDFs to display icons in iOS, you need to alter the Attributes Inspector for your icon in xcAssets as follows:
1) Drag the PDF into xcAssets
2) Set devices (I did Universal and it worked fine)
3) If your PDF icon is under 1x, 2x, or 3x size class, drag it to Universal and delete the rest of them.
4) Set Scale Factors to Single Vector.
5) Render as Template Image.
Once it's configured there, then you just treat it was you would any other image in interface builder. It's essentially the same thing I was doing in code, but I don't think it gets done in code...it's gotta be done on xcAssets where the image lives. It's my understanding iOS renders vector images for the size class at run time. I think by attempting to tweak it in code wasn't working because the image had already been rendered.
If anyone has any questions on this, I found this link helpful in resolving my issue.
Additionally, this post covers the topic, too. https://stackoverflow.com/a/25804358/4475605

Xib taking long time (>1s) to load. UIFont cache seems to blame

I have a UIVC loading from a Storyboard which, in turn, loads a Xib. This inner load is causing the VC to take more than a second to load. There is some fancy footwork going on in the inner xib (it loads another xib which has dynamic drawing) but this doesn't appear to be the bottleneck.
According to Instruments, UIFont -initWithCoder is the culprit. (If you drill down further TBaseFont::CopyLocalizedName() is the deepest entry that accounts for the majority of the 1s time)
I'm a bit stumped as the custom font I use occurs all throughout the app with no problems. Any ideas?
Ok the problem was that the custom font was no longer embedded in the app. I had switched to another similar one which looked the same. Weird though as I'd have expected those offending labels to revert back the System font on the device but they did not. Is it possible they were being pulled from the Macbook?
Similar issue here — Hari and gbk hinted me on the right direction.
I found we were using Lucida Grande in one little hidden place (thank you grep), but Lucida Grande is NOT embedded in iOS. I just replaced Lucida Grande with Helvetica Neue, and I gained 3+ seconds at launch time. Impressive.
Had the similar problem - in my case another dev in team just use one more type of font so after merge system cant figure out font and change it for default one - it's take from 1200ms to 2300ms.
Solution - re-setup all fonts on ViewController that cause some freeze.

Strange "Crash" with Font added to Info.plist

I've added a custom font TTF file to an app I'm making.
I've also added the UIAppFonts key to the plist, as required.
Now, when I launch the app, it hits the "app is crashing in AppDelegate" breakpoint we all know so well.
I can't figure out a way to inspect the exception, but what's stranger is that if I play it through, the app continues just fine -- even allows me to debug. On top of that, the font in question is actually loaded, so there doesn't seem to be any issue there either. Not sure where to start looking for this one.
The font file is probably not added to the target.
Please remove the white spaces from the font file name. And change name in info.plist file.
And Use the same font name which in in the .ttf file. For more information you can check NSGOD's Answer here
Do you have a symbolic breakpoint set for "objc_exception_throw"? It will break on all exceptions, including the ones that will be caught by some code's try/catch frame.
Since you are seeing it show the break at UIApplicationMain, it is likely this is the closest source code to the problem. Check the stack frames in the left column to see if there are Apple internal methods being called.
Change the slider at the bottom of the left column in Xcode to show more of the stack frames if some are hidden.

Naming Convention For Images in XCode 5

i am using XCode 5 when i am naming the images like that :
fbicon~ipad.png
fbicon~ipad#2x.png
Xib is getting the image
but when i am using this Convention
although tha naming convention is
fbicon~ipad.png
fbicon#2x~ipad.png
xib is not picking the images in that case.
Dont Know Why?
Migrate to use the assets catalogue. You just drag your images into the image wells and interface builder picks them up.
If the catalogue doesn't show the iPad iphone specific wells, open up the properties right side bar and tick the appropriate boxes.
assets catalogue
This is happening since you are using XIB.
When used with XIB, for images to be used on iPhone one must use the convention "image~iphone" and for iPad you have to use "image~ipad". #2x is automatically appended based on which version (retina/non-retina) of the image is needed. That's why the first convention works for you.
In case of getting images from the code, e.g. if you have following versions of the "image"-
image~iphone.png
image~ipad.png
image#2x~iphone.png
image#2x~ipad.png
You just call-
[UIImage imageNamed:#"image"]
In this case, the second convention that you mentioned works- as detailed in the Apple doc-
https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/LoadingResources/Introduction/Introduction.html
So, nothing really wrong here as I see. For XIBs, the first convention is correct. For using with code, second convention is correct.

Resources