Posts

Showing posts with the label ios

How to restart the app with flutter Android and iOS

Image
Hi all, welcome back to my blog. And today lesson is about flutter again. I have a little problem when trying to resart the app directly from the app. So what I mean is I want to restart the app after users do something. Because if I don't do it, the app flow will be bad and the data that I want to refresh will be failed. So in my use case in my app is I want to restart the app after user sign in or sign out in my app. The reason is I need to restart all of the previous state. That's the easy way I can do, and I have some problems with camera plugin. The problem is happened only on android, so when you click sign in google/facebook, there'll be new page native from their sdk and making the app in inactive status. That'll will make camera bug, and it will make the app crash.

Double Tap Zoom to The Tap Location Swift 5 iOS 13

Image
Hello, I find a problem where user wants to zoom to the tap location in ImageView. Actually ImageView inside UIScrollview. Because it's not just zoom when double tap but user can zoom manually with pinning. So basically it's like gallery album in iPhone, you can see it. When I try find the way on the internet, it doesn't work like the way I want. Double tap to zoom working but it just zoom on the center not to the tap location. You need to combine UIScrollview with UIImageview to use gesture zoom. Because UIImageview itself doesn't use scrollview so it will not effect scrollview. Maybe in iOS version before 13 the way on the internet it works. Because I see some posting get upvote and every comment say it works. But in new version of iOS we need to check again. So it's like swift version language. It has developed better again. So I finally combine answer on the internet to make what I want. So  this is the code

Avoid Create Multiple Album in iOS Swift 5

Image
Do you ever have an application that can download photo from your app to your album gallery ? It's not so complicated to do it, if you have the library that I will share to you right now. When you save your photo sometimes you need to create the album first then put the images in there. So It's neat too look. You can name your album with name of your app name. So the trick is everytime user will download you call create album method. In this method you check first if there's an same album created or not. If it's not then creating new one otherwise don't create. Because in iOS create same name, it's permitted. So it will be bad if you create many albums with same name. And if you reinstall the app, maybe the app will create the same album if you don't check. So it's our job as programmer to handle it. To make the user doesn't need to delete the same album. I personally want to know the way before I didn't reliaze that my app create multiple...

Don't Use prefs:root= in Your iOS Apps

My client got an error when trying to submit the app to app store. So the message goes like this : Guideline 2.5.1 - Performance - Software Requirements Your app uses the "prefs:root=" non-public URL scheme, which is a private entity. The use of non-public APIs is not permitted on the App Store because it can lead to a poor user experience should these APIs change. prefs:root=wifi Continuing to use or conceal non-public APIs in future submissions of this app may result in the termination of your Apple Developer account, as well as removal of all associated apps from the App Store.

How to Make Blur around Square Overlay QRCodeReader iOS

Image
My friend asked me how to make background blur and make only center square camera that's not blur. It's like the screenshoot below. BTW i use QRCodeReader library and i can't find a config to do this. So i tried to do by myself and finally i found the way. I'm gonna share to you guys. 

Flip UICollectionView to Make Like Gallery Photos in iOS

Image
Have you ever think to make your app like gallery photo app in iOS. It looks cool right. Maybe you use function scrollToBottom that you find on google. But it's not best way for me. Because the scroll is not smooth like i want. I want precisely like gallery photo apple does. Here's the screenshoot what i mean :

My Solution to Background Task Can't be More Than 3 Minutes iOS

If you use UIBackgroundTaskIdentifier for your background task like long download that i did. When the phone is off or the phone is screen lock, the app will crash if it's longer than 3 minutes or limited time. You can find detail on  https://developer.apple.com/library/archive/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html . This is the explanation from apple why they limit our background task. Always try to avoid doing any background work unless doing so improves the overall user experience. An app might move to the background because the user launched a different app or because the user locked the device and is not using it right now. In both situations, the user is signaling that your app does not need to be doing any meaningful work right now. Continuing to run in such conditions will only drain the device’s battery and might lead the user to force quit your app altogether. So be mindful about the work you do in t...

App Get Rejected from AppStore Because of Crash

Image
If you have an app that you can run on your device but when you send your app to app store you get rejected. I got the file crash that apple sent to their webiste Itunes. So i tried to read it and i'm still confused because i still doesn't understand the errors. I used this way  https://stackoverflow.com/a/8172962/2899321  to read the crash report. Don't forget to rename the crash report with crash extension .crash. The next day i got the error more specific when the crash happened from apple. I still find the way out to fix it. After i follow the instruction to run the app into iPad. I really found the crash and it's simple to fix it. Because in iPhone the problem didn't show up. So yeah finally the app show up on AppStore now. Thanks for visiting this website. Hope i will always can help you.

iOS APP Build Success But Not Receive in Testflight

Image
This is weird problem that i faced yesterday. I upload my app through Xcode and the message said it was success but with warning not errors. After i waited for hours i couldn't find it in iTunes Connect website. So i uploaded again but still no builds found.

How to scan a QR Code in Swift 4 and Xcode 9.4

Image
I have a project that needs to do scan QR Code. After i searched on the internet i found a good library that is suitable for my project. I have changed a little bit the code because the torch is not working. I don't change the code in library but implement / override it. I don't use pod to add QRCodeReader but include it in my project. Because maybe i need to modify the layout. link QRCode Reader on github :  https://github.com/yannickl/QRCodeReader.swift