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
var colorArray = ["blue", "white", "yellow", "red","blue", "white", "yellow", "red","blue", "white", "yellow", "red","blue", "white", "yellow", "red","blue", "white", "yellow", "red","yellow", "red","yellow", "red","yellow", "red", "red"] | |
func getMostColor(input: [String]) -> String{ | |
var topColor: String = "" | |
var colorDict: [String:Int] = [:] | |
for color in input{ | |
colorDict[color, default:0]+=1 | |
} |
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
// | |
// MotivasiHarianWidget.swift | |
// MotivasiHarianWidget | |
// | |
// Created by Ihwan ID on 13/01/21. | |
// | |
import WidgetKit | |
import SwiftUI | |
import Intents |
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
struct ContentView: View { | |
var body: some View { | |
TabView { | |
Text("Home Page") | |
.tabItem { | |
Image(systemName: "house.fill") | |
Text("Homeb") | |
} | |
Text("Favorite Page") | |
.tabItem { |
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
struct ContentView: View { | |
var body: some View { | |
let rangga = Student(name: "Rangga", age: 18) | |
let andi = Student(name: "Andi",age: 19) | |
let ihwan = Student(name: "Ihwan", age: 20) | |
let students = [rangga, andi, ihwan] | |
return List(students) { student in | |
StudentRow(student: student) | |
} |
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
import SwiftUI | |
struct ContentView: View { | |
var body: some View { | |
NavigationView{ | |
SwiftUIWebView(url: URL(string: "https://ihwan.id")) | |
} | |
} | |
} |
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
struct ContentView: View { | |
var body: some View { | |
TabView { | |
Text("Home Page") | |
.tabItem { | |
Image(systemName: "house.fill") | |
Text("Homeb") | |
} | |
Text("Favorite Page") | |
.tabItem { |
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 | |
// run | |
// | |
// Created by Ihwan ID on 30/03/20. | |
// Copyright © 2020 Ihwan ID. All rights reserved. | |
// | |
import UIKit |
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
// | |
// WebView.swift | |
// SwiftUIWebView | |
// | |
// Created by Ihwan ID on 13/12/20. | |
// | |
import SwiftUI | |
import WebKit |
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
{ | |
"user": { | |
"name": "Pak Bedu", | |
"email": "[email protected]" | |
}, | |
"children": [ | |
{ | |
"id": 123, | |
"name": "Wahyu Amarulloh", | |
"balance": 7500, |
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
import UIKit | |
import PlaygroundSupport | |
//let view2 = UIView() | |
//view2.alpha = 0.5 | |
let parrentView = UIView(frame: CGRect(x: 0, y: 0, width: 80, height: 80)) | |
parrentView.backgroundColor = .red |