'Is there a lightweight method to check if emoji is supported in iOS?
I'm gonna implement a emoji picker supporting Emoji List, v14.0, which could show only compatible emojis, but I don't know how to check if specific emoji is compatible on current iOS version. There are several ways I found:
- Render to PNG and compare it with default PNG (see https://stackoverflow.com/a/41393387/7484856), which might be CPU-intensive.
- Ask
CTFontGetGlyphsForCharactersto check if current emoji could be supported (see https://stackoverflow.com/a/39606543/7484856), which seems good, but it fails to check emoji consists of two or more emojis. For example, 😮💨 = (😮 U+1F62E U+200D 💨 U+1F4A8), which is actually not supported on iOS 13, butCTFontGetGlyphsForCharactersstill returnstruebecause it could be represented as 😮💨. - Persist emoji list to several
.plistfiles for each iOS version, which requires some effort to maintain a lot of emoji lists.
Solution 1:[1]
So quick update here, i finally solved my problem. my misunderstanding was that it's possible to send multiple objects to the twig template. So that's my final code :
class descriptionFilm extends AbstractController{
/**
* @Route("/details/{id}", name="description")
* @Route("/", name="home")
*/
public function show( ManagerRegistry $doctrine, $id, Request $request): Response {
$film = $doctrine->getRepository(Film::class)->find($id);
$form = $this->createFormBuilder()
->add('submitForm', SubmitType::class, ['label'=>'delete film '])
->getForm()
;
if($form->isSubmitted() && $form->isValid()){
//Do some stuff here
return $this->redirectToRoute('home');
}
$form ->handleRequest($request);
return $this->render('details/description.html.twig', ['film' => $film, 'deleteFilm' => $form->createView()]);
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Vincent |
