This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import CoreData | |
| //MARK: - Core Data Stack | |
| let dbName = "My_Data_Model_Name" | |
| func applicationWillTerminate(_ application: UIApplication) { | |
| // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. | |
| self.saveContext() | |
| } | |
| private lazy var applicationDocumentsDirectory: URL = { | |
| // The directory the application uses to store the Core Data store file. This code uses a directory named in the application's documents Application Support directory. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // ViewController.swift | |
| // Messenger | |
| // | |
| // Created by Anuraag Jain on 05/12/16. | |
| // Copyright © 2016 Anuraag. All rights reserved. | |
| // Part 2 : https://gist.github.com/anuraagdjain/b049fe19b15c02901b50bd6a82d2d147/edit | |
| import UIKit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // MessageDetailsViewController.swift | |
| // Messenger | |
| // | |
| // Created by Anuraag Jain on 05/12/16. | |
| // Copyright © 2016 Anuraag. All rights reserved. | |
| // Part 1 : https://gist.github.com/anuraagdjain/e874a8409225356233d56df435b96335 | |
| import UIKit | |
| import MobileCoreServices |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Source: https://github.com/ariok/TB_TwitterUI | |
| @IBOutlet weak var headerView: UIView! | |
| @IBOutlet weak var scrollView: UIScrollView! | |
| override viewDidLoad(){ | |
| scrollView.delegate = self | |
| /* | |
| Add below code for testing purposes. | |
| scrollView.contentSize = CGSize(width: self.view.frame.size.width, height: 1024) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Declare | |
| @IBOutlet weak var tableView:UITableView! | |
| var refreshControl = UIRefreshControl() | |
| //Adding in viewDidLoad() | |
| refreshControl.addTarget(self, action: #selector(ViewController.refreshEvents), for: .valueChanged) | |
| tableView.addSubView(refreshControl) | |
| //refreshEvents function | |
| func refreshEvents(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <key>UIViewControllerBasedStatusBarAppearance</key> | |
| <false/> | |
| //In AppDelegate.swift | |
| func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { | |
| // Override point for customization after application launch. | |
| UIApplication.shared.statusBarStyle = .lightContent //White colored status. | |
| return true | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <key>NSAppTransportSecurity</key> | |
| <dict> | |
| <key>NSAllowsArbitraryLoads</key> | |
| <true/> | |
| </dict> |
NewerOlder