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
// | |
// ContentView.swift | |
// LiveActivity | |
// | |
// Created by Ali Can Batur on 28.07.2022. | |
// | |
import SwiftUI | |
import ActivityKit |
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
// | |
// LiveActivityHelper.swift | |
// LiveActivity | |
// | |
// Created by Ali Can Batur on 29.07.2022. | |
// | |
import Foundation | |
import ActivityKit |
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
// | |
// Attribute.swift | |
// LiveActivity | |
// | |
// Created by Ali Can Batur on 28.07.2022. | |
// | |
import SwiftUI | |
import WidgetKit | |
import ActivityKit |
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
// | |
// Status.swift | |
// LiveActivity | |
// | |
// Created by Ali Can Batur on 29.07.2022. | |
// | |
import Foundation | |
enum Status: Codable { |
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
// | |
// BottomView.swift | |
// LiveActivity | |
// | |
// Created by Ali Can Batur on 29.07.2022. | |
// | |
import SwiftUI | |
struct BottomView: View { |
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
// Example JSON | |
var JSON = "{\n" + | |
"\"name\": \"Ali\",\n" + | |
"\"surname\": \"Batur\",\n" + | |
"\"age\":29\n" + | |
"}" | |
// Convert json string to data. JSON string is the response from restfull call. | |
var data: Data = JSON.data(using: .utf8)! |
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
// Example JSON | |
{ | |
"name": "Ali", | |
"surname": "Batur", | |
"age": 29 | |
} | |
// Our model | |
struct Person { | |
var name: String? |
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 ObjectMapper | |
open class FirebaseDateTransform: TransformType { | |
public typealias Object = Date | |
public typealias JSON = Double | |
public init() {} | |
open func transformFromJSON(_ value: Any?) -> Date? { |
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
[ | |
{ | |
"name": "Aba", | |
"sex": "K" | |
}, | |
{ | |
"name": "Abaca", | |
"sex": "K" | |
}, | |
{ |
NewerOlder