I hereby claim:
- I am yunustek on github.
- I am ynsios (https://keybase.io/ynsios) on keybase.
- I have a public key ASBW2Szwi-x0-ttNXWabyyvsPX__SyOtMcW69A_shHrSdAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
final class TrapezoidView: UIView { | |
@IBInspectable | |
var isLeft: Bool = true { | |
didSet{ | |
self.initialize() | |
} | |
} | |
@IBInspectable | |
var color: UIColor = .white { |
import UIKit | |
open class BaseModel : Codable { | |
var deviceName: String? | |
private enum CodingKeys: String, CodingKey { case deviceName } | |
init() { } | |
public func encode(to encoder: Encoder) throws { |
@IBAction func faceButtonPressed(_ sender: Any) { | |
let accountID: String = "1235121234" | |
if let url = URL(string: "fb://profile/\(accountID)"), UIApplication.shared.canOpenURL(url) { | |
self.openUrl(url: url) | |
} else if let url = URL(string: "https://www.facebook.com/\(accountName)"), UIApplication.shared.canOpenURL(url) { | |
self.openUrl(url: url) | |
} | |
} |
func configureAccessibility(_ account: Account) { | |
photoButton.isAccessibilityElement = true | |
usernameLabel.isAccessibilityElement = true | |
pointButton.isAccessibilityElement = true | |
photoButton.accessibilityTraits = .button | |
usernameLabel.accessibilityTraits = .staticText | |
pointButton.accessibilityTraits = .button | |
//Point Button |
func configureAccessibility(_ account: Account) { | |
photoButton.isAccessibilityElement = true | |
usernameLabel.isAccessibilityElement = true | |
pointButton.isAccessibilityElement = true | |
photoButton.accessibilityTraits = .button | |
usernameLabel.accessibilityTraits = .staticText | |
pointButton.accessibilityTraits = .button | |
} |
func configureAccessibility(_ account: Account) { | |
photoButton.isAccessibilityElement = true | |
usernameLabel.isAccessibilityElement = true | |
pointButton.isAccessibilityElement = true | |
} |
class AccountViewController: UIViewController { | |
@IBOutlet var photoButton: UIButton! | |
@IBOutlet var usernameLabel: UILabel! | |
@IBOutlet var pointButton: UIButton! |
override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) { | |
self.contentHandler = contentHandler | |
bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent) | |
guard let bestAttemptContent = bestAttemptContent, // 1. bestAttemptContent nil olmadığına emin ol | |
let apsData = bestAttemptContent.userInfo["aps"] as? [String: Any], // 2. Payload dan aps'i al | |
let attachmentURLAsString = apsData["mediaUrl"] as? String, // 3. mediaUrl'i al | |
let attachmentURL = URL(string: attachmentURLAsString) else { // 4. String'i URL'e çevir | |
return | |
} |
/// Bir görüntüyü indirmek ve bir bildirimde sunmak için bu işlevi kullanın | |
/// - Parametereler: | |
/// - url: Resmin url'i | |
/// - completion: Görüntüyü, sonuç olarak UNNotificationAttachment biçiminde döndür | |
private func downloadImageFrom(url: URL, with completionHandler: @escaping (UNNotificationAttachment?) -> Void) { | |
let task = URLSession.shared.downloadTask(with: url) { (downloadedUrl, response, error) in | |
// 1. Url yoksa nil gönder ve geri dön | |
guard let downloadedUrl = downloadedUrl else { | |
completionHandler(nil) | |
return |