Posts

Things to consider when designing the user interface

Consider the whole user experience. Plan it step by step. Have a prominent search widget and a prominent filter widget. If something is unavailable, rather than taking it away and letting the user guess about whether or not it will be available, list it, indicate it is out of stock and let the user have the option of being alerted once it is in stock. If there is a location feature, allow the user to change location if necessary.  Allow users to clear filter and close panels easily. Give custom suggestions for search and let users view recent search Think of how to make the search experience better.  Ensure that the user has less need to remember things. Think about the questions that your user might need to answer to make a decision and help to provide it. Allow for comparison of products and allow users to bookmark things. Make editing easy. As the user keys in, the screen should scroll down to reveal the next box. Ask for permission only when needed, not at the beginnin

Get calories burnt from healthkit information

1. Go to symbols navigator, capabilities and switch on HealthKit. 2. Go to developer.apple.com, create an app ID with your correct bundle id gotten from your app. Indicate that it is an explicit app id and include healthkit in it. 3. Create a provisioning profile - App development - using the new app id created and download it. 4. Open xcode and import profile (sign-in profile). Select the provisioning profile you have just created. 5. Choose the new app id that you have just created. 6. Add the following to info.plist: Privacy – Health Share Usage Description Privacy – Health Update Usage Description 7. In the xcode swift file, import HealthKit This code reads calories burnt and returns true or false depending on whether you are able to be authorised to read the data

Edit constraints for a UI element

Click on the constraints at the side with the mousepad until it is in editing mode. Edit the constraint and press enter.

Asking someone to review your app

You can follow the instructions listed here.

Sharing on Social Media

First, when your app is completed, go to iTunes connect and create a new app. Key in the needed info (remember that your bundle id and sku starts with com.... the one that you use to uniquely identify your app). Go to the bottom and the page and look for 'View your app in App Store'. Click on it to get the URL of your app. Add a button and add an onclick event with the following code: let textToShare = "Join me in getting fit through dance!"                  if let myWebsite = NSURL (string: "https://itunes.apple.com/us/app/daily-dance-fitness/id1372552926?ls=1&mt=8" ) {             let objectsToShare = [textToShare, myWebsite] as [ Any ]             let activityVC = UIActivityViewController (activityItems: objectsToShare, applicationActivities: nil )              activityVC. excludedActivityTypes = [ UIActivityType . airDrop , UIActivityType . addToReadingList ]             activityVC. popoverPresentationController ?. sourceView

How to add admob to your app

First download cocaopods: https://cocoapods.org/app 1. Go to admob and sign up/sign in 2. Click on apps -> IOS 3. Follow instructions 4. Get your admob id Then go to your project folder in desktop in terminal: cd Desktop/nameOfFolder Type: pod init Enter Next, open your pod file inside it, in the target, add: pod 'Google-Mobile-Ads-SDK' Press install When it has been installed, go to terminal and type: pod install --repo-update Next, open your Xcode project and go to the AppDelegate file: import GoogleMobileAds In the application function add: (func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool ) GADMobileAds.configure(withApplicationID: "YOUR_ADMOB_APP_ID") Inside your app itself:   var interstitial: GADInterstitial! //in viewDidLoad:   interstitial = GADInterstitial(adUnitID: "ca-app-pub-3940256099942544/441146

Playing or pausing a video in web view

webview.evaluateJavaScript("ytplayer.playVideo()") webview.evaluateJavaScript("ytplayer.pauseVideo()") webview.evaluateJavaScript("ytplayer.stopVideo()")