Skip to content

Instantly share code, notes, and snippets.

View alperenarc's full-sized avatar
💻
I may be slow to respond.

Alperen Arıcı alperenarc

💻
I may be slow to respond.
View GitHub Profile
@objc protocol ThisProtocol {
@objc optional var name: String { get }
@objc optional func optionalFunc() -> String
}
protocol MyPerson {
var name: String { get set }
static var surname: String { get set }
init(name: String)
func printMyName()
}
extension MyPerson {
func myOptionalFunction() {
print("Does not have to be overridden (From Protocol)")
class Person {
var name: String
init(name: String) {
self.name = name
}
func printMyName() { fatalError("Error here 😈") }
func printMyAge(age: Int) { }
}
@alperenarc
alperenarc / ValueTypeSample.dart
Created December 8, 2020 08:17
Reference and Value type in Dart
void main() {
List<A> baseList = [];
baseList.add(A(value: 1, description: 'Alperen Arıcı'));
baseList.add(A(value: 2, description: 'İsmail Özalp'));
baseList.add(A(value: 3, description: 'Teyyihan Aksu'));
baseList.add(A(value: 4, description: 'Alperen Ünal'));
List<A> secondList = [];
for (final model in baseList) {
A cloningModel = A.clone(model);
{
"lat": 38.75,
"lon": 35.5,
"timezone": "Europe/Istanbul",
"timezone_offset": 10800,
"daily": [
{
"dt": 1591952400,
"sunrise": 1591927960,
"sunset": 1591981399,
{
"lat": 38.75,
"lon": 35.5,
"timezone": "Europe/Istanbul",
"timezone_offset": 10800,
"hourly": [
{
"dt": 1591891200,
"temp": 289.15,
"feels_like": 287.9,