This file contains 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 Foundation | |
import Firebase | |
enum FBCollectionReferences :String { | |
case Category | |
case Item | |
case Cart | |
case User | |
} |
This file contains 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
//MARK: - Category | |
public let ConstantCategoryID = "categoryID" | |
public let ConstantCategoryName = "categoryName" | |
public let ConstantCategoryImageName = "categoryImageName" | |
public let ConstantCategoryImage = "categoryImage" |
This file contains 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 Foundation | |
import Alamofire | |
class APIService { | |
static let shared = APIService() | |
func downloadPDF (completion: @escaping(_ error: Error?) -> Void) { | |
let destination: DownloadRequest.Destination = { _ , _ in | |
This file contains 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
func savePdf() { | |
let pdfData = try? Data.init(contentsOf: URL(string: "http://www.africau.edu/images/default/sample.pdf")!) | |
let documentURL = (FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)).first! as URL | |
let pdfNameFromUrl = "TestFile-\(Int.random(in: 1..<10000)).pdf" | |
let actualPath = documentURL.appendingPathComponent(pdfNameFromUrl) | |
This file contains 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
Montana | |
Idaho | |
Nevada | |
Oregon | |
Arizona | |
Utah | |
Colorado | |
Wyoming | |
Oklahoma | |
Kansas |
This file contains 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 Foundation | |
//MARK: - Constants & Variables | |
let name = "Ahmed" | |
//name = "Mohamed" // Will give an error | |
var age = 25 | |
age = 26 |
This file contains 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 Foundation | |
//MARK: - Constants & Variables | |
let name = "Ahmed" | |
//name = "Mohamed" // Will give an error | |
var age = 25 | |
age = 26 |
This file contains 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 Foundation | |
var welcome = "Welcome to Menaim Academy" | |
var watcherName = "Mohamed" | |
welcome += watcherName | |
//print(welcome, watcherName) | |
let characters: [Character] = ["A", "H", "M", "E", "D"] |
This file contains 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 Foundation | |
// MARK: - Comments | |
// var greeting = "Hello, playground" // Command / | |
/* | |
ahmed | |
menaim | |
academy |
This file contains 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 Foundation | |
var stringNumber: String? // We can identify any optional variable using -> ? | |
var number = 5 | |
//print(Int(stringNumber!)! + number) // Force unwrapping -> ! = Make sure that I have a value here |
OlderNewer