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
| package com.octopepper.yummypets.component.dogchow | |
| import android.content.Context | |
| import android.util.AttributeSet | |
| import android.view.View | |
| import android.widget.LinearLayout | |
| import com.octopepper.yummypets.R | |
| import kotlinx.android.synthetic.main.dogchow_benefit.view.* | |
| class DogchowBenefitView(context: Context, attrs: AttributeSet) : LinearLayout(context, attrs) { |
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 | |
| // steviademo | |
| // | |
| // Created by Onur Geneş on 17.07.2018. | |
| // Copyright © 2018 Onur Geneş. All rights reserved. | |
| // | |
| import UIKit | |
| import Stevia |
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
| // | |
| // View.swift | |
| // heroandstevia | |
| // | |
| // Created by Sacha on 31/07/2018. | |
| // Copyright © 2018 Onur Geneş. All rights reserved. | |
| // | |
| import UIKit | |
| import Stevia |
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
| protocol <#Depencency#> { | |
| func foo() | |
| } | |
| protocol Has<#Depencency#> { | |
| func get<#Depencency#> () -> <#Depencency#> | |
| } | |
| // Implementation |
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
| public extension Optional where Wrapped == String { | |
| var isEmptyOrNil: Bool { return (self ?? "").isEmpty } | |
| } |
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
| // Say you're on the main thread | |
| DispatchQueue.global(qos: DispatchQoS.QoSClass.background).async { | |
| // Do something expensinve in background | |
| var mySuperLongComputedResult = computeSuperLongStuff() | |
| DispatchQueue.main.async { | |
| // come back to the main thread to ping UI | |
| label.text = mySuperLongComputedResult | |
| } | |
| } |
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
| tableView.register(MyCell.self, forCellReuseIdentifier: MyCell.reuseIdentifier) |
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
| tableView.register(Mycell.self) |
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
| extension UITableView { | |
| func register<T: UITableViewCell>(_: T.Type) where T: Reusable { | |
| register(T.self, forCellReuseIdentifier: T.reuseIdentifier) | |
| } | |
| } |
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
| extension Reusable { | |
| static var reuseIdentifier: String { | |
| return String(describing: Self.self) | |
| } | |
| } |