Code

AskIt | iOS Universal Questions/Answers App Template (Swift)

AskIt | iOS Universal Questions/Answers App Template (Swift)







iOS, Android and Web versions can share the same database on back4app







25 May 2018
• Accordingly to the new EU GDPR terms, I've updated the 'tou.html' file and Documentation.
IMPORTANT: This means that if a User asks for his/her Account deletion, you must do it within 24 hours, as the GDPR's "Right to be forgotten" Article states (LINK: https://gdpr-info.eu/art-17-gdpr/)
17 May 2018
• Adjusted the layout of the QuestionCell of the Home and Search controllers in the Storyboard by moving the Attachment Button behind the Question TextView and enlarging it.
• Edited the 'cellForRow atIndexPath()' method in Home.swift and Search.swift, in order to see a preview of an image for those questions that have an attachment. 
24 April 2018
• Replaced AdMob banners with Interstitial code in Home.swift, Search.swift and Answers.swift | Adjusted the bottom edge of the views in their relative controllers in the Storyboard
• Changed AdMob variable in Configs.swift:
    let ADMOB_INTERSTITIAL_UNIT_ID = "ca-app-pub-3940256099942544/1033173712" 

• Changed Likes system by adding a new column of type 'Array' called 'likedBy' in the 'Answers' and 'Questions' classes in the Parse Dashboard
• Edited the 'likeButt()' method in Home.swift and Search.swift 
• Added a like button in the Storyboard -> AnswerCell | Edited the Answers.swift file accordingly by adding a 'likeButt()' method and the likeButton IBOutlet in the AnswerCell class
• Edited 'cellForRowAt indexPath:' method in Home.swift and Search.swift
• Added a like_butt and liked_butt image sets in Assets.xcassets
• Edited the 'sendAnswerButt()' method in Answers.swift by adding this line:
     aObj[ANSWERS_LIKED_BY] = [String]()

• Edited the 'sendQuestionButt()' method by adding this line:
     qObj[QUESTIONS_LIKED_BY] = [String]()

• Added the following lines in Configs.swift:
   let QUESTIONS_LIKED_BY = "likedBy" 
   let ANSWERS_LIKED_BY = "likedBy" 
   let ANSWERS_LIKES = "likes" 

• Replaced all instances of 'aClass' and 'qClass' with 'aObj' and 'qObj' in almost all swift files (just use the Find tool in Xcode to find them)

** IMPORTANT: IF THIS IS AN UPDATE FOR YOU, then you should do the following:
- Updated the code of your app by comparing your old swift files and Storyboard with the updated ones
- Enter your Pasre Dashboard and create a column of type 'Array', name it exactly 'likedBy' in the 'Questions' class
- Do the same for the 'Answers' class
- Check the 'Likes' class, the userPointer column has the objectId's of the users who liked questions, so you have to copy them and add them to the cells of the 'likedBy' column in your 'Questions' class as strings, they should look like this:
   ["yu76Gtrr4","hbg4ERs1"] 
You can recognize the row of a liked question by check its objectId in the 'questionPointer' of your Likes class
- For the 'Answers' class, you only need to fill all the empty cells of the 'likedBy' column with:
   []
PLEASE NOTE that the Likes class won't be used anymore, but you can still keep it in case some users won't update the app from the App Store.  

3 April 2018
• Updated to reccomended settings with Xcode 9.3
• Updated the 3 Facebook SDKs (because of Swift 4.1 release):
FBSDKCoreKit.framework
FBSDKLoginKit.framework
FBSDKShareKit.framework
26 November 2017
• Edited the the 'showBanner()' method in Home.swift, Answers.swift and Search.swift in order to the AdMob banner to not overlay the bottom TextField
22 September 2017
• Updated to Xcode 9, Swift 4, iOS 11
• Added a 1125x2436px png image (iPhone X launch image) into Assets.xcassets -> Brand Assets image set
• Edited the 'refreshTB()' method in Home.swift
• Edited 'getFBUserData()' in case of no email on Facebook sign in
• Edited 'forgotPasswButt()' method in Login.swift
• Added .lowercased() to the 'searchBarSearchButtonClicked()' method in Search.swift:
      queryQuestions(searchBar.text!.lowercased())

• Added UITableViewDataSource and UITableViewDelegate delegates in the class declaration of the Search.swift file, as well as the delegates methods declarations, as per Swift 4
• Added some lines of code that save a default avatar image (the app's logo) in SignUp.swift
• Adjusted buttons and views positions in the Storyboard, because of iPhone X layout 
• Unchecked the Runtime API Checking in the Scheme -> Diagnostics, accordingly to this post: https://stackoverflow.com/a/44392584/3724800


AskIt is a Universal App Template where you can post any question and have users answering, you can do the same on other user’s questions. Users can also like questions from the Home screen or search for something on the Search screen.

Since its backend is by Parse Server you don’t have to buy any domain/hosting, there are NO PHP files to upload to a web server so you’ll save some money for server side, also because back4app offers a generous free plan.

AskIt is a native XCode project, Swift language, Storyboard, Universal, Push Notifications for likes and answers, super easy to customize, backend with Parse SDK hosted on http://back4app.com




About Parse SDK and back4app

Read this article for more info about back4app and Parse SDK: https://hubpages.com/technology/Parse-SDK-will-not-shutdown-in-thanks-to-back4app

Can I host Parse Server on my own server?

Yes, although I don’t provide support for the setup process, you can read the official Guide here: http://parseplatform.org

I get a Code signing error in Xcode 8.x

That’s a bug of Xcode 8 with macOS Sierra, check this sample video to see how to fix it: https://youtu.be/z2LemT1_LqA

How to remove AdMob interstitial ads

Simply use the Find tool in Xvode to find this line of code:
self.showInterstitial()
and comment it out in all files found by the Find tool

What about free support for this template?

I can offer free support for bugs encountered in the original code. Instead, if you’ve edited the code and messed something up with it, I may apply some fee to fix it either via TeamViewer or by checking your app project files directly on my computer.

Should I use the latest version of Xcode to edit this template?

Yes, I always update my apps to the latest version of the IDE.





  • XCode 9.x project – Swift – 64bit
  • iOS 8.0+ – Universal – Storyboard
  • AdMob Interstitial ads
  • Facebook login
  • Post/answer/like questions
  • Attach an image to your Questions
  • Works with Parse SDK hosted on back4app
  • Push Notifications for likes and answers
  • Report abusive contents (questions or answers)
  • Search for questions by keywords
  • Documentation and PSD icon graphics included
  • Easy to customize | Well commented code


  • Apple Mac with its latest OS version installed
  • The latest version of Xcode and some knowledge about its UI interface
  • Photoshop or any other image editor software
  • An Apple Developer account to submit apps to the App Store
  • An AdMob account to generate your own banner UNIT ID
  • A free account on back4app.com









by
by
by
by
by
by