Skip to content

Instantly share code, notes, and snippets.

View vani2's full-sized avatar

Ivan Vavilov vani2

View GitHub Profile
import UIKit
import Model
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
let user = User(name: “Johny”)
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
return true
public struct User {
public let name: String
public init(name: String) {
self.name = name
}
}
Pod::Spec.new do |s|
s.name = ‘Model’
s.version = ‘1.0’
s.summary = ‘Model Module’
s.homepage = ‘a link’
s.author = { ‘vani2’ => ‘vani2@me.com’ }
s.source = { :git => ‘a link’, :tag => s.version, :submodules => true }
s.platform = :iOS, ’13.0’
s.swift_version = ‘5.1’
s.source_files = ‘Classes/*’
platform :iOS, ’13.0’
use_frameworks!
target ‘ModuleExample’ do
pod ‘Model’, :path => ‘Model’
end
@vani2
vani2 / swift-ui-sample.swift
Last active December 29, 2019 11:58
Swift UI sample
import SwiftUI
struct ContentView: View {
var body: some View {
VStack(alignment: .leading, spacing: 8) {
Image("image")
.cornerRadius(8)
VStack(alignment: .leading, spacing: 2) {
Text("A day in Shark Fin Cove")
.font(.title)
@vani2
vani2 / jcbc.kt
Created December 29, 2019 11:27
Jetpack Compose backward capability
@Composable
@GenerateView
fun Greeting(name: String) {/* ... */}
<GreetingView android:id="@+id/greeting"
app:name="@string/greeting_name" />
val greeting: GreetingView = findViewById(R.id.greeting)
greeting.setName("Jim")
@vani2
vani2 / jc.kt
Created December 29, 2019 11:07
Jetpack Compose Example
@Composable
fun NewsStory() {
val image = +imageResource(R.drawable.header)
MaterialTheme {
Column(
modifier = Spacing(16.dp)
) {
Container(modifier = Height(180.dp) wraps Expanded) {
Clip(shape = RoundedCornerShape(8.dp)) {
@vani2
vani2 / project
Created September 11, 2018 18:03
Project structure
MyProject-iOS
|_ReadMe.md
|_Source
|_myProject
|_fastlane
|_myProject
|_Classes
|_Business Logic
|_Parser
|_Service
@vani2
vani2 / DateDecodingStrategy.swift
Last active March 3, 2021 08:37
Date Decoding Strategy
import Foundation
struct ISODateModel: Codable {
let date: Date
}
var json = """
{
"date": "2018-04-20T14:20:00-0700"
}
@vani2
vani2 / cocoapods.diff
Created May 19, 2018 11:25
Cocoapods diff
--- a/PODInspect/PODInspect.xcodeproj/project.pbxproj
+++ b/PODInspect/PODInspect.xcodeproj/project.pbxproj
@@ -12,6 +12,7 @@
5132347E1FE94F0900031F77 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5132347C1FE94F0900031F77 /* Main.storyboard */; };
513234801FE94F0900031F77 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5132347F1FE94F0900031F77 /* Assets.xcassets */; };
513234831FE94F0900031F77 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 513234811FE94F0900031F77 /* LaunchScreen.storyboard */; };
+ 80BFE252F8CC89026D002347 /* Pods_PODInspect.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F92C797D84680452FD95785F /* Pods_PODInspect.framework */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */