├── .gitignore ├── .idea ├── .name ├── artifacts │ └── common_jvm.xml ├── compiler.xml ├── encodings.xml ├── misc.xml ├── modules.xml └── vcs.xml ├── LICENSE ├── README.md ├── android ├── .idea │ ├── misc.xml │ ├── modules.xml │ └── workspace.xml ├── app │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── org │ │ │ └── jetbrains │ │ │ └── kotlinconf │ │ │ └── ExampleInstrumentedTest.kt │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── ic_launcher-web.png │ │ ├── java │ │ │ └── com │ │ │ │ └── github │ │ │ │ └── florent37 │ │ │ │ └── sample │ │ │ │ ├── DependencyManager.kt │ │ │ │ ├── MainApplication.kt │ │ │ │ ├── storage │ │ │ │ └── PlatformSettings.kt │ │ │ │ └── ui │ │ │ │ ├── GithubFragment.kt │ │ │ │ ├── MainActivity.kt │ │ │ │ ├── RepoViewHolder.kt │ │ │ │ └── ReposAdapter.kt │ │ └── res │ │ │ ├── drawable │ │ │ ├── ic_launcher_foreground.xml │ │ │ └── roundrect_white.xml │ │ │ ├── layout │ │ │ ├── activity_main.xml │ │ │ ├── cell_repo.xml │ │ │ └── fragment_user.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── values-v21 │ │ │ └── styles.xml │ │ │ ├── values │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ │ └── xml │ │ │ ├── backup_descriptor.xml │ │ │ └── network_security_config.xml │ │ └── test │ │ └── java │ │ └── org │ │ └── jetbrains │ │ └── kotlinconf │ │ └── ExampleUnitTest.kt └── build.gradle ├── appios ├── .gitignore ├── LICENSE.md ├── Podfile ├── Podfile.lock ├── Pods │ ├── Manifest.lock │ ├── Pods.xcodeproj │ │ └── project.pbxproj │ ├── SDWebImage │ │ ├── LICENSE │ │ ├── README.md │ │ └── SDWebImage │ │ │ ├── NSData+ImageContentType.h │ │ │ ├── NSData+ImageContentType.m │ │ │ ├── NSImage+WebCache.h │ │ │ ├── NSImage+WebCache.m │ │ │ ├── SDImageCache.h │ │ │ ├── SDImageCache.m │ │ │ ├── SDImageCacheConfig.h │ │ │ ├── SDImageCacheConfig.m │ │ │ ├── SDWebImageCompat.h │ │ │ ├── SDWebImageCompat.m │ │ │ ├── SDWebImageDecoder.h │ │ │ ├── SDWebImageDecoder.m │ │ │ ├── SDWebImageDownloader.h │ │ │ ├── SDWebImageDownloader.m │ │ │ ├── SDWebImageDownloaderOperation.h │ │ │ ├── SDWebImageDownloaderOperation.m │ │ │ ├── SDWebImageManager.h │ │ │ ├── SDWebImageManager.m │ │ │ ├── SDWebImageOperation.h │ │ │ ├── SDWebImagePrefetcher.h │ │ │ ├── SDWebImagePrefetcher.m │ │ │ ├── UIButton+WebCache.h │ │ │ ├── UIButton+WebCache.m │ │ │ ├── UIImage+GIF.h │ │ │ ├── UIImage+GIF.m │ │ │ ├── UIImage+MultiFormat.h │ │ │ ├── UIImage+MultiFormat.m │ │ │ ├── UIImageView+HighlightedWebCache.h │ │ │ ├── UIImageView+HighlightedWebCache.m │ │ │ ├── UIImageView+WebCache.h │ │ │ ├── UIImageView+WebCache.m │ │ │ ├── UIView+WebCache.h │ │ │ ├── UIView+WebCache.m │ │ │ ├── UIView+WebCacheOperation.h │ │ │ └── UIView+WebCacheOperation.m │ └── Target Support Files │ │ ├── Pods-konfswift │ │ ├── Info.plist │ │ ├── Pods-konfswift-Info.plist │ │ ├── Pods-konfswift-acknowledgements.markdown │ │ ├── Pods-konfswift-acknowledgements.plist │ │ ├── Pods-konfswift-dummy.m │ │ ├── Pods-konfswift-frameworks.sh │ │ ├── Pods-konfswift-resources.sh │ │ ├── Pods-konfswift-umbrella.h │ │ ├── Pods-konfswift.debug.xcconfig │ │ ├── Pods-konfswift.modulemap │ │ └── Pods-konfswift.release.xcconfig │ │ ├── Pods-konfswiftTests │ │ ├── Info.plist │ │ ├── Pods-konfswiftTests-Info.plist │ │ ├── Pods-konfswiftTests-acknowledgements.markdown │ │ ├── Pods-konfswiftTests-acknowledgements.plist │ │ ├── Pods-konfswiftTests-dummy.m │ │ ├── Pods-konfswiftTests-frameworks.sh │ │ ├── Pods-konfswiftTests-resources.sh │ │ ├── Pods-konfswiftTests-umbrella.h │ │ ├── Pods-konfswiftTests.debug.xcconfig │ │ ├── Pods-konfswiftTests.modulemap │ │ └── Pods-konfswiftTests.release.xcconfig │ │ └── SDWebImage │ │ ├── Info.plist │ │ ├── SDWebImage-Info.plist │ │ ├── SDWebImage-dummy.m │ │ ├── SDWebImage-prefix.pch │ │ ├── SDWebImage-umbrella.h │ │ ├── SDWebImage.modulemap │ │ └── SDWebImage.xcconfig ├── appswift │ ├── Base.lproj │ │ └── Main.storyboard │ ├── Info.plist │ ├── resources │ │ ├── Assets.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ ├── Contents.json │ │ │ │ ├── Icon-App-20x20@2x.png │ │ │ │ ├── Icon-App-20x20@3x.png │ │ │ │ ├── Icon-App-29x29@2x.png │ │ │ │ ├── Icon-App-29x29@3x.png │ │ │ │ ├── Icon-App-40x40@2x.png │ │ │ │ ├── Icon-App-40x40@3x.png │ │ │ │ ├── Icon-App-60x60@2x.png │ │ │ │ ├── Icon-App-60x60@3x.png │ │ │ │ └── Icon-App-iTunes.png │ │ │ ├── Contents.json │ │ │ └── user_default.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── user-1.png │ │ └── Base.lproj │ │ │ └── LaunchScreen.storyboard │ └── ui │ │ ├── AppDelegate.swift │ │ ├── DependencyManager.swift │ │ ├── GithubViewController.swift │ │ ├── PlatformLoggerIos.swift │ │ ├── RepoCell.swift │ │ └── UI.swift ├── appwiftTests │ ├── Info.plist │ └── appswiftTests.swift ├── konfswift.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata └── konfswift.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── build.gradle ├── common ├── build.gradle └── src │ ├── commonMain │ └── kotlin │ │ └── com │ │ └── github │ │ └── florent37 │ │ └── kotlinnative │ │ ├── api │ │ ├── ExpectSuccess.kt │ │ ├── GithubApi.kt │ │ └── JsonKotlinxSerializer.kt │ │ ├── data │ │ ├── GithubRepositoryImpl.kt │ │ ├── Repository.kt │ │ └── UserJSON.kt │ │ ├── log │ │ └── Logger.kt │ │ ├── model │ │ └── UserModel.kt │ │ ├── presentation │ │ ├── BaseView.kt │ │ ├── GithubPresenter.kt │ │ ├── GithubRepository.kt │ │ └── GithubView.kt │ │ └── storage │ │ └── Settings.kt │ ├── commonTest │ └── kotlin │ │ └── DateTest.kt │ └── iosMain │ └── kotlin │ └── com │ └── github │ └── florent37 │ └── kotlinnative │ └── PlatformSettings.kt ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── medias ├── android_code.png ├── iphone_android.png └── xcode_code.png └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the ART/Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | out/ 15 | 16 | # Gradle files 17 | .gradle/ 18 | build/ 19 | 20 | # Local configuration file (sdk path, etc) 21 | local.properties 22 | 23 | # Proguard folder generated by Eclipse 24 | proguard/ 25 | 26 | # Log Files 27 | *.log 28 | 29 | # Android Studio Navigation editor temp files 30 | .navigation/ 31 | 32 | # Android Studio captures folder 33 | captures/ 34 | 35 | # IntelliJ 36 | *.iml 37 | .idea/workspace.xml 38 | .idea/tasks.xml 39 | .idea/gradle.xml 40 | .idea/assetWizardSettings.xml 41 | .idea/dictionaries 42 | .idea/libraries 43 | .idea/caches 44 | 45 | # Keystore files 46 | # Uncomment the following line if you do not want to check your keystore files in. 47 | #*.jks 48 | 49 | # External native build folder generated in Android Studio 2.2 and later 50 | .externalNativeBuild 51 | 52 | # Google Services (e.g. APIs or Firebase) 53 | google-services.json 54 | 55 | # Freeline 56 | freeline.py 57 | freeline/ 58 | freeline_project_description.json 59 | 60 | # fastlane 61 | fastlane/report.xml 62 | fastlane/Preview.html 63 | fastlane/screenshots 64 | fastlane/test_output 65 | fastlane/readme.md 66 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | kotlinnative-app -------------------------------------------------------------------------------- /.idea/artifacts/common_jvm.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | $PROJECT_DIR$/common/build/libs 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # KotlinNative Sample 2 | 3 | Sample project for my Medium Story : **My first experience with kotlin native** 4 | 5 | [**My first experience with kotlin native**](https://medium.com/@champigny.florent/my-first-experience-with-kotlin-native-988e96f26657) 6 | 7 | [![screen](https://raw.githubusercontent.com/florent37/KotlinNativeSample/master/medias/iphone_android.png)](https://www.github.com/florent37/KotlinNativeSample) 8 | 9 | # How to build 10 | 11 | Just run 12 | ``` 13 | ./gradlew build 14 | ``` 15 | 16 | It will generate kotlin `common` module implementation for Android/JVM and for iOS/Native 17 | 18 | # XCode project 19 | 20 | Inside the `appios/` directory you'll find the xcode workspace, bound to the kotlin-native framework generated from the `common` module 21 | 22 | Open the xcode project to generate the iPhone app. 23 | 24 | [![screen](https://raw.githubusercontent.com/florent37/KotlinNativeSample/master/medias/xcode_code.png)](https://www.github.com/florent37/KotlinNativeSample) 25 | 26 | # Android project 27 | 28 | Inside the `android/` directory you'll find the android app code 29 | 30 | Add an android configuration on your IDE to push the application to your phone. 31 | 32 | [![screen](https://raw.githubusercontent.com/florent37/KotlinNativeSample/master/medias/android_code.png)](https://www.github.com/florent37/KotlinNativeSample) 33 | -------------------------------------------------------------------------------- /android/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 36 | 37 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 78 | -------------------------------------------------------------------------------- /android/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | dependencies { 3 | classpath "com.android.tools.build:gradle:$gradle_android_version" 4 | } 5 | repositories { 6 | google() 7 | } 8 | } 9 | 10 | apply plugin: 'com.android.application' 11 | apply plugin: 'kotlin-android' 12 | apply plugin: 'kotlin-android-extensions' 13 | apply plugin: 'kotlinx-serialization' 14 | apply plugin: 'kotlin-kapt' 15 | 16 | android { 17 | compileSdkVersion 27 18 | defaultConfig { 19 | applicationId 'com.github.florent37.kotlin.sample' 20 | minSdkVersion 16 21 | targetSdkVersion 27 22 | multiDexEnabled true 23 | versionCode 10 24 | versionName '1.0.9' 25 | testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner' 26 | } 27 | buildTypes { 28 | debug {} 29 | release {} 30 | } 31 | lintOptions { 32 | checkReleaseBuilds false 33 | abortOnError false 34 | } 35 | 36 | flavorDimensions "server" 37 | productFlavors { 38 | local { 39 | dimension "server" 40 | } 41 | prod { 42 | dimension "server" 43 | } 44 | } 45 | 46 | packagingOptions { 47 | exclude 'META-INF/common.kotlin_module' 48 | } 49 | 50 | tasks.lint.enabled = false 51 | } 52 | 53 | dependencies { 54 | implementation project(':common') 55 | implementation fileTree(include: ['*.jar'], dir: 'libs') 56 | implementation 'com.android.support:multidex:1.0.3' 57 | 58 | implementation 'com.android.support:appcompat-v7:27.1.1' 59 | implementation 'com.android.support:support-v4:27.1.1' 60 | implementation 'com.android.support:recyclerview-v7:27.1.1' 61 | implementation 'com.android.support.constraint:constraint-layout:1.1.3' 62 | 63 | kapt 'android.arch.lifecycle:compiler:1.1.1' 64 | 65 | implementation 'com.github.bumptech.glide:glide:3.8.0' 66 | implementation 'com.github.florent37:shapeofview:1.3.2' 67 | 68 | implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version" 69 | 70 | implementation "io.ktor:ktor-client-okhttp:$ktor_version" 71 | implementation "io.ktor:ktor-client-json-jvm:$ktor_version" 72 | 73 | testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version" 74 | testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version" 75 | testImplementation 'junit:junit:4.12' 76 | androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', { 77 | exclude group: 'com.android.support', module: 'support-annotations' 78 | }) 79 | } -------------------------------------------------------------------------------- /android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | -keepattributes SourceFile,LineNumberTable,Signature,InnerClasses,Exceptions,Annotation 18 | 19 | -dontusemixedcaseclassnames 20 | -dontskipnonpubliclibraryclasses 21 | -dontpreverify 22 | -verbose 23 | 24 | # If you keep the line number information, uncomment this to 25 | # hide the original source file name. 26 | #-renamesourcefileattribute SourceFile 27 | 28 | -keep class io.ktor.** { *; } 29 | -keep class android.arch.** { *; } 30 | -keep class kotlin.reflect.** { *; } 31 | -keep class androidx.media.** { *; } 32 | -keep class org.jetbrains.anko.** { *; } 33 | -keep class android.support.v7.widget.** { *; } 34 | -keep class kotlinx.coroutines.** { *; } 35 | 36 | -dontwarn io.netty.** 37 | -dontwarn com.typesafe.** 38 | -dontwarn org.jetbrains.anko.** 39 | -dontwarn org.slf4j.** 40 | -dontwarn kotlin.reflect.jvm.** 41 | -dontwarn androidx.media.** 42 | -------------------------------------------------------------------------------- /android/app/src/androidTest/java/org/jetbrains/kotlinconf/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package org.jetbrains.kotlinconf 2 | 3 | import android.support.test.InstrumentationRegistry 4 | import android.support.test.runner.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getTargetContext() 22 | assertEquals("org.jetbrains.kotlinconf", appContext.packageName) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /android/app/src/main/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/florent37/KotlinNativeSample/fca6abf35ea759cecaa887ab52dcf5b8696f64b8/android/app/src/main/ic_launcher-web.png -------------------------------------------------------------------------------- /android/app/src/main/java/com/github/florent37/sample/DependencyManager.kt: -------------------------------------------------------------------------------- 1 | package com.github.florent37.sample 2 | 3 | import android.app.Application 4 | import android.content.Context 5 | import android.util.Log 6 | import kotlinx.coroutines.Dispatchers 7 | import com.github.florent37.kotlinnative.log.PlatformLogger 8 | import com.github.florent37.kotlinnative.data.GithubRepositoryImpl 9 | import com.github.florent37.kotlinnative.presentation.GithubPresenter 10 | import com.github.florent37.kotlinnative.presentation.GithubRepository 11 | 12 | class DependencyManager(private val application: Application) { 13 | 14 | val githubRepository: GithubRepository by lazy { 15 | GithubRepositoryImpl(logger) 16 | } 17 | 18 | val coroutineContext by lazy { Dispatchers.Main } 19 | 20 | val logger: PlatformLogger by lazy { 21 | object : PlatformLogger { 22 | override fun logException(tag: String, text: String, exception: Throwable?) { 23 | Log.e(tag, text, exception) 24 | } 25 | 26 | override fun log(tag: String, text: String) { 27 | Log.d(tag, text) 28 | } 29 | } 30 | } 31 | 32 | fun githubPresenter() = GithubPresenter(coroutineContext, githubRepository) 33 | } 34 | 35 | fun dependencies(context: Context): DependencyManager { 36 | val app = context.applicationContext 37 | val kotlinConfApplication = app as MainApplication 38 | return kotlinConfApplication.dependencyManager 39 | } -------------------------------------------------------------------------------- /android/app/src/main/java/com/github/florent37/sample/MainApplication.kt: -------------------------------------------------------------------------------- 1 | package com.github.florent37.sample 2 | 3 | import android.app.* 4 | import android.content.* 5 | import android.support.multidex.* 6 | 7 | class MainApplication : Application() { 8 | 9 | val dependencyManager: DependencyManager by lazy { DependencyManager(this) } 10 | 11 | override fun onCreate() { 12 | super.onCreate() 13 | 14 | Thread.setDefaultUncaughtExceptionHandler { _, throwable -> 15 | println(throwable) 16 | throwable.printStackTrace() 17 | throwable?.cause?.printStackTrace() 18 | } 19 | } 20 | 21 | override fun attachBaseContext(base: Context?) { 22 | super.attachBaseContext(base) 23 | MultiDex.install(this) 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /android/app/src/main/java/com/github/florent37/sample/storage/PlatformSettings.kt: -------------------------------------------------------------------------------- 1 | package com.github.florent37.sample.storage 2 | 3 | import android.content.* 4 | import android.preference.* 5 | import com.github.florent37.kotlinnative.storage.Settings 6 | 7 | class PlatformSettings constructor(context: Context) : Settings { 8 | 9 | private val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context) 10 | 11 | override fun putBoolean(key: String, value: Boolean) { 12 | sharedPreferences.edit().putBoolean(key, value).apply() 13 | } 14 | 15 | override fun getBoolean(key: String, defaultValue: Boolean): Boolean = 16 | sharedPreferences.getBoolean(key, defaultValue) 17 | 18 | override fun putString(key: String, value: String) { 19 | sharedPreferences.edit().putString(key, value).apply() 20 | } 21 | 22 | override fun getString(key: String, defaultValue: String): String = 23 | sharedPreferences.getString(key, defaultValue) 24 | } -------------------------------------------------------------------------------- /android/app/src/main/java/com/github/florent37/sample/ui/GithubFragment.kt: -------------------------------------------------------------------------------- 1 | package com.github.florent37.sample.ui 2 | 3 | import android.os.* 4 | import android.support.v4.app.Fragment 5 | import android.support.v7.widget.LinearLayoutManager 6 | import android.util.Log 7 | import android.view.* 8 | import android.view.KeyEvent.KEYCODE_ENTER 9 | import android.widget.Toast 10 | import com.bumptech.glide.Glide 11 | import com.github.florent37.kotlinnative.data.Repository 12 | import com.github.florent37.kotlinnative.model.UserModel 13 | import com.github.florent37.kotlinnative.presentation.GithubView 14 | import com.github.florent37.sample.R 15 | import com.github.florent37.sample.dependencies 16 | import kotlinx.android.synthetic.main.fragment_user.* 17 | 18 | class GithubFragment : Fragment(), GithubView { 19 | 20 | private val presenter by lazy { dependencies(context!!).githubPresenter() } 21 | private var adapter = GithubAdapter{ 22 | 23 | } 24 | 25 | override var isLoading: Boolean = false 26 | set(value) { 27 | loader?.visibility = if(value) View.VISIBLE else View.GONE 28 | } 29 | 30 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?) = 31 | layoutInflater.inflate(R.layout.fragment_user, container, false) 32 | 33 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { 34 | super.onViewCreated(view, savedInstanceState) 35 | presenter.bind(this) 36 | 37 | editName.setOnKeyListener { v, keyCode, event -> 38 | if (keyCode == KEYCODE_ENTER) { 39 | val text = editName.text.toString() 40 | presenter.loadUser(text) 41 | true 42 | } 43 | false 44 | } 45 | 46 | recyclerView.adapter = adapter 47 | recyclerView.layoutManager = LinearLayoutManager(context!!) 48 | } 49 | 50 | override fun onDestroy() { 51 | super.onDestroy() 52 | presenter.unbind() 53 | } 54 | 55 | override fun displayUser(user: UserModel) { 56 | userName.text = user.name 57 | company.text = user.company 58 | Glide.with(this).load(user.avatar_url).into(userImage) 59 | } 60 | 61 | override fun displayRepos(repos: List) { 62 | adapter.data = repos 63 | } 64 | 65 | override fun showError(error: Throwable) { 66 | Log.d("error", error.localizedMessage, error) 67 | Toast.makeText(context, error.localizedMessage, Toast.LENGTH_SHORT).show() 68 | } 69 | } -------------------------------------------------------------------------------- /android/app/src/main/java/com/github/florent37/sample/ui/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.github.florent37.sample.ui 2 | 3 | import android.os.* 4 | import android.support.v7.app.* 5 | import com.github.florent37.sample.R 6 | 7 | class MainActivity : AppCompatActivity() { 8 | 9 | override fun onCreate(savedInstanceState: Bundle?) { 10 | super.onCreate(savedInstanceState) 11 | setContentView(R.layout.activity_main) 12 | 13 | supportFragmentManager 14 | .beginTransaction() 15 | .add(R.id.fragment_container, GithubFragment(), "GithubFragment") 16 | .commit() 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/github/florent37/sample/ui/RepoViewHolder.kt: -------------------------------------------------------------------------------- 1 | package com.github.florent37.sample.ui 2 | 3 | import android.support.v7.widget.RecyclerView 4 | import android.view.View 5 | import android.widget.TextView 6 | import com.github.florent37.kotlinnative.data.Repository 7 | import com.github.florent37.sample.R 8 | 9 | class RepoViewHolder(view: View, clickListener: (Repository) -> Unit) : RecyclerView.ViewHolder(view) { 10 | 11 | val tvName: TextView 12 | var repository: Repository? = null 13 | 14 | init { 15 | tvName = view.findViewById(R.id.name) 16 | view.setOnClickListener { 17 | repository?.let(clickListener) 18 | } 19 | } 20 | 21 | fun bind(repository: Repository){ 22 | tvName.text = repository.name 23 | } 24 | } -------------------------------------------------------------------------------- /android/app/src/main/java/com/github/florent37/sample/ui/ReposAdapter.kt: -------------------------------------------------------------------------------- 1 | package com.github.florent37.sample.ui 2 | 3 | import android.support.v7.widget.RecyclerView 4 | import android.view.LayoutInflater 5 | import android.view.ViewGroup 6 | import com.github.florent37.kotlinnative.data.Repository 7 | import com.github.florent37.sample.R 8 | 9 | class GithubAdapter( 10 | private val onRepoClicked: (Repository) -> Unit 11 | ) : RecyclerView.Adapter() { 12 | 13 | var data: List = emptyList() 14 | set(value) { 15 | field = value 16 | notifyDataSetChanged() 17 | } 18 | 19 | override fun onBindViewHolder(holder: RepoViewHolder, position: Int) { 20 | holder.bind(data[position]) 21 | } 22 | 23 | override fun getItemCount() = data.size 24 | 25 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = 26 | RepoViewHolder( 27 | LayoutInflater.from(parent.context).inflate(R.layout.cell_repo, parent, false), 28 | onRepoClicked 29 | ) 30 | } 31 | 32 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 6 | 8 | 11 | 14 | 17 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/roundrect_white.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /android/app/src/main/res/layout/cell_repo.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 16 | -------------------------------------------------------------------------------- /android/app/src/main/res/layout/fragment_user.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 15 | 16 | 35 | 36 | 46 | 47 | 48 | 56 | 57 | 63 | 64 | 65 | 66 | 74 | 84 | 91 | 92 | 93 | 94 | 101 | 102 | 111 | 112 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/florent37/KotlinNativeSample/fca6abf35ea759cecaa887ab52dcf5b8696f64b8/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/florent37/KotlinNativeSample/fca6abf35ea759cecaa887ab52dcf5b8696f64b8/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/florent37/KotlinNativeSample/fca6abf35ea759cecaa887ab52dcf5b8696f64b8/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/florent37/KotlinNativeSample/fca6abf35ea759cecaa887ab52dcf5b8696f64b8/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/florent37/KotlinNativeSample/fca6abf35ea759cecaa887ab52dcf5b8696f64b8/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/florent37/KotlinNativeSample/fca6abf35ea759cecaa887ab52dcf5b8696f64b8/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/florent37/KotlinNativeSample/fca6abf35ea759cecaa887ab52dcf5b8696f64b8/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/florent37/KotlinNativeSample/fca6abf35ea759cecaa887ab52dcf5b8696f64b8/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/florent37/KotlinNativeSample/fca6abf35ea759cecaa887ab52dcf5b8696f64b8/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/florent37/KotlinNativeSample/fca6abf35ea759cecaa887ab52dcf5b8696f64b8/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #031137 4 | #24203D 5 | #FF5B00 6 | #50000000 7 | #20000000 8 | @android:color/transparent 9 | #20000000 10 | #10000000 11 | @android:color/transparent 12 | #FFFFFF 13 | 14 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Kotlin-Native Githug 3 | 4 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 11 | 15 | 16 | -------------------------------------------------------------------------------- /android/app/src/main/res/xml/backup_descriptor.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/app/src/main/res/xml/network_security_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /android/app/src/test/java/org/jetbrains/kotlinconf/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package org.jetbrains.kotlinconf 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | maven { url "http://kotlin.bintray.com/kotlin-dev" } 4 | jcenter() 5 | google() 6 | } 7 | dependencies { 8 | classpath "com.android.tools.build:gradle:$gradle_android_version" 9 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 10 | } 11 | } 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | task clean(type: Delete) { 19 | delete rootProject.buildDir 20 | } 21 | 22 | dependencies { 23 | } -------------------------------------------------------------------------------- /appios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | **/xcuserdata/** 3 | -------------------------------------------------------------------------------- /appios/LICENSE.md: -------------------------------------------------------------------------------- 1 | # Third-party libraries and components 2 | 3 | - User icon 4 | https://www.flaticon.com/free-icon/user_149992 5 | -------------------------------------------------------------------------------- /appios/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '9.0' 2 | 3 | target 'konfswift' do 4 | use_frameworks! 5 | 6 | # Pods for konfswift 7 | pod 'SDWebImage', '~> 4.1.0' 8 | 9 | target 'konfswiftTests' do 10 | inherit! :search_paths 11 | # Pods for testing 12 | end 13 | 14 | end 15 | -------------------------------------------------------------------------------- /appios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - SDWebImage (4.1.2): 3 | - SDWebImage/Core (= 4.1.2) 4 | - SDWebImage/Core (4.1.2) 5 | 6 | DEPENDENCIES: 7 | - SDWebImage (~> 4.1.0) 8 | 9 | SPEC REPOS: 10 | https://github.com/cocoapods/specs.git: 11 | - SDWebImage 12 | 13 | SPEC CHECKSUMS: 14 | SDWebImage: cb6f9f266a9977741efcbc21e618e8be3734c774 15 | 16 | PODFILE CHECKSUM: 4ebf2051bce7e97bb83a4459902868cafb888105 17 | 18 | COCOAPODS: 1.6.0.beta.2 19 | -------------------------------------------------------------------------------- /appios/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - SDWebImage (4.1.2): 3 | - SDWebImage/Core (= 4.1.2) 4 | - SDWebImage/Core (4.1.2) 5 | 6 | DEPENDENCIES: 7 | - SDWebImage (~> 4.1.0) 8 | 9 | SPEC REPOS: 10 | https://github.com/cocoapods/specs.git: 11 | - SDWebImage 12 | 13 | SPEC CHECKSUMS: 14 | SDWebImage: cb6f9f266a9977741efcbc21e618e8be3734c774 15 | 16 | PODFILE CHECKSUM: 4ebf2051bce7e97bb83a4459902868cafb888105 17 | 18 | COCOAPODS: 1.6.0.beta.2 19 | -------------------------------------------------------------------------------- /appios/Pods/SDWebImage/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009-2017 Olivier Poitrey rs@dailymotion.com 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | 21 | -------------------------------------------------------------------------------- /appios/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Fabrice Aneche 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import 11 | #import "SDWebImageCompat.h" 12 | 13 | typedef NS_ENUM(NSInteger, SDImageFormat) { 14 | SDImageFormatUndefined = -1, 15 | SDImageFormatJPEG = 0, 16 | SDImageFormatPNG, 17 | SDImageFormatGIF, 18 | SDImageFormatTIFF, 19 | SDImageFormatWebP 20 | }; 21 | 22 | @interface NSData (ImageContentType) 23 | 24 | /** 25 | * Return image format 26 | * 27 | * @param data the input image data 28 | * 29 | * @return the image format as `SDImageFormat` (enum) 30 | */ 31 | + (SDImageFormat)sd_imageFormatForImageData:(nullable NSData *)data; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /appios/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Fabrice Aneche 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import "NSData+ImageContentType.h" 11 | 12 | 13 | @implementation NSData (ImageContentType) 14 | 15 | + (SDImageFormat)sd_imageFormatForImageData:(nullable NSData *)data { 16 | if (!data) { 17 | return SDImageFormatUndefined; 18 | } 19 | 20 | uint8_t c; 21 | [data getBytes:&c length:1]; 22 | switch (c) { 23 | case 0xFF: 24 | return SDImageFormatJPEG; 25 | case 0x89: 26 | return SDImageFormatPNG; 27 | case 0x47: 28 | return SDImageFormatGIF; 29 | case 0x49: 30 | case 0x4D: 31 | return SDImageFormatTIFF; 32 | case 0x52: 33 | // R as RIFF for WEBP 34 | if (data.length < 12) { 35 | return SDImageFormatUndefined; 36 | } 37 | 38 | NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(0, 12)] encoding:NSASCIIStringEncoding]; 39 | if ([testString hasPrefix:@"RIFF"] && [testString hasSuffix:@"WEBP"]) { 40 | return SDImageFormatWebP; 41 | } 42 | } 43 | return SDImageFormatUndefined; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /appios/Pods/SDWebImage/SDWebImage/NSImage+WebCache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if SD_MAC 12 | 13 | #import 14 | 15 | @interface NSImage (WebCache) 16 | 17 | - (CGImageRef)CGImage; 18 | - (NSArray *)images; 19 | - (BOOL)isGIF; 20 | 21 | @end 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /appios/Pods/SDWebImage/SDWebImage/NSImage+WebCache.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "NSImage+WebCache.h" 10 | 11 | #if SD_MAC 12 | 13 | @implementation NSImage (WebCache) 14 | 15 | - (CGImageRef)CGImage { 16 | NSRect imageRect = NSMakeRect(0, 0, self.size.width, self.size.height); 17 | CGImageRef cgImage = [self CGImageForProposedRect:&imageRect context:NULL hints:nil]; 18 | return cgImage; 19 | } 20 | 21 | - (NSArray *)images { 22 | return nil; 23 | } 24 | 25 | - (BOOL)isGIF { 26 | return NO; 27 | } 28 | 29 | @end 30 | 31 | #endif 32 | 33 | -------------------------------------------------------------------------------- /appios/Pods/SDWebImage/SDWebImage/SDImageCacheConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | @interface SDImageCacheConfig : NSObject 13 | 14 | /** 15 | * Decompressing images that are downloaded and cached can improve performance but can consume lot of memory. 16 | * Defaults to YES. Set this to NO if you are experiencing a crash due to excessive memory consumption. 17 | */ 18 | @property (assign, nonatomic) BOOL shouldDecompressImages; 19 | 20 | /** 21 | * disable iCloud backup [defaults to YES] 22 | */ 23 | @property (assign, nonatomic) BOOL shouldDisableiCloud; 24 | 25 | /** 26 | * use memory cache [defaults to YES] 27 | */ 28 | @property (assign, nonatomic) BOOL shouldCacheImagesInMemory; 29 | 30 | /** 31 | * The maximum length of time to keep an image in the cache, in seconds 32 | */ 33 | @property (assign, nonatomic) NSInteger maxCacheAge; 34 | 35 | /** 36 | * The maximum size of the cache, in bytes. 37 | */ 38 | @property (assign, nonatomic) NSUInteger maxCacheSize; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /appios/Pods/SDWebImage/SDWebImage/SDImageCacheConfig.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDImageCacheConfig.h" 10 | 11 | static const NSInteger kDefaultCacheMaxCacheAge = 60 * 60 * 24 * 7; // 1 week 12 | 13 | @implementation SDImageCacheConfig 14 | 15 | - (instancetype)init { 16 | if (self = [super init]) { 17 | _shouldDecompressImages = YES; 18 | _shouldDisableiCloud = YES; 19 | _shouldCacheImagesInMemory = YES; 20 | _maxCacheAge = kDefaultCacheMaxCacheAge; 21 | _maxCacheSize = 0; 22 | } 23 | return self; 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /appios/Pods/SDWebImage/SDWebImage/SDWebImageCompat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Jamie Pinkham 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import 11 | 12 | #ifdef __OBJC_GC__ 13 | #error SDWebImage does not support Objective-C Garbage Collection 14 | #endif 15 | 16 | // Apple's defines from TargetConditionals.h are a bit weird. 17 | // Seems like TARGET_OS_MAC is always defined (on all platforms). 18 | // To determine if we are running on OSX, we can only rely on TARGET_OS_IPHONE=0 and all the other platforms 19 | #if !TARGET_OS_IPHONE && !TARGET_OS_IOS && !TARGET_OS_TV && !TARGET_OS_WATCH 20 | #define SD_MAC 1 21 | #else 22 | #define SD_MAC 0 23 | #endif 24 | 25 | // iOS and tvOS are very similar, UIKit exists on both platforms 26 | // Note: watchOS also has UIKit, but it's very limited 27 | #if TARGET_OS_IOS || TARGET_OS_TV 28 | #define SD_UIKIT 1 29 | #else 30 | #define SD_UIKIT 0 31 | #endif 32 | 33 | #if TARGET_OS_IOS 34 | #define SD_IOS 1 35 | #else 36 | #define SD_IOS 0 37 | #endif 38 | 39 | #if TARGET_OS_TV 40 | #define SD_TV 1 41 | #else 42 | #define SD_TV 0 43 | #endif 44 | 45 | #if TARGET_OS_WATCH 46 | #define SD_WATCH 1 47 | #else 48 | #define SD_WATCH 0 49 | #endif 50 | 51 | 52 | #if SD_MAC 53 | #import 54 | #ifndef UIImage 55 | #define UIImage NSImage 56 | #endif 57 | #ifndef UIImageView 58 | #define UIImageView NSImageView 59 | #endif 60 | #ifndef UIView 61 | #define UIView NSView 62 | #endif 63 | #else 64 | #if __IPHONE_OS_VERSION_MIN_REQUIRED != 20000 && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_5_0 65 | #error SDWebImage doesn't support Deployment Target version < 5.0 66 | #endif 67 | 68 | #if SD_UIKIT 69 | #import 70 | #endif 71 | #if SD_WATCH 72 | #import 73 | #endif 74 | #endif 75 | 76 | #ifndef NS_ENUM 77 | #define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type 78 | #endif 79 | 80 | #ifndef NS_OPTIONS 81 | #define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type 82 | #endif 83 | 84 | #if OS_OBJECT_USE_OBJC 85 | #undef SDDispatchQueueRelease 86 | #undef SDDispatchQueueSetterSementics 87 | #define SDDispatchQueueRelease(q) 88 | #define SDDispatchQueueSetterSementics strong 89 | #else 90 | #undef SDDispatchQueueRelease 91 | #undef SDDispatchQueueSetterSementics 92 | #define SDDispatchQueueRelease(q) (dispatch_release(q)) 93 | #define SDDispatchQueueSetterSementics assign 94 | #endif 95 | 96 | FOUNDATION_EXPORT UIImage *SDScaledImageForKey(NSString *key, UIImage *image); 97 | 98 | typedef void(^SDWebImageNoParamsBlock)(void); 99 | 100 | FOUNDATION_EXPORT NSString *const SDWebImageErrorDomain; 101 | 102 | #ifndef dispatch_main_async_safe 103 | #define dispatch_main_async_safe(block)\ 104 | if (strcmp(dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL), dispatch_queue_get_label(dispatch_get_main_queue())) == 0) {\ 105 | block();\ 106 | } else {\ 107 | dispatch_async(dispatch_get_main_queue(), block);\ 108 | } 109 | #endif 110 | -------------------------------------------------------------------------------- /appios/Pods/SDWebImage/SDWebImage/SDWebImageCompat.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #import "objc/runtime.h" 12 | 13 | #if !__has_feature(objc_arc) 14 | #error SDWebImage is ARC only. Either turn on ARC for the project or use -fobjc-arc flag 15 | #endif 16 | 17 | inline UIImage *SDScaledImageForKey(NSString * _Nullable key, UIImage * _Nullable image) { 18 | if (!image) { 19 | return nil; 20 | } 21 | 22 | #if SD_MAC 23 | return image; 24 | #elif SD_UIKIT || SD_WATCH 25 | if ((image.images).count > 0) { 26 | NSMutableArray *scaledImages = [NSMutableArray array]; 27 | 28 | for (UIImage *tempImage in image.images) { 29 | [scaledImages addObject:SDScaledImageForKey(key, tempImage)]; 30 | } 31 | 32 | UIImage *animatedImage = [UIImage animatedImageWithImages:scaledImages duration:image.duration]; 33 | #ifdef SD_WEBP 34 | if (animatedImage) { 35 | SEL sd_webpLoopCount = NSSelectorFromString(@"sd_webpLoopCount"); 36 | NSNumber *value = objc_getAssociatedObject(image, sd_webpLoopCount); 37 | NSInteger loopCount = value.integerValue; 38 | if (loopCount) { 39 | objc_setAssociatedObject(animatedImage, sd_webpLoopCount, @(loopCount), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 40 | } 41 | } 42 | #endif 43 | return animatedImage; 44 | } else { 45 | #if SD_WATCH 46 | if ([[WKInterfaceDevice currentDevice] respondsToSelector:@selector(screenScale)]) { 47 | #elif SD_UIKIT 48 | if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) { 49 | #endif 50 | CGFloat scale = 1; 51 | if (key.length >= 8) { 52 | NSRange range = [key rangeOfString:@"@2x."]; 53 | if (range.location != NSNotFound) { 54 | scale = 2.0; 55 | } 56 | 57 | range = [key rangeOfString:@"@3x."]; 58 | if (range.location != NSNotFound) { 59 | scale = 3.0; 60 | } 61 | } 62 | 63 | UIImage *scaledImage = [[UIImage alloc] initWithCGImage:image.CGImage scale:scale orientation:image.imageOrientation]; 64 | image = scaledImage; 65 | } 66 | return image; 67 | } 68 | #endif 69 | } 70 | 71 | NSString *const SDWebImageErrorDomain = @"SDWebImageErrorDomain"; 72 | -------------------------------------------------------------------------------- /appios/Pods/SDWebImage/SDWebImage/SDWebImageDecoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) james 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import 11 | #import "SDWebImageCompat.h" 12 | 13 | @interface UIImage (ForceDecode) 14 | 15 | + (nullable UIImage *)decodedImageWithImage:(nullable UIImage *)image; 16 | 17 | + (nullable UIImage *)decodedAndScaledDownImageWithImage:(nullable UIImage *)image; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /appios/Pods/SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageDownloader.h" 11 | #import "SDWebImageOperation.h" 12 | 13 | FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageDownloadStartNotification; 14 | FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageDownloadReceiveResponseNotification; 15 | FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageDownloadStopNotification; 16 | FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageDownloadFinishNotification; 17 | 18 | 19 | 20 | /** 21 | Describes a downloader operation. If one wants to use a custom downloader op, it needs to inherit from `NSOperation` and conform to this protocol 22 | */ 23 | @protocol SDWebImageDownloaderOperationInterface 24 | 25 | - (nonnull instancetype)initWithRequest:(nullable NSURLRequest *)request 26 | inSession:(nullable NSURLSession *)session 27 | options:(SDWebImageDownloaderOptions)options; 28 | 29 | - (nullable id)addHandlersForProgress:(nullable SDWebImageDownloaderProgressBlock)progressBlock 30 | completed:(nullable SDWebImageDownloaderCompletedBlock)completedBlock; 31 | 32 | - (BOOL)shouldDecompressImages; 33 | - (void)setShouldDecompressImages:(BOOL)value; 34 | 35 | - (nullable NSURLCredential *)credential; 36 | - (void)setCredential:(nullable NSURLCredential *)value; 37 | 38 | @end 39 | 40 | 41 | @interface SDWebImageDownloaderOperation : NSOperation 42 | 43 | /** 44 | * The request used by the operation's task. 45 | */ 46 | @property (strong, nonatomic, readonly, nullable) NSURLRequest *request; 47 | 48 | /** 49 | * The operation's task 50 | */ 51 | @property (strong, nonatomic, readonly, nullable) NSURLSessionTask *dataTask; 52 | 53 | 54 | @property (assign, nonatomic) BOOL shouldDecompressImages; 55 | 56 | /** 57 | * Was used to determine whether the URL connection should consult the credential storage for authenticating the connection. 58 | * @deprecated Not used for a couple of versions 59 | */ 60 | @property (nonatomic, assign) BOOL shouldUseCredentialStorage __deprecated_msg("Property deprecated. Does nothing. Kept only for backwards compatibility"); 61 | 62 | /** 63 | * The credential used for authentication challenges in `-connection:didReceiveAuthenticationChallenge:`. 64 | * 65 | * This will be overridden by any shared credentials that exist for the username or password of the request URL, if present. 66 | */ 67 | @property (nonatomic, strong, nullable) NSURLCredential *credential; 68 | 69 | /** 70 | * The SDWebImageDownloaderOptions for the receiver. 71 | */ 72 | @property (assign, nonatomic, readonly) SDWebImageDownloaderOptions options; 73 | 74 | /** 75 | * The expected size of data. 76 | */ 77 | @property (assign, nonatomic) NSInteger expectedSize; 78 | 79 | /** 80 | * The response returned by the operation's connection. 81 | */ 82 | @property (strong, nonatomic, nullable) NSURLResponse *response; 83 | 84 | /** 85 | * Initializes a `SDWebImageDownloaderOperation` object 86 | * 87 | * @see SDWebImageDownloaderOperation 88 | * 89 | * @param request the URL request 90 | * @param session the URL session in which this operation will run 91 | * @param options downloader options 92 | * 93 | * @return the initialized instance 94 | */ 95 | - (nonnull instancetype)initWithRequest:(nullable NSURLRequest *)request 96 | inSession:(nullable NSURLSession *)session 97 | options:(SDWebImageDownloaderOptions)options NS_DESIGNATED_INITIALIZER; 98 | 99 | /** 100 | * Adds handlers for progress and completion. Returns a tokent that can be passed to -cancel: to cancel this set of 101 | * callbacks. 102 | * 103 | * @param progressBlock the block executed when a new chunk of data arrives. 104 | * @note the progress block is executed on a background queue 105 | * @param completedBlock the block executed when the download is done. 106 | * @note the completed block is executed on the main queue for success. If errors are found, there is a chance the block will be executed on a background queue 107 | * 108 | * @return the token to use to cancel this set of handlers 109 | */ 110 | - (nullable id)addHandlersForProgress:(nullable SDWebImageDownloaderProgressBlock)progressBlock 111 | completed:(nullable SDWebImageDownloaderCompletedBlock)completedBlock; 112 | 113 | /** 114 | * Cancels a set of callbacks. Once all callbacks are canceled, the operation is cancelled. 115 | * 116 | * @param token the token representing a set of callbacks to cancel 117 | * 118 | * @return YES if the operation was stopped because this was the last token to be canceled. NO otherwise. 119 | */ 120 | - (BOOL)cancel:(nullable id)token; 121 | 122 | @end 123 | -------------------------------------------------------------------------------- /appios/Pods/SDWebImage/SDWebImage/SDWebImageOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | 11 | @protocol SDWebImageOperation 12 | 13 | - (void)cancel; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /appios/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageManager.h" 11 | 12 | @class SDWebImagePrefetcher; 13 | 14 | @protocol SDWebImagePrefetcherDelegate 15 | 16 | @optional 17 | 18 | /** 19 | * Called when an image was prefetched. 20 | * 21 | * @param imagePrefetcher The current image prefetcher 22 | * @param imageURL The image url that was prefetched 23 | * @param finishedCount The total number of images that were prefetched (successful or not) 24 | * @param totalCount The total number of images that were to be prefetched 25 | */ 26 | - (void)imagePrefetcher:(nonnull SDWebImagePrefetcher *)imagePrefetcher didPrefetchURL:(nullable NSURL *)imageURL finishedCount:(NSUInteger)finishedCount totalCount:(NSUInteger)totalCount; 27 | 28 | /** 29 | * Called when all images are prefetched. 30 | * @param imagePrefetcher The current image prefetcher 31 | * @param totalCount The total number of images that were prefetched (whether successful or not) 32 | * @param skippedCount The total number of images that were skipped 33 | */ 34 | - (void)imagePrefetcher:(nonnull SDWebImagePrefetcher *)imagePrefetcher didFinishWithTotalCount:(NSUInteger)totalCount skippedCount:(NSUInteger)skippedCount; 35 | 36 | @end 37 | 38 | typedef void(^SDWebImagePrefetcherProgressBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfTotalUrls); 39 | typedef void(^SDWebImagePrefetcherCompletionBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfSkippedUrls); 40 | 41 | /** 42 | * Prefetch some URLs in the cache for future use. Images are downloaded in low priority. 43 | */ 44 | @interface SDWebImagePrefetcher : NSObject 45 | 46 | /** 47 | * The web image manager 48 | */ 49 | @property (strong, nonatomic, readonly, nonnull) SDWebImageManager *manager; 50 | 51 | /** 52 | * Maximum number of URLs to prefetch at the same time. Defaults to 3. 53 | */ 54 | @property (nonatomic, assign) NSUInteger maxConcurrentDownloads; 55 | 56 | /** 57 | * SDWebImageOptions for prefetcher. Defaults to SDWebImageLowPriority. 58 | */ 59 | @property (nonatomic, assign) SDWebImageOptions options; 60 | 61 | /** 62 | * Queue options for Prefetcher. Defaults to Main Queue. 63 | */ 64 | @property (SDDispatchQueueSetterSementics, nonatomic, nonnull) dispatch_queue_t prefetcherQueue; 65 | 66 | @property (weak, nonatomic, nullable) id delegate; 67 | 68 | /** 69 | * Return the global image prefetcher instance. 70 | */ 71 | + (nonnull instancetype)sharedImagePrefetcher; 72 | 73 | /** 74 | * Allows you to instantiate a prefetcher with any arbitrary image manager. 75 | */ 76 | - (nonnull instancetype)initWithImageManager:(nonnull SDWebImageManager *)manager NS_DESIGNATED_INITIALIZER; 77 | 78 | /** 79 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, 80 | * currently one image is downloaded at a time, 81 | * and skips images for failed downloads and proceed to the next image in the list. 82 | * Any previously-running prefetch operations are canceled. 83 | * 84 | * @param urls list of URLs to prefetch 85 | */ 86 | - (void)prefetchURLs:(nullable NSArray *)urls; 87 | 88 | /** 89 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, 90 | * currently one image is downloaded at a time, 91 | * and skips images for failed downloads and proceed to the next image in the list. 92 | * Any previously-running prefetch operations are canceled. 93 | * 94 | * @param urls list of URLs to prefetch 95 | * @param progressBlock block to be called when progress updates; 96 | * first parameter is the number of completed (successful or not) requests, 97 | * second parameter is the total number of images originally requested to be prefetched 98 | * @param completionBlock block to be called when prefetching is completed 99 | * first param is the number of completed (successful or not) requests, 100 | * second parameter is the number of skipped requests 101 | */ 102 | - (void)prefetchURLs:(nullable NSArray *)urls 103 | progress:(nullable SDWebImagePrefetcherProgressBlock)progressBlock 104 | completed:(nullable SDWebImagePrefetcherCompletionBlock)completionBlock; 105 | 106 | /** 107 | * Remove and cancel queued list 108 | */ 109 | - (void)cancelPrefetching; 110 | 111 | 112 | @end 113 | -------------------------------------------------------------------------------- /appios/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImagePrefetcher.h" 10 | 11 | @interface SDWebImagePrefetcher () 12 | 13 | @property (strong, nonatomic, nonnull) SDWebImageManager *manager; 14 | @property (strong, nonatomic, nullable) NSArray *prefetchURLs; 15 | @property (assign, nonatomic) NSUInteger requestedCount; 16 | @property (assign, nonatomic) NSUInteger skippedCount; 17 | @property (assign, nonatomic) NSUInteger finishedCount; 18 | @property (assign, nonatomic) NSTimeInterval startedTime; 19 | @property (copy, nonatomic, nullable) SDWebImagePrefetcherCompletionBlock completionBlock; 20 | @property (copy, nonatomic, nullable) SDWebImagePrefetcherProgressBlock progressBlock; 21 | 22 | @end 23 | 24 | @implementation SDWebImagePrefetcher 25 | 26 | + (nonnull instancetype)sharedImagePrefetcher { 27 | static dispatch_once_t once; 28 | static id instance; 29 | dispatch_once(&once, ^{ 30 | instance = [self new]; 31 | }); 32 | return instance; 33 | } 34 | 35 | - (nonnull instancetype)init { 36 | return [self initWithImageManager:[SDWebImageManager new]]; 37 | } 38 | 39 | - (nonnull instancetype)initWithImageManager:(SDWebImageManager *)manager { 40 | if ((self = [super init])) { 41 | _manager = manager; 42 | _options = SDWebImageLowPriority; 43 | _prefetcherQueue = dispatch_get_main_queue(); 44 | self.maxConcurrentDownloads = 3; 45 | } 46 | return self; 47 | } 48 | 49 | - (void)setMaxConcurrentDownloads:(NSUInteger)maxConcurrentDownloads { 50 | self.manager.imageDownloader.maxConcurrentDownloads = maxConcurrentDownloads; 51 | } 52 | 53 | - (NSUInteger)maxConcurrentDownloads { 54 | return self.manager.imageDownloader.maxConcurrentDownloads; 55 | } 56 | 57 | - (void)startPrefetchingAtIndex:(NSUInteger)index { 58 | if (index >= self.prefetchURLs.count) return; 59 | self.requestedCount++; 60 | [self.manager loadImageWithURL:self.prefetchURLs[index] options:self.options progress:nil completed:^(UIImage *image, NSData *data, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { 61 | if (!finished) return; 62 | self.finishedCount++; 63 | 64 | if (image) { 65 | if (self.progressBlock) { 66 | self.progressBlock(self.finishedCount,(self.prefetchURLs).count); 67 | } 68 | } 69 | else { 70 | if (self.progressBlock) { 71 | self.progressBlock(self.finishedCount,(self.prefetchURLs).count); 72 | } 73 | // Add last failed 74 | self.skippedCount++; 75 | } 76 | if ([self.delegate respondsToSelector:@selector(imagePrefetcher:didPrefetchURL:finishedCount:totalCount:)]) { 77 | [self.delegate imagePrefetcher:self 78 | didPrefetchURL:self.prefetchURLs[index] 79 | finishedCount:self.finishedCount 80 | totalCount:self.prefetchURLs.count 81 | ]; 82 | } 83 | if (self.prefetchURLs.count > self.requestedCount) { 84 | dispatch_async(self.prefetcherQueue, ^{ 85 | [self startPrefetchingAtIndex:self.requestedCount]; 86 | }); 87 | } else if (self.finishedCount == self.requestedCount) { 88 | [self reportStatus]; 89 | if (self.completionBlock) { 90 | self.completionBlock(self.finishedCount, self.skippedCount); 91 | self.completionBlock = nil; 92 | } 93 | self.progressBlock = nil; 94 | } 95 | }]; 96 | } 97 | 98 | - (void)reportStatus { 99 | NSUInteger total = (self.prefetchURLs).count; 100 | if ([self.delegate respondsToSelector:@selector(imagePrefetcher:didFinishWithTotalCount:skippedCount:)]) { 101 | [self.delegate imagePrefetcher:self 102 | didFinishWithTotalCount:(total - self.skippedCount) 103 | skippedCount:self.skippedCount 104 | ]; 105 | } 106 | } 107 | 108 | - (void)prefetchURLs:(nullable NSArray *)urls { 109 | [self prefetchURLs:urls progress:nil completed:nil]; 110 | } 111 | 112 | - (void)prefetchURLs:(nullable NSArray *)urls 113 | progress:(nullable SDWebImagePrefetcherProgressBlock)progressBlock 114 | completed:(nullable SDWebImagePrefetcherCompletionBlock)completionBlock { 115 | [self cancelPrefetching]; // Prevent duplicate prefetch request 116 | self.startedTime = CFAbsoluteTimeGetCurrent(); 117 | self.prefetchURLs = urls; 118 | self.completionBlock = completionBlock; 119 | self.progressBlock = progressBlock; 120 | 121 | if (urls.count == 0) { 122 | if (completionBlock) { 123 | completionBlock(0,0); 124 | } 125 | } else { 126 | // Starts prefetching from the very first image on the list with the max allowed concurrency 127 | NSUInteger listCount = self.prefetchURLs.count; 128 | for (NSUInteger i = 0; i < self.maxConcurrentDownloads && self.requestedCount < listCount; i++) { 129 | [self startPrefetchingAtIndex:i]; 130 | } 131 | } 132 | } 133 | 134 | - (void)cancelPrefetching { 135 | self.prefetchURLs = nil; 136 | self.skippedCount = 0; 137 | self.requestedCount = 0; 138 | self.finishedCount = 0; 139 | [self.manager cancelAll]; 140 | } 141 | 142 | @end 143 | -------------------------------------------------------------------------------- /appios/Pods/SDWebImage/SDWebImage/UIButton+WebCache.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIButton+WebCache.h" 10 | 11 | #if SD_UIKIT 12 | 13 | #import "objc/runtime.h" 14 | #import "UIView+WebCacheOperation.h" 15 | #import "UIView+WebCache.h" 16 | 17 | static char imageURLStorageKey; 18 | 19 | typedef NSMutableDictionary SDStateImageURLDictionary; 20 | 21 | static inline NSString * imageURLKeyForState(UIControlState state) { 22 | return [NSString stringWithFormat:@"image_%lu", (unsigned long)state]; 23 | } 24 | 25 | static inline NSString * backgroundImageURLKeyForState(UIControlState state) { 26 | return [NSString stringWithFormat:@"backgroundImage_%lu", (unsigned long)state]; 27 | } 28 | 29 | @implementation UIButton (WebCache) 30 | 31 | #pragma mark - Image 32 | 33 | - (nullable NSURL *)sd_currentImageURL { 34 | NSURL *url = self.imageURLStorage[imageURLKeyForState(self.state)]; 35 | 36 | if (!url) { 37 | url = self.imageURLStorage[imageURLKeyForState(UIControlStateNormal)]; 38 | } 39 | 40 | return url; 41 | } 42 | 43 | - (nullable NSURL *)sd_imageURLForState:(UIControlState)state { 44 | return self.imageURLStorage[imageURLKeyForState(state)]; 45 | } 46 | 47 | - (void)sd_setImageWithURL:(nullable NSURL *)url forState:(UIControlState)state { 48 | [self sd_setImageWithURL:url forState:state placeholderImage:nil options:0 completed:nil]; 49 | } 50 | 51 | - (void)sd_setImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder { 52 | [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:nil]; 53 | } 54 | 55 | - (void)sd_setImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options { 56 | [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:options completed:nil]; 57 | } 58 | 59 | - (void)sd_setImageWithURL:(nullable NSURL *)url forState:(UIControlState)state completed:(nullable SDExternalCompletionBlock)completedBlock { 60 | [self sd_setImageWithURL:url forState:state placeholderImage:nil options:0 completed:completedBlock]; 61 | } 62 | 63 | - (void)sd_setImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder completed:(nullable SDExternalCompletionBlock)completedBlock { 64 | [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:completedBlock]; 65 | } 66 | 67 | - (void)sd_setImageWithURL:(nullable NSURL *)url 68 | forState:(UIControlState)state 69 | placeholderImage:(nullable UIImage *)placeholder 70 | options:(SDWebImageOptions)options 71 | completed:(nullable SDExternalCompletionBlock)completedBlock { 72 | if (!url) { 73 | [self.imageURLStorage removeObjectForKey:imageURLKeyForState(state)]; 74 | } else { 75 | self.imageURLStorage[imageURLKeyForState(state)] = url; 76 | } 77 | 78 | __weak typeof(self)weakSelf = self; 79 | [self sd_internalSetImageWithURL:url 80 | placeholderImage:placeholder 81 | options:options 82 | operationKey:[NSString stringWithFormat:@"UIButtonImageOperation%@", @(state)] 83 | setImageBlock:^(UIImage *image, NSData *imageData) { 84 | [weakSelf setImage:image forState:state]; 85 | } 86 | progress:nil 87 | completed:completedBlock]; 88 | } 89 | 90 | #pragma mark - Background image 91 | 92 | - (nullable NSURL *)sd_currentBackgroundImageURL { 93 | NSURL *url = self.imageURLStorage[backgroundImageURLKeyForState(self.state)]; 94 | 95 | if (!url) { 96 | url = self.imageURLStorage[backgroundImageURLKeyForState(UIControlStateNormal)]; 97 | } 98 | 99 | return url; 100 | } 101 | 102 | - (nullable NSURL *)sd_backgroundImageURLForState:(UIControlState)state { 103 | return self.imageURLStorage[backgroundImageURLKeyForState(state)]; 104 | } 105 | 106 | - (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url forState:(UIControlState)state { 107 | [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:nil options:0 completed:nil]; 108 | } 109 | 110 | - (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder { 111 | [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:nil]; 112 | } 113 | 114 | - (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options { 115 | [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:options completed:nil]; 116 | } 117 | 118 | - (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url forState:(UIControlState)state completed:(nullable SDExternalCompletionBlock)completedBlock { 119 | [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:nil options:0 completed:completedBlock]; 120 | } 121 | 122 | - (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder completed:(nullable SDExternalCompletionBlock)completedBlock { 123 | [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:completedBlock]; 124 | } 125 | 126 | - (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url 127 | forState:(UIControlState)state 128 | placeholderImage:(nullable UIImage *)placeholder 129 | options:(SDWebImageOptions)options 130 | completed:(nullable SDExternalCompletionBlock)completedBlock { 131 | if (!url) { 132 | [self.imageURLStorage removeObjectForKey:backgroundImageURLKeyForState(state)]; 133 | } else { 134 | self.imageURLStorage[backgroundImageURLKeyForState(state)] = url; 135 | } 136 | 137 | __weak typeof(self)weakSelf = self; 138 | [self sd_internalSetImageWithURL:url 139 | placeholderImage:placeholder 140 | options:options 141 | operationKey:[NSString stringWithFormat:@"UIButtonBackgroundImageOperation%@", @(state)] 142 | setImageBlock:^(UIImage *image, NSData *imageData) { 143 | [weakSelf setBackgroundImage:image forState:state]; 144 | } 145 | progress:nil 146 | completed:completedBlock]; 147 | } 148 | 149 | - (void)sd_setImageLoadOperation:(id)operation forState:(UIControlState)state { 150 | [self sd_setImageLoadOperation:operation forKey:[NSString stringWithFormat:@"UIButtonImageOperation%@", @(state)]]; 151 | } 152 | 153 | - (void)sd_cancelImageLoadForState:(UIControlState)state { 154 | [self sd_cancelImageLoadOperationWithKey:[NSString stringWithFormat:@"UIButtonImageOperation%@", @(state)]]; 155 | } 156 | 157 | - (void)sd_setBackgroundImageLoadOperation:(id)operation forState:(UIControlState)state { 158 | [self sd_setImageLoadOperation:operation forKey:[NSString stringWithFormat:@"UIButtonBackgroundImageOperation%@", @(state)]]; 159 | } 160 | 161 | - (void)sd_cancelBackgroundImageLoadForState:(UIControlState)state { 162 | [self sd_cancelImageLoadOperationWithKey:[NSString stringWithFormat:@"UIButtonBackgroundImageOperation%@", @(state)]]; 163 | } 164 | 165 | - (SDStateImageURLDictionary *)imageURLStorage { 166 | SDStateImageURLDictionary *storage = objc_getAssociatedObject(self, &imageURLStorageKey); 167 | if (!storage) { 168 | storage = [NSMutableDictionary dictionary]; 169 | objc_setAssociatedObject(self, &imageURLStorageKey, storage, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 170 | } 171 | 172 | return storage; 173 | } 174 | 175 | @end 176 | 177 | #endif 178 | -------------------------------------------------------------------------------- /appios/Pods/SDWebImage/SDWebImage/UIImage+GIF.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Laurin Brandner 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import "SDWebImageCompat.h" 11 | 12 | @interface UIImage (GIF) 13 | 14 | /** 15 | * Compatibility method - creates an animated UIImage from an NSData, it will only contain the 1st frame image 16 | */ 17 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data; 18 | 19 | /** 20 | * Checks if an UIImage instance is a GIF. Will use the `images` array 21 | */ 22 | - (BOOL)isGIF; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /appios/Pods/SDWebImage/SDWebImage/UIImage+GIF.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Laurin Brandner 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import "UIImage+GIF.h" 11 | #import 12 | #import "objc/runtime.h" 13 | #import "NSImage+WebCache.h" 14 | 15 | @implementation UIImage (GIF) 16 | 17 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data { 18 | if (!data) { 19 | return nil; 20 | } 21 | 22 | #if SD_MAC 23 | return [[UIImage alloc] initWithData:data]; 24 | #else 25 | 26 | CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)data, NULL); 27 | 28 | size_t count = CGImageSourceGetCount(source); 29 | 30 | UIImage *staticImage; 31 | 32 | if (count <= 1) { 33 | staticImage = [[UIImage alloc] initWithData:data]; 34 | } else { 35 | // we will only retrieve the 1st frame. the full GIF support is available via the FLAnimatedImageView category. 36 | // this here is only code to allow drawing animated images as static ones 37 | #if SD_WATCH 38 | CGFloat scale = 1; 39 | scale = [WKInterfaceDevice currentDevice].screenScale; 40 | #elif SD_UIKIT 41 | CGFloat scale = 1; 42 | scale = [UIScreen mainScreen].scale; 43 | #endif 44 | 45 | CGImageRef CGImage = CGImageSourceCreateImageAtIndex(source, 0, NULL); 46 | #if SD_UIKIT || SD_WATCH 47 | UIImage *frameImage = [UIImage imageWithCGImage:CGImage scale:scale orientation:UIImageOrientationUp]; 48 | staticImage = [UIImage animatedImageWithImages:@[frameImage] duration:0.0f]; 49 | #endif 50 | CGImageRelease(CGImage); 51 | } 52 | 53 | CFRelease(source); 54 | 55 | return staticImage; 56 | #endif 57 | } 58 | 59 | - (BOOL)isGIF { 60 | return (self.images != nil); 61 | } 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /appios/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | #import "NSData+ImageContentType.h" 11 | 12 | @interface UIImage (MultiFormat) 13 | 14 | + (nullable UIImage *)sd_imageWithData:(nullable NSData *)data; 15 | - (nullable NSData *)sd_imageData; 16 | - (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /appios/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIImage+MultiFormat.h" 10 | #import "UIImage+GIF.h" 11 | #import "NSData+ImageContentType.h" 12 | #import 13 | 14 | #ifdef SD_WEBP 15 | #import "UIImage+WebP.h" 16 | #endif 17 | 18 | @implementation UIImage (MultiFormat) 19 | 20 | + (nullable UIImage *)sd_imageWithData:(nullable NSData *)data { 21 | if (!data) { 22 | return nil; 23 | } 24 | 25 | UIImage *image; 26 | SDImageFormat imageFormat = [NSData sd_imageFormatForImageData:data]; 27 | if (imageFormat == SDImageFormatGIF) { 28 | image = [UIImage sd_animatedGIFWithData:data]; 29 | } 30 | #ifdef SD_WEBP 31 | else if (imageFormat == SDImageFormatWebP) 32 | { 33 | image = [UIImage sd_imageWithWebPData:data]; 34 | } 35 | #endif 36 | else { 37 | image = [[UIImage alloc] initWithData:data]; 38 | #if SD_UIKIT || SD_WATCH 39 | UIImageOrientation orientation = [self sd_imageOrientationFromImageData:data]; 40 | if (orientation != UIImageOrientationUp) { 41 | image = [UIImage imageWithCGImage:image.CGImage 42 | scale:image.scale 43 | orientation:orientation]; 44 | } 45 | #endif 46 | } 47 | 48 | 49 | return image; 50 | } 51 | 52 | #if SD_UIKIT || SD_WATCH 53 | +(UIImageOrientation)sd_imageOrientationFromImageData:(nonnull NSData *)imageData { 54 | UIImageOrientation result = UIImageOrientationUp; 55 | CGImageSourceRef imageSource = CGImageSourceCreateWithData((__bridge CFDataRef)imageData, NULL); 56 | if (imageSource) { 57 | CFDictionaryRef properties = CGImageSourceCopyPropertiesAtIndex(imageSource, 0, NULL); 58 | if (properties) { 59 | CFTypeRef val; 60 | int exifOrientation; 61 | val = CFDictionaryGetValue(properties, kCGImagePropertyOrientation); 62 | if (val) { 63 | CFNumberGetValue(val, kCFNumberIntType, &exifOrientation); 64 | result = [self sd_exifOrientationToiOSOrientation:exifOrientation]; 65 | } // else - if it's not set it remains at up 66 | CFRelease((CFTypeRef) properties); 67 | } else { 68 | //NSLog(@"NO PROPERTIES, FAIL"); 69 | } 70 | CFRelease(imageSource); 71 | } 72 | return result; 73 | } 74 | 75 | #pragma mark EXIF orientation tag converter 76 | // Convert an EXIF image orientation to an iOS one. 77 | // reference see here: http://sylvana.net/jpegcrop/exif_orientation.html 78 | + (UIImageOrientation) sd_exifOrientationToiOSOrientation:(int)exifOrientation { 79 | UIImageOrientation orientation = UIImageOrientationUp; 80 | switch (exifOrientation) { 81 | case 1: 82 | orientation = UIImageOrientationUp; 83 | break; 84 | 85 | case 3: 86 | orientation = UIImageOrientationDown; 87 | break; 88 | 89 | case 8: 90 | orientation = UIImageOrientationLeft; 91 | break; 92 | 93 | case 6: 94 | orientation = UIImageOrientationRight; 95 | break; 96 | 97 | case 2: 98 | orientation = UIImageOrientationUpMirrored; 99 | break; 100 | 101 | case 4: 102 | orientation = UIImageOrientationDownMirrored; 103 | break; 104 | 105 | case 5: 106 | orientation = UIImageOrientationLeftMirrored; 107 | break; 108 | 109 | case 7: 110 | orientation = UIImageOrientationRightMirrored; 111 | break; 112 | default: 113 | break; 114 | } 115 | return orientation; 116 | } 117 | #endif 118 | 119 | - (nullable NSData *)sd_imageData { 120 | return [self sd_imageDataAsFormat:SDImageFormatUndefined]; 121 | } 122 | 123 | - (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat { 124 | NSData *imageData = nil; 125 | if (self) { 126 | #if SD_UIKIT || SD_WATCH 127 | int alphaInfo = CGImageGetAlphaInfo(self.CGImage); 128 | BOOL hasAlpha = !(alphaInfo == kCGImageAlphaNone || 129 | alphaInfo == kCGImageAlphaNoneSkipFirst || 130 | alphaInfo == kCGImageAlphaNoneSkipLast); 131 | 132 | BOOL usePNG = hasAlpha; 133 | 134 | // the imageFormat param has priority here. But if the format is undefined, we relly on the alpha channel 135 | if (imageFormat != SDImageFormatUndefined) { 136 | usePNG = (imageFormat == SDImageFormatPNG); 137 | } 138 | 139 | if (usePNG) { 140 | imageData = UIImagePNGRepresentation(self); 141 | } else { 142 | imageData = UIImageJPEGRepresentation(self, (CGFloat)1.0); 143 | } 144 | #else 145 | NSBitmapImageFileType imageFileType = NSJPEGFileType; 146 | if (imageFormat == SDImageFormatGIF) { 147 | imageFileType = NSGIFFileType; 148 | } else if (imageFormat == SDImageFormatPNG) { 149 | imageFileType = NSPNGFileType; 150 | } 151 | 152 | imageData = [NSBitmapImageRep representationOfImageRepsInArray:self.representations 153 | usingType:imageFileType 154 | properties:@{}]; 155 | #endif 156 | } 157 | return imageData; 158 | } 159 | 160 | 161 | @end 162 | -------------------------------------------------------------------------------- /appios/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if SD_UIKIT 12 | 13 | #import "SDWebImageManager.h" 14 | 15 | /** 16 | * Integrates SDWebImage async downloading and caching of remote images with UIImageView for highlighted state. 17 | */ 18 | @interface UIImageView (HighlightedWebCache) 19 | 20 | /** 21 | * Set the imageView `highlightedImage` with an `url`. 22 | * 23 | * The download is asynchronous and cached. 24 | * 25 | * @param url The url for the image. 26 | */ 27 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url NS_REFINED_FOR_SWIFT; 28 | 29 | /** 30 | * Set the imageView `highlightedImage` with an `url` and custom options. 31 | * 32 | * The download is asynchronous and cached. 33 | * 34 | * @param url The url for the image. 35 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 36 | */ 37 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url 38 | options:(SDWebImageOptions)options NS_REFINED_FOR_SWIFT; 39 | 40 | /** 41 | * Set the imageView `highlightedImage` with an `url`. 42 | * 43 | * The download is asynchronous and cached. 44 | * 45 | * @param url The url for the image. 46 | * @param completedBlock A block called when operation has been completed. This block has no return value 47 | * and takes the requested UIImage as first parameter. In case of error the image parameter 48 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 49 | * indicating if the image was retrieved from the local cache or from the network. 50 | * The fourth parameter is the original image url. 51 | */ 52 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url 53 | completed:(nullable SDExternalCompletionBlock)completedBlock NS_REFINED_FOR_SWIFT; 54 | 55 | /** 56 | * Set the imageView `highlightedImage` with an `url` and custom options. 57 | * 58 | * The download is asynchronous and cached. 59 | * 60 | * @param url The url for the image. 61 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 62 | * @param completedBlock A block called when operation has been completed. This block has no return value 63 | * and takes the requested UIImage as first parameter. In case of error the image parameter 64 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 65 | * indicating if the image was retrieved from the local cache or from the network. 66 | * The fourth parameter is the original image url. 67 | */ 68 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url 69 | options:(SDWebImageOptions)options 70 | completed:(nullable SDExternalCompletionBlock)completedBlock; 71 | 72 | /** 73 | * Set the imageView `highlightedImage` with an `url` and custom options. 74 | * 75 | * The download is asynchronous and cached. 76 | * 77 | * @param url The url for the image. 78 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 79 | * @param progressBlock A block called while image is downloading 80 | * @note the progress block is executed on a background queue 81 | * @param completedBlock A block called when operation has been completed. This block has no return value 82 | * and takes the requested UIImage as first parameter. In case of error the image parameter 83 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 84 | * indicating if the image was retrieved from the local cache or from the network. 85 | * The fourth parameter is the original image url. 86 | */ 87 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url 88 | options:(SDWebImageOptions)options 89 | progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock 90 | completed:(nullable SDExternalCompletionBlock)completedBlock; 91 | 92 | @end 93 | 94 | #endif 95 | -------------------------------------------------------------------------------- /appios/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIImageView+HighlightedWebCache.h" 10 | 11 | #if SD_UIKIT 12 | 13 | #import "UIView+WebCacheOperation.h" 14 | #import "UIView+WebCache.h" 15 | 16 | @implementation UIImageView (HighlightedWebCache) 17 | 18 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url { 19 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:nil]; 20 | } 21 | 22 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url options:(SDWebImageOptions)options { 23 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:nil]; 24 | } 25 | 26 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url completed:(nullable SDExternalCompletionBlock)completedBlock { 27 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:completedBlock]; 28 | } 29 | 30 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url options:(SDWebImageOptions)options completed:(nullable SDExternalCompletionBlock)completedBlock { 31 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:completedBlock]; 32 | } 33 | 34 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url 35 | options:(SDWebImageOptions)options 36 | progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock 37 | completed:(nullable SDExternalCompletionBlock)completedBlock { 38 | __weak typeof(self)weakSelf = self; 39 | [self sd_internalSetImageWithURL:url 40 | placeholderImage:nil 41 | options:options 42 | operationKey:@"UIImageViewImageOperationHighlighted" 43 | setImageBlock:^(UIImage *image, NSData *imageData) { 44 | weakSelf.highlightedImage = image; 45 | } 46 | progress:progressBlock 47 | completed:completedBlock]; 48 | } 49 | 50 | @end 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /appios/Pods/SDWebImage/SDWebImage/UIImageView+WebCache.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIImageView+WebCache.h" 10 | 11 | #if SD_UIKIT || SD_MAC 12 | 13 | #import "objc/runtime.h" 14 | #import "UIView+WebCacheOperation.h" 15 | #import "UIView+WebCache.h" 16 | 17 | @implementation UIImageView (WebCache) 18 | 19 | - (void)sd_setImageWithURL:(nullable NSURL *)url { 20 | [self sd_setImageWithURL:url placeholderImage:nil options:0 progress:nil completed:nil]; 21 | } 22 | 23 | - (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder { 24 | [self sd_setImageWithURL:url placeholderImage:placeholder options:0 progress:nil completed:nil]; 25 | } 26 | 27 | - (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options { 28 | [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:nil]; 29 | } 30 | 31 | - (void)sd_setImageWithURL:(nullable NSURL *)url completed:(nullable SDExternalCompletionBlock)completedBlock { 32 | [self sd_setImageWithURL:url placeholderImage:nil options:0 progress:nil completed:completedBlock]; 33 | } 34 | 35 | - (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder completed:(nullable SDExternalCompletionBlock)completedBlock { 36 | [self sd_setImageWithURL:url placeholderImage:placeholder options:0 progress:nil completed:completedBlock]; 37 | } 38 | 39 | - (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options completed:(nullable SDExternalCompletionBlock)completedBlock { 40 | [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:completedBlock]; 41 | } 42 | 43 | - (void)sd_setImageWithURL:(nullable NSURL *)url 44 | placeholderImage:(nullable UIImage *)placeholder 45 | options:(SDWebImageOptions)options 46 | progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock 47 | completed:(nullable SDExternalCompletionBlock)completedBlock { 48 | [self sd_internalSetImageWithURL:url 49 | placeholderImage:placeholder 50 | options:options 51 | operationKey:nil 52 | setImageBlock:nil 53 | progress:progressBlock 54 | completed:completedBlock]; 55 | } 56 | 57 | - (void)sd_setImageWithPreviousCachedImageWithURL:(nullable NSURL *)url 58 | placeholderImage:(nullable UIImage *)placeholder 59 | options:(SDWebImageOptions)options 60 | progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock 61 | completed:(nullable SDExternalCompletionBlock)completedBlock { 62 | NSString *key = [[SDWebImageManager sharedManager] cacheKeyForURL:url]; 63 | UIImage *lastPreviousCachedImage = [[SDImageCache sharedImageCache] imageFromCacheForKey:key]; 64 | 65 | [self sd_setImageWithURL:url placeholderImage:lastPreviousCachedImage ?: placeholder options:options progress:progressBlock completed:completedBlock]; 66 | } 67 | 68 | #if SD_UIKIT 69 | 70 | #pragma mark - Animation of multiple images 71 | 72 | - (void)sd_setAnimationImagesWithURLs:(nonnull NSArray *)arrayOfURLs { 73 | [self sd_cancelCurrentAnimationImagesLoad]; 74 | __weak __typeof(self)wself = self; 75 | 76 | NSMutableArray> *operationsArray = [[NSMutableArray alloc] init]; 77 | 78 | [arrayOfURLs enumerateObjectsUsingBlock:^(NSURL *logoImageURL, NSUInteger idx, BOOL * _Nonnull stop) { 79 | id operation = [SDWebImageManager.sharedManager loadImageWithURL:logoImageURL options:0 progress:nil completed:^(UIImage *image, NSData *data, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { 80 | if (!wself) return; 81 | dispatch_main_async_safe(^{ 82 | __strong UIImageView *sself = wself; 83 | [sself stopAnimating]; 84 | if (sself && image) { 85 | NSMutableArray *currentImages = [[sself animationImages] mutableCopy]; 86 | if (!currentImages) { 87 | currentImages = [[NSMutableArray alloc] init]; 88 | } 89 | 90 | // We know what index objects should be at when they are returned so 91 | // we will put the object at the index, filling any empty indexes 92 | // with the image that was returned too "early". These images will 93 | // be overwritten. (does not require additional sorting datastructure) 94 | while ([currentImages count] < idx) { 95 | [currentImages addObject:image]; 96 | } 97 | 98 | currentImages[idx] = image; 99 | 100 | sself.animationImages = currentImages; 101 | [sself setNeedsLayout]; 102 | } 103 | [sself startAnimating]; 104 | }); 105 | }]; 106 | [operationsArray addObject:operation]; 107 | }]; 108 | 109 | [self sd_setImageLoadOperation:[operationsArray copy] forKey:@"UIImageViewAnimationImages"]; 110 | } 111 | 112 | - (void)sd_cancelCurrentAnimationImagesLoad { 113 | [self sd_cancelImageLoadOperationWithKey:@"UIImageViewAnimationImages"]; 114 | } 115 | #endif 116 | 117 | @end 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /appios/Pods/SDWebImage/SDWebImage/UIView+WebCache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if SD_UIKIT || SD_MAC 12 | 13 | #import "SDWebImageManager.h" 14 | 15 | typedef void(^SDSetImageBlock)(UIImage * _Nullable image, NSData * _Nullable imageData); 16 | 17 | @interface UIView (WebCache) 18 | 19 | /** 20 | * Get the current image URL. 21 | * 22 | * Note that because of the limitations of categories this property can get out of sync 23 | * if you use setImage: directly. 24 | */ 25 | - (nullable NSURL *)sd_imageURL; 26 | 27 | /** 28 | * Set the imageView `image` with an `url` and optionally a placeholder image. 29 | * 30 | * The download is asynchronous and cached. 31 | * 32 | * @param url The url for the image. 33 | * @param placeholder The image to be set initially, until the image request finishes. 34 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 35 | * @param operationKey A string to be used as the operation key. If nil, will use the class name 36 | * @param setImageBlock Block used for custom set image code 37 | * @param progressBlock A block called while image is downloading 38 | * @note the progress block is executed on a background queue 39 | * @param completedBlock A block called when operation has been completed. This block has no return value 40 | * and takes the requested UIImage as first parameter. In case of error the image parameter 41 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 42 | * indicating if the image was retrieved from the local cache or from the network. 43 | * The fourth parameter is the original image url. 44 | */ 45 | - (void)sd_internalSetImageWithURL:(nullable NSURL *)url 46 | placeholderImage:(nullable UIImage *)placeholder 47 | options:(SDWebImageOptions)options 48 | operationKey:(nullable NSString *)operationKey 49 | setImageBlock:(nullable SDSetImageBlock)setImageBlock 50 | progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock 51 | completed:(nullable SDExternalCompletionBlock)completedBlock; 52 | 53 | /** 54 | * Cancel the current download 55 | */ 56 | - (void)sd_cancelCurrentImageLoad; 57 | 58 | #if SD_UIKIT 59 | 60 | #pragma mark - Activity indicator 61 | 62 | /** 63 | * Show activity UIActivityIndicatorView 64 | */ 65 | - (void)sd_setShowActivityIndicatorView:(BOOL)show; 66 | 67 | /** 68 | * set desired UIActivityIndicatorViewStyle 69 | * 70 | * @param style The style of the UIActivityIndicatorView 71 | */ 72 | - (void)sd_setIndicatorStyle:(UIActivityIndicatorViewStyle)style; 73 | 74 | - (BOOL)sd_showActivityIndicatorView; 75 | - (void)sd_addActivityIndicator; 76 | - (void)sd_removeActivityIndicator; 77 | 78 | #endif 79 | 80 | @end 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /appios/Pods/SDWebImage/SDWebImage/UIView+WebCache.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIView+WebCache.h" 10 | 11 | #if SD_UIKIT || SD_MAC 12 | 13 | #import "objc/runtime.h" 14 | #import "UIView+WebCacheOperation.h" 15 | 16 | static char imageURLKey; 17 | 18 | #if SD_UIKIT 19 | static char TAG_ACTIVITY_INDICATOR; 20 | static char TAG_ACTIVITY_STYLE; 21 | #endif 22 | static char TAG_ACTIVITY_SHOW; 23 | 24 | @implementation UIView (WebCache) 25 | 26 | - (nullable NSURL *)sd_imageURL { 27 | return objc_getAssociatedObject(self, &imageURLKey); 28 | } 29 | 30 | - (void)sd_internalSetImageWithURL:(nullable NSURL *)url 31 | placeholderImage:(nullable UIImage *)placeholder 32 | options:(SDWebImageOptions)options 33 | operationKey:(nullable NSString *)operationKey 34 | setImageBlock:(nullable SDSetImageBlock)setImageBlock 35 | progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock 36 | completed:(nullable SDExternalCompletionBlock)completedBlock { 37 | NSString *validOperationKey = operationKey ?: NSStringFromClass([self class]); 38 | [self sd_cancelImageLoadOperationWithKey:validOperationKey]; 39 | objc_setAssociatedObject(self, &imageURLKey, url, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 40 | 41 | if (!(options & SDWebImageDelayPlaceholder)) { 42 | dispatch_main_async_safe(^{ 43 | [self sd_setImage:placeholder imageData:nil basedOnClassOrViaCustomSetImageBlock:setImageBlock]; 44 | }); 45 | } 46 | 47 | if (url) { 48 | // check if activityView is enabled or not 49 | if ([self sd_showActivityIndicatorView]) { 50 | [self sd_addActivityIndicator]; 51 | } 52 | 53 | __weak __typeof(self)wself = self; 54 | id operation = [SDWebImageManager.sharedManager loadImageWithURL:url options:options progress:progressBlock completed:^(UIImage *image, NSData *data, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { 55 | __strong __typeof (wself) sself = wself; 56 | [sself sd_removeActivityIndicator]; 57 | if (!sself) { 58 | return; 59 | } 60 | dispatch_main_async_safe(^{ 61 | if (!sself) { 62 | return; 63 | } 64 | if (image && (options & SDWebImageAvoidAutoSetImage) && completedBlock) { 65 | completedBlock(image, error, cacheType, url); 66 | return; 67 | } else if (image) { 68 | [sself sd_setImage:image imageData:data basedOnClassOrViaCustomSetImageBlock:setImageBlock]; 69 | [sself sd_setNeedsLayout]; 70 | } else { 71 | if ((options & SDWebImageDelayPlaceholder)) { 72 | [sself sd_setImage:placeholder imageData:nil basedOnClassOrViaCustomSetImageBlock:setImageBlock]; 73 | [sself sd_setNeedsLayout]; 74 | } 75 | } 76 | if (completedBlock && finished) { 77 | completedBlock(image, error, cacheType, url); 78 | } 79 | }); 80 | }]; 81 | [self sd_setImageLoadOperation:operation forKey:validOperationKey]; 82 | } else { 83 | dispatch_main_async_safe(^{ 84 | [self sd_removeActivityIndicator]; 85 | if (completedBlock) { 86 | NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}]; 87 | completedBlock(nil, error, SDImageCacheTypeNone, url); 88 | } 89 | }); 90 | } 91 | } 92 | 93 | - (void)sd_cancelCurrentImageLoad { 94 | [self sd_cancelImageLoadOperationWithKey:NSStringFromClass([self class])]; 95 | } 96 | 97 | - (void)sd_setImage:(UIImage *)image imageData:(NSData *)imageData basedOnClassOrViaCustomSetImageBlock:(SDSetImageBlock)setImageBlock { 98 | if (setImageBlock) { 99 | setImageBlock(image, imageData); 100 | return; 101 | } 102 | 103 | #if SD_UIKIT || SD_MAC 104 | if ([self isKindOfClass:[UIImageView class]]) { 105 | UIImageView *imageView = (UIImageView *)self; 106 | imageView.image = image; 107 | } 108 | #endif 109 | 110 | #if SD_UIKIT 111 | if ([self isKindOfClass:[UIButton class]]) { 112 | UIButton *button = (UIButton *)self; 113 | [button setImage:image forState:UIControlStateNormal]; 114 | } 115 | #endif 116 | } 117 | 118 | - (void)sd_setNeedsLayout { 119 | #if SD_UIKIT 120 | [self setNeedsLayout]; 121 | #elif SD_MAC 122 | [self setNeedsLayout:YES]; 123 | #endif 124 | } 125 | 126 | #pragma mark - Activity indicator 127 | 128 | #pragma mark - 129 | #if SD_UIKIT 130 | - (UIActivityIndicatorView *)activityIndicator { 131 | return (UIActivityIndicatorView *)objc_getAssociatedObject(self, &TAG_ACTIVITY_INDICATOR); 132 | } 133 | 134 | - (void)setActivityIndicator:(UIActivityIndicatorView *)activityIndicator { 135 | objc_setAssociatedObject(self, &TAG_ACTIVITY_INDICATOR, activityIndicator, OBJC_ASSOCIATION_RETAIN); 136 | } 137 | #endif 138 | 139 | - (void)sd_setShowActivityIndicatorView:(BOOL)show { 140 | objc_setAssociatedObject(self, &TAG_ACTIVITY_SHOW, @(show), OBJC_ASSOCIATION_RETAIN); 141 | } 142 | 143 | - (BOOL)sd_showActivityIndicatorView { 144 | return [objc_getAssociatedObject(self, &TAG_ACTIVITY_SHOW) boolValue]; 145 | } 146 | 147 | #if SD_UIKIT 148 | - (void)sd_setIndicatorStyle:(UIActivityIndicatorViewStyle)style{ 149 | objc_setAssociatedObject(self, &TAG_ACTIVITY_STYLE, [NSNumber numberWithInt:style], OBJC_ASSOCIATION_RETAIN); 150 | } 151 | 152 | - (int)sd_getIndicatorStyle{ 153 | return [objc_getAssociatedObject(self, &TAG_ACTIVITY_STYLE) intValue]; 154 | } 155 | #endif 156 | 157 | - (void)sd_addActivityIndicator { 158 | #if SD_UIKIT 159 | dispatch_main_async_safe(^{ 160 | if (!self.activityIndicator) { 161 | self.activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:[self sd_getIndicatorStyle]]; 162 | self.activityIndicator.translatesAutoresizingMaskIntoConstraints = NO; 163 | 164 | [self addSubview:self.activityIndicator]; 165 | 166 | [self addConstraint:[NSLayoutConstraint constraintWithItem:self.activityIndicator 167 | attribute:NSLayoutAttributeCenterX 168 | relatedBy:NSLayoutRelationEqual 169 | toItem:self 170 | attribute:NSLayoutAttributeCenterX 171 | multiplier:1.0 172 | constant:0.0]]; 173 | [self addConstraint:[NSLayoutConstraint constraintWithItem:self.activityIndicator 174 | attribute:NSLayoutAttributeCenterY 175 | relatedBy:NSLayoutRelationEqual 176 | toItem:self 177 | attribute:NSLayoutAttributeCenterY 178 | multiplier:1.0 179 | constant:0.0]]; 180 | } 181 | [self.activityIndicator startAnimating]; 182 | }); 183 | #endif 184 | } 185 | 186 | - (void)sd_removeActivityIndicator { 187 | #if SD_UIKIT 188 | dispatch_main_async_safe(^{ 189 | if (self.activityIndicator) { 190 | [self.activityIndicator removeFromSuperview]; 191 | self.activityIndicator = nil; 192 | } 193 | }); 194 | #endif 195 | } 196 | 197 | @end 198 | 199 | #endif 200 | -------------------------------------------------------------------------------- /appios/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if SD_UIKIT || SD_MAC 12 | 13 | #import "SDWebImageManager.h" 14 | 15 | @interface UIView (WebCacheOperation) 16 | 17 | /** 18 | * Set the image load operation (storage in a UIView based dictionary) 19 | * 20 | * @param operation the operation 21 | * @param key key for storing the operation 22 | */ 23 | - (void)sd_setImageLoadOperation:(nullable id)operation forKey:(nullable NSString *)key; 24 | 25 | /** 26 | * Cancel all operations for the current UIView and key 27 | * 28 | * @param key key for identifying the operations 29 | */ 30 | - (void)sd_cancelImageLoadOperationWithKey:(nullable NSString *)key; 31 | 32 | /** 33 | * Just remove the operations corresponding to the current UIView and key without cancelling them 34 | * 35 | * @param key key for identifying the operations 36 | */ 37 | - (void)sd_removeImageLoadOperationWithKey:(nullable NSString *)key; 38 | 39 | @end 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /appios/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIView+WebCacheOperation.h" 10 | 11 | #if SD_UIKIT || SD_MAC 12 | 13 | #import "objc/runtime.h" 14 | 15 | static char loadOperationKey; 16 | 17 | typedef NSMutableDictionary SDOperationsDictionary; 18 | 19 | @implementation UIView (WebCacheOperation) 20 | 21 | - (SDOperationsDictionary *)operationDictionary { 22 | SDOperationsDictionary *operations = objc_getAssociatedObject(self, &loadOperationKey); 23 | if (operations) { 24 | return operations; 25 | } 26 | operations = [NSMutableDictionary dictionary]; 27 | objc_setAssociatedObject(self, &loadOperationKey, operations, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 28 | return operations; 29 | } 30 | 31 | - (void)sd_setImageLoadOperation:(nullable id)operation forKey:(nullable NSString *)key { 32 | if (key) { 33 | [self sd_cancelImageLoadOperationWithKey:key]; 34 | if (operation) { 35 | SDOperationsDictionary *operationDictionary = [self operationDictionary]; 36 | operationDictionary[key] = operation; 37 | } 38 | } 39 | } 40 | 41 | - (void)sd_cancelImageLoadOperationWithKey:(nullable NSString *)key { 42 | // Cancel in progress downloader from queue 43 | SDOperationsDictionary *operationDictionary = [self operationDictionary]; 44 | id operations = operationDictionary[key]; 45 | if (operations) { 46 | if ([operations isKindOfClass:[NSArray class]]) { 47 | for (id operation in operations) { 48 | if (operation) { 49 | [operation cancel]; 50 | } 51 | } 52 | } else if ([operations conformsToProtocol:@protocol(SDWebImageOperation)]){ 53 | [(id) operations cancel]; 54 | } 55 | [operationDictionary removeObjectForKey:key]; 56 | } 57 | } 58 | 59 | - (void)sd_removeImageLoadOperationWithKey:(nullable NSString *)key { 60 | if (key) { 61 | SDOperationsDictionary *operationDictionary = [self operationDictionary]; 62 | [operationDictionary removeObjectForKey:key]; 63 | } 64 | } 65 | 66 | @end 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /appios/Pods/Target Support Files/Pods-konfswift/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /appios/Pods/Target Support Files/Pods-konfswift/Pods-konfswift-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /appios/Pods/Target Support Files/Pods-konfswift/Pods-konfswift-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## SDWebImage 5 | 6 | Copyright (c) 2009-2017 Olivier Poitrey rs@dailymotion.com 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is furnished 13 | to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in all 16 | copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | 27 | Generated by CocoaPods - https://cocoapods.org 28 | -------------------------------------------------------------------------------- /appios/Pods/Target Support Files/Pods-konfswift/Pods-konfswift-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2009-2017 Olivier Poitrey rs@dailymotion.com 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is furnished 24 | to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in all 27 | copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | 38 | License 39 | MIT 40 | Title 41 | SDWebImage 42 | Type 43 | PSGroupSpecifier 44 | 45 | 46 | FooterText 47 | Generated by CocoaPods - https://cocoapods.org 48 | Title 49 | 50 | Type 51 | PSGroupSpecifier 52 | 53 | 54 | StringsTable 55 | Acknowledgements 56 | Title 57 | Acknowledgements 58 | 59 | 60 | -------------------------------------------------------------------------------- /appios/Pods/Target Support Files/Pods-konfswift/Pods-konfswift-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_konfswift : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_konfswift 5 | @end 6 | -------------------------------------------------------------------------------- /appios/Pods/Target Support Files/Pods-konfswift/Pods-konfswift-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | function on_error { 7 | echo "$(realpath -mq "${0}"):$1: error: Unexpected failure" 8 | } 9 | trap 'on_error $LINENO' ERR 10 | 11 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then 12 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy 13 | # frameworks to, so exit 0 (signalling the script phase was successful). 14 | exit 0 15 | fi 16 | 17 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 18 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 19 | 20 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" 21 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 22 | 23 | # Used as a return value for each invocation of `strip_invalid_archs` function. 24 | STRIP_BINARY_RETVAL=0 25 | 26 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 27 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 28 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 29 | 30 | # Copies and strips a vendored framework 31 | install_framework() 32 | { 33 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 34 | local source="${BUILT_PRODUCTS_DIR}/$1" 35 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 36 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 37 | elif [ -r "$1" ]; then 38 | local source="$1" 39 | fi 40 | 41 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 42 | 43 | if [ -L "${source}" ]; then 44 | echo "Symlinked..." 45 | source="$(readlink "${source}")" 46 | fi 47 | 48 | # Use filter instead of exclude so missing patterns don't throw errors. 49 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 50 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 51 | 52 | local basename 53 | basename="$(basename -s .framework "$1")" 54 | binary="${destination}/${basename}.framework/${basename}" 55 | 56 | if ! [ -r "$binary" ]; then 57 | binary="${destination}/${basename}" 58 | elif [ -L "${binary}" ]; then 59 | echo "Destination binary is symlinked..." 60 | dirname="$(dirname "${binary}")" 61 | binary="${dirname}/$(readlink "${binary}")" 62 | fi 63 | 64 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 65 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 66 | strip_invalid_archs "$binary" 67 | fi 68 | 69 | # Resign the code if required by the build settings to avoid unstable apps 70 | code_sign_if_enabled "${destination}/$(basename "$1")" 71 | 72 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 73 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 74 | local swift_runtime_libs 75 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u) 76 | for lib in $swift_runtime_libs; do 77 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 78 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 79 | code_sign_if_enabled "${destination}/${lib}" 80 | done 81 | fi 82 | } 83 | 84 | # Copies and strips a vendored dSYM 85 | install_dsym() { 86 | local source="$1" 87 | if [ -r "$source" ]; then 88 | # Copy the dSYM into a the targets temp dir. 89 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" 90 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" 91 | 92 | local basename 93 | basename="$(basename -s .framework.dSYM "$source")" 94 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" 95 | 96 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 97 | if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then 98 | strip_invalid_archs "$binary" 99 | fi 100 | 101 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then 102 | # Move the stripped file into its final destination. 103 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" 104 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" 105 | else 106 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. 107 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" 108 | fi 109 | fi 110 | } 111 | 112 | # Signs a framework with the provided identity 113 | code_sign_if_enabled() { 114 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 115 | # Use the current code_sign_identity 116 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 117 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" 118 | 119 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 120 | code_sign_cmd="$code_sign_cmd &" 121 | fi 122 | echo "$code_sign_cmd" 123 | eval "$code_sign_cmd" 124 | fi 125 | } 126 | 127 | # Strip invalid architectures 128 | strip_invalid_archs() { 129 | binary="$1" 130 | # Get architectures for current target binary 131 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 132 | # Intersect them with the architectures we are building for 133 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 134 | # If there are no archs supported by this binary then warn the user 135 | if [[ -z "$intersected_archs" ]]; then 136 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 137 | STRIP_BINARY_RETVAL=0 138 | return 139 | fi 140 | stripped="" 141 | for arch in $binary_archs; do 142 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 143 | # Strip non-valid architectures in-place 144 | lipo -remove "$arch" -output "$binary" "$binary" 145 | stripped="$stripped $arch" 146 | fi 147 | done 148 | if [[ "$stripped" ]]; then 149 | echo "Stripped $binary of architectures:$stripped" 150 | fi 151 | STRIP_BINARY_RETVAL=1 152 | } 153 | 154 | 155 | if [[ "$CONFIGURATION" == "Debug" ]]; then 156 | install_framework "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework" 157 | fi 158 | if [[ "$CONFIGURATION" == "Release" ]]; then 159 | install_framework "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework" 160 | fi 161 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 162 | wait 163 | fi 164 | -------------------------------------------------------------------------------- /appios/Pods/Target Support Files/Pods-konfswift/Pods-konfswift-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then 7 | # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy 8 | # resources to, so exit 0 (signalling the script phase was successful). 9 | exit 0 10 | fi 11 | 12 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 13 | 14 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 15 | > "$RESOURCES_TO_COPY" 16 | 17 | XCASSET_FILES=() 18 | 19 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 20 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 21 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 22 | 23 | case "${TARGETED_DEVICE_FAMILY:-}" in 24 | 1,2) 25 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 26 | ;; 27 | 1) 28 | TARGET_DEVICE_ARGS="--target-device iphone" 29 | ;; 30 | 2) 31 | TARGET_DEVICE_ARGS="--target-device ipad" 32 | ;; 33 | 3) 34 | TARGET_DEVICE_ARGS="--target-device tv" 35 | ;; 36 | 4) 37 | TARGET_DEVICE_ARGS="--target-device watch" 38 | ;; 39 | *) 40 | TARGET_DEVICE_ARGS="--target-device mac" 41 | ;; 42 | esac 43 | 44 | install_resource() 45 | { 46 | if [[ "$1" = /* ]] ; then 47 | RESOURCE_PATH="$1" 48 | else 49 | RESOURCE_PATH="${PODS_ROOT}/$1" 50 | fi 51 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 52 | cat << EOM 53 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 54 | EOM 55 | exit 1 56 | fi 57 | case $RESOURCE_PATH in 58 | *.storyboard) 59 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 60 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 61 | ;; 62 | *.xib) 63 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 64 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 65 | ;; 66 | *.framework) 67 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 68 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 69 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 70 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 71 | ;; 72 | *.xcdatamodel) 73 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 74 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 75 | ;; 76 | *.xcdatamodeld) 77 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 78 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 79 | ;; 80 | *.xcmappingmodel) 81 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 82 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 83 | ;; 84 | *.xcassets) 85 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 86 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 87 | ;; 88 | *) 89 | echo "$RESOURCE_PATH" || true 90 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 91 | ;; 92 | esac 93 | } 94 | 95 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 96 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 97 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 98 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 99 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 100 | fi 101 | rm -f "$RESOURCES_TO_COPY" 102 | 103 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] 104 | then 105 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 106 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 107 | while read line; do 108 | if [[ $line != "${PODS_ROOT}*" ]]; then 109 | XCASSET_FILES+=("$line") 110 | fi 111 | done <<<"$OTHER_XCASSETS" 112 | 113 | if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then 114 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 115 | else 116 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist" 117 | fi 118 | fi 119 | -------------------------------------------------------------------------------- /appios/Pods/Target Support Files/Pods-konfswift/Pods-konfswift-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_konfswiftVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_konfswiftVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /appios/Pods/Target Support Files/Pods-konfswift/Pods-konfswift.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage/SDWebImage.framework/Headers" 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_LDFLAGS = $(inherited) -framework "ImageIO" -framework "SDWebImage" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /appios/Pods/Target Support Files/Pods-konfswift/Pods-konfswift.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_konfswift { 2 | umbrella header "Pods-konfswift-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /appios/Pods/Target Support Files/Pods-konfswift/Pods-konfswift.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage/SDWebImage.framework/Headers" 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_LDFLAGS = $(inherited) -framework "ImageIO" -framework "SDWebImage" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /appios/Pods/Target Support Files/Pods-konfswiftTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /appios/Pods/Target Support Files/Pods-konfswiftTests/Pods-konfswiftTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /appios/Pods/Target Support Files/Pods-konfswiftTests/Pods-konfswiftTests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /appios/Pods/Target Support Files/Pods-konfswiftTests/Pods-konfswiftTests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /appios/Pods/Target Support Files/Pods-konfswiftTests/Pods-konfswiftTests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_konfswiftTests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_konfswiftTests 5 | @end 6 | -------------------------------------------------------------------------------- /appios/Pods/Target Support Files/Pods-konfswiftTests/Pods-konfswiftTests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then 7 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy 8 | # frameworks to, so exit 0 (signalling the script phase was successful). 9 | exit 0 10 | fi 11 | 12 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 13 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 14 | 15 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" 16 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 17 | 18 | # Used as a return value for each invocation of `strip_invalid_archs` function. 19 | STRIP_BINARY_RETVAL=0 20 | 21 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 22 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 23 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 24 | 25 | # Copies and strips a vendored framework 26 | install_framework() 27 | { 28 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 29 | local source="${BUILT_PRODUCTS_DIR}/$1" 30 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 31 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 32 | elif [ -r "$1" ]; then 33 | local source="$1" 34 | fi 35 | 36 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 37 | 38 | if [ -L "${source}" ]; then 39 | echo "Symlinked..." 40 | source="$(readlink "${source}")" 41 | fi 42 | 43 | # Use filter instead of exclude so missing patterns don't throw errors. 44 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 45 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 46 | 47 | local basename 48 | basename="$(basename -s .framework "$1")" 49 | binary="${destination}/${basename}.framework/${basename}" 50 | if ! [ -r "$binary" ]; then 51 | binary="${destination}/${basename}" 52 | fi 53 | 54 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 55 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 56 | strip_invalid_archs "$binary" 57 | fi 58 | 59 | # Resign the code if required by the build settings to avoid unstable apps 60 | code_sign_if_enabled "${destination}/$(basename "$1")" 61 | 62 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 63 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 64 | local swift_runtime_libs 65 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 66 | for lib in $swift_runtime_libs; do 67 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 68 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 69 | code_sign_if_enabled "${destination}/${lib}" 70 | done 71 | fi 72 | } 73 | 74 | # Copies and strips a vendored dSYM 75 | install_dsym() { 76 | local source="$1" 77 | if [ -r "$source" ]; then 78 | # Copy the dSYM into a the targets temp dir. 79 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" 80 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" 81 | 82 | local basename 83 | basename="$(basename -s .framework.dSYM "$source")" 84 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" 85 | 86 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 87 | if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then 88 | strip_invalid_archs "$binary" 89 | fi 90 | 91 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then 92 | # Move the stripped file into its final destination. 93 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" 94 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" 95 | else 96 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. 97 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" 98 | fi 99 | fi 100 | } 101 | 102 | # Signs a framework with the provided identity 103 | code_sign_if_enabled() { 104 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 105 | # Use the current code_sign_identitiy 106 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 107 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" 108 | 109 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 110 | code_sign_cmd="$code_sign_cmd &" 111 | fi 112 | echo "$code_sign_cmd" 113 | eval "$code_sign_cmd" 114 | fi 115 | } 116 | 117 | # Strip invalid architectures 118 | strip_invalid_archs() { 119 | binary="$1" 120 | # Get architectures for current target binary 121 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 122 | # Intersect them with the architectures we are building for 123 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 124 | # If there are no archs supported by this binary then warn the user 125 | if [[ -z "$intersected_archs" ]]; then 126 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 127 | STRIP_BINARY_RETVAL=0 128 | return 129 | fi 130 | stripped="" 131 | for arch in $binary_archs; do 132 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 133 | # Strip non-valid architectures in-place 134 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 135 | stripped="$stripped $arch" 136 | fi 137 | done 138 | if [[ "$stripped" ]]; then 139 | echo "Stripped $binary of architectures:$stripped" 140 | fi 141 | STRIP_BINARY_RETVAL=1 142 | } 143 | 144 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 145 | wait 146 | fi 147 | -------------------------------------------------------------------------------- /appios/Pods/Target Support Files/Pods-konfswiftTests/Pods-konfswiftTests-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then 7 | # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy 8 | # resources to, so exit 0 (signalling the script phase was successful). 9 | exit 0 10 | fi 11 | 12 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 13 | 14 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 15 | > "$RESOURCES_TO_COPY" 16 | 17 | XCASSET_FILES=() 18 | 19 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 20 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 21 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 22 | 23 | case "${TARGETED_DEVICE_FAMILY:-}" in 24 | 1,2) 25 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 26 | ;; 27 | 1) 28 | TARGET_DEVICE_ARGS="--target-device iphone" 29 | ;; 30 | 2) 31 | TARGET_DEVICE_ARGS="--target-device ipad" 32 | ;; 33 | 3) 34 | TARGET_DEVICE_ARGS="--target-device tv" 35 | ;; 36 | 4) 37 | TARGET_DEVICE_ARGS="--target-device watch" 38 | ;; 39 | *) 40 | TARGET_DEVICE_ARGS="--target-device mac" 41 | ;; 42 | esac 43 | 44 | install_resource() 45 | { 46 | if [[ "$1" = /* ]] ; then 47 | RESOURCE_PATH="$1" 48 | else 49 | RESOURCE_PATH="${PODS_ROOT}/$1" 50 | fi 51 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 52 | cat << EOM 53 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 54 | EOM 55 | exit 1 56 | fi 57 | case $RESOURCE_PATH in 58 | *.storyboard) 59 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 60 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 61 | ;; 62 | *.xib) 63 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 64 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 65 | ;; 66 | *.framework) 67 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 68 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 69 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 70 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 71 | ;; 72 | *.xcdatamodel) 73 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 74 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 75 | ;; 76 | *.xcdatamodeld) 77 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 78 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 79 | ;; 80 | *.xcmappingmodel) 81 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 82 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 83 | ;; 84 | *.xcassets) 85 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 86 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 87 | ;; 88 | *) 89 | echo "$RESOURCE_PATH" || true 90 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 91 | ;; 92 | esac 93 | } 94 | 95 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 96 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 97 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 98 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 99 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 100 | fi 101 | rm -f "$RESOURCES_TO_COPY" 102 | 103 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] 104 | then 105 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 106 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 107 | while read line; do 108 | if [[ $line != "${PODS_ROOT}*" ]]; then 109 | XCASSET_FILES+=("$line") 110 | fi 111 | done <<<"$OTHER_XCASSETS" 112 | 113 | if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then 114 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 115 | else 116 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist" 117 | fi 118 | fi 119 | -------------------------------------------------------------------------------- /appios/Pods/Target Support Files/Pods-konfswiftTests/Pods-konfswiftTests-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_konfswiftTestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_konfswiftTestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /appios/Pods/Target Support Files/Pods-konfswiftTests/Pods-konfswiftTests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage/SDWebImage.framework/Headers" 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_LDFLAGS = $(inherited) -framework "ImageIO" -framework "SDWebImage" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /appios/Pods/Target Support Files/Pods-konfswiftTests/Pods-konfswiftTests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_konfswiftTests { 2 | umbrella header "Pods-konfswiftTests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /appios/Pods/Target Support Files/Pods-konfswiftTests/Pods-konfswiftTests.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage/SDWebImage.framework/Headers" 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_LDFLAGS = $(inherited) -framework "ImageIO" -framework "SDWebImage" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /appios/Pods/Target Support Files/SDWebImage/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 4.1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /appios/Pods/Target Support Files/SDWebImage/SDWebImage-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 4.1.2 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /appios/Pods/Target Support Files/SDWebImage/SDWebImage-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_SDWebImage : NSObject 3 | @end 4 | @implementation PodsDummy_SDWebImage 5 | @end 6 | -------------------------------------------------------------------------------- /appios/Pods/Target Support Files/SDWebImage/SDWebImage-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /appios/Pods/Target Support Files/SDWebImage/SDWebImage-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "NSData+ImageContentType.h" 14 | #import "NSImage+WebCache.h" 15 | #import "SDImageCache.h" 16 | #import "SDImageCacheConfig.h" 17 | #import "SDWebImageCompat.h" 18 | #import "SDWebImageDecoder.h" 19 | #import "SDWebImageDownloader.h" 20 | #import "SDWebImageDownloaderOperation.h" 21 | #import "SDWebImageManager.h" 22 | #import "SDWebImageOperation.h" 23 | #import "SDWebImagePrefetcher.h" 24 | #import "UIButton+WebCache.h" 25 | #import "UIImage+GIF.h" 26 | #import "UIImage+MultiFormat.h" 27 | #import "UIImageView+HighlightedWebCache.h" 28 | #import "UIImageView+WebCache.h" 29 | #import "UIView+WebCache.h" 30 | #import "UIView+WebCacheOperation.h" 31 | 32 | FOUNDATION_EXPORT double SDWebImageVersionNumber; 33 | FOUNDATION_EXPORT const unsigned char SDWebImageVersionString[]; 34 | 35 | -------------------------------------------------------------------------------- /appios/Pods/Target Support Files/SDWebImage/SDWebImage.modulemap: -------------------------------------------------------------------------------- 1 | framework module SDWebImage { 2 | umbrella header "SDWebImage-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /appios/Pods/Target Support Files/SDWebImage/SDWebImage.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_LDFLAGS = $(inherited) -framework "ImageIO" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/SDWebImage 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /appios/appswift/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | KotlinNative 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | arm64 32 | armv7 33 | 34 | UIStatusBarStyle 35 | UIStatusBarStyleLightContent 36 | UISupportedInterfaceOrientations 37 | 38 | UIInterfaceOrientationPortrait 39 | 40 | UISupportedInterfaceOrientations~ipad 41 | 42 | UIInterfaceOrientationPortrait 43 | UIInterfaceOrientationPortraitUpsideDown 44 | UIInterfaceOrientationLandscapeLeft 45 | UIInterfaceOrientationLandscapeRight 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /appios/appswift/resources/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@2x.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@3x.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "40x40", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-40x40@2x.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@3x.png", 37 | "scale" : "3x" 38 | }, 39 | { 40 | "size" : "60x60", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-60x60@2x.png", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@3x.png", 49 | "scale" : "3x" 50 | }, 51 | { 52 | "idiom" : "ipad", 53 | "size" : "20x20", 54 | "scale" : "1x" 55 | }, 56 | { 57 | "idiom" : "ipad", 58 | "size" : "20x20", 59 | "scale" : "2x" 60 | }, 61 | { 62 | "idiom" : "ipad", 63 | "size" : "29x29", 64 | "scale" : "1x" 65 | }, 66 | { 67 | "idiom" : "ipad", 68 | "size" : "29x29", 69 | "scale" : "2x" 70 | }, 71 | { 72 | "idiom" : "ipad", 73 | "size" : "40x40", 74 | "scale" : "1x" 75 | }, 76 | { 77 | "idiom" : "ipad", 78 | "size" : "40x40", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "idiom" : "ipad", 83 | "size" : "76x76", 84 | "scale" : "1x" 85 | }, 86 | { 87 | "idiom" : "ipad", 88 | "size" : "76x76", 89 | "scale" : "2x" 90 | }, 91 | { 92 | "idiom" : "ipad", 93 | "size" : "83.5x83.5", 94 | "scale" : "2x" 95 | }, 96 | { 97 | "size" : "1024x1024", 98 | "idiom" : "ios-marketing", 99 | "filename" : "Icon-App-iTunes.png", 100 | "scale" : "1x" 101 | } 102 | ], 103 | "info" : { 104 | "version" : 1, 105 | "author" : "xcode" 106 | } 107 | } -------------------------------------------------------------------------------- /appios/appswift/resources/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/florent37/KotlinNativeSample/fca6abf35ea759cecaa887ab52dcf5b8696f64b8/appios/appswift/resources/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /appios/appswift/resources/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/florent37/KotlinNativeSample/fca6abf35ea759cecaa887ab52dcf5b8696f64b8/appios/appswift/resources/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /appios/appswift/resources/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/florent37/KotlinNativeSample/fca6abf35ea759cecaa887ab52dcf5b8696f64b8/appios/appswift/resources/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /appios/appswift/resources/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/florent37/KotlinNativeSample/fca6abf35ea759cecaa887ab52dcf5b8696f64b8/appios/appswift/resources/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /appios/appswift/resources/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/florent37/KotlinNativeSample/fca6abf35ea759cecaa887ab52dcf5b8696f64b8/appios/appswift/resources/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /appios/appswift/resources/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/florent37/KotlinNativeSample/fca6abf35ea759cecaa887ab52dcf5b8696f64b8/appios/appswift/resources/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /appios/appswift/resources/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/florent37/KotlinNativeSample/fca6abf35ea759cecaa887ab52dcf5b8696f64b8/appios/appswift/resources/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /appios/appswift/resources/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/florent37/KotlinNativeSample/fca6abf35ea759cecaa887ab52dcf5b8696f64b8/appios/appswift/resources/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /appios/appswift/resources/Assets.xcassets/AppIcon.appiconset/Icon-App-iTunes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/florent37/KotlinNativeSample/fca6abf35ea759cecaa887ab52dcf5b8696f64b8/appios/appswift/resources/Assets.xcassets/AppIcon.appiconset/Icon-App-iTunes.png -------------------------------------------------------------------------------- /appios/appswift/resources/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /appios/appswift/resources/Assets.xcassets/user_default.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "user-1.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /appios/appswift/resources/Assets.xcassets/user_default.imageset/user-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/florent37/KotlinNativeSample/fca6abf35ea759cecaa887ab52dcf5b8696f64b8/appios/appswift/resources/Assets.xcassets/user_default.imageset/user-1.png -------------------------------------------------------------------------------- /appios/appswift/resources/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /appios/appswift/ui/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import common 3 | 4 | let KTUnit = KotlinUnit() 5 | 6 | @UIApplicationMain 7 | class AppDelegate: UIResponder, UIApplicationDelegate { 8 | 9 | public lazy var dependencyManager = { 10 | DependencyManager() 11 | }() 12 | 13 | var window: UIWindow? 14 | 15 | static var me: AppDelegate { 16 | return UIApplication.shared.delegate as! AppDelegate 17 | } 18 | 19 | public func applicationDidBecomeActive(_ application: UIApplication) { 20 | //let logger = dependencyManager.logger 21 | } 22 | 23 | public func applicationWillTerminate(_ application: UIApplication) { 24 | // TODO: save context 25 | } 26 | 27 | } 28 | 29 | func dependencies() -> DependencyManager { 30 | return AppDelegate.me.dependencyManager 31 | } 32 | -------------------------------------------------------------------------------- /appios/appswift/ui/DependencyManager.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import common 3 | 4 | class DependencyManager: NSObject { 5 | 6 | public lazy var githubRepository : GithubRepository = { 7 | return GithubRepositoryImpl(logger: logger) 8 | }() 9 | 10 | public lazy var uiContext : KotlinCoroutineContext = { 11 | UI() 12 | }() 13 | 14 | func githubPresenter() -> GithubPresenter { 15 | return GithubPresenter( 16 | uiContext: uiContext, 17 | repository: githubRepository 18 | ) 19 | } 20 | 21 | public lazy var logger : PlatformLogger = { 22 | PlatformLoggerIos() 23 | }() 24 | 25 | } 26 | -------------------------------------------------------------------------------- /appios/appswift/ui/GithubViewController.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import common 3 | 4 | class GithubViewController: UIViewController, GithubView, UITableViewDataSource { 5 | 6 | @IBOutlet weak var progressView: UIActivityIndicatorView! 7 | 8 | @IBOutlet weak var tableView: UITableView! 9 | @IBOutlet weak var progress: UIActivityIndicatorView! 10 | @IBOutlet weak var userSearch: UITextField! 11 | 12 | private var repos: [Repository] = [] 13 | @IBOutlet weak var image: UIImageView! 14 | @IBOutlet weak var userName: UILabel! 15 | @IBOutlet weak var company: UILabel! 16 | 17 | lazy var presenter: GithubPresenter = { 18 | dependencies().githubPresenter() 19 | }() 20 | 21 | @IBAction func searchUserName(_ sender: Any) { 22 | userSearch.resignFirstResponder() 23 | self.presenter.loadUser(name: userSearch.text!) 24 | } 25 | 26 | var isLoading = false { 27 | didSet { 28 | if(isLoading) { 29 | progressView.isHidden = false 30 | } else { 31 | progressView.isHidden = true 32 | } 33 | } 34 | } 35 | 36 | override func viewDidLoad() { 37 | self.tableView.dataSource = self 38 | presenter.bind(view: self) 39 | } 40 | 41 | override func viewWillDisappear(_ animated: Bool) { 42 | presenter.unbind() 43 | } 44 | 45 | func displayUser(user: UserModel) { 46 | self.userName.text = user.name 47 | self.company.text = user.company 48 | 49 | self.image.sd_setImage(with: URL(string: user.avatar_url), placeholderImage: UIImage(named: "user_default")) 50 | self.image.layer.cornerRadius = self.image.frame.size.width/2 51 | self.image.clipsToBounds = true 52 | } 53 | 54 | 55 | func showError(error: KotlinThrowable) { 56 | dependencies().logger.logException(tag: "TAG", text: error.message!, exception: error as! KotlinException) 57 | } 58 | 59 | func displayRepos(repos: [Repository]) { 60 | //dependencies().logger.log(tag: "TAG", text: repos.description) 61 | self.repos = repos 62 | self.tableView.reloadData() 63 | } 64 | 65 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 66 | return repos.count 67 | } 68 | 69 | public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 70 | let cell = tableView.dequeueReusableCell(withIdentifier: "RepoCell") as! RepoCell 71 | cell.bindRepo(repos[indexPath.row]) 72 | return cell 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /appios/appswift/ui/PlatformLoggerIos.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import common 3 | 4 | class PlatformLoggerIos: NSObject, PlatformLogger { 5 | func logException(tag: String, text: String, exception: KotlinThrowable?) { 6 | print(text) 7 | } 8 | 9 | func log(tag: String, text: String) { 10 | print(text) 11 | } 12 | 13 | 14 | } 15 | -------------------------------------------------------------------------------- /appios/appswift/ui/RepoCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RepoCell.swift 3 | // appswift 4 | // 5 | // Created by florent champigny on 12/11/2018. 6 | // Copyright © 2018 Yan Zhulanow. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | import common 12 | 13 | class RepoCell: UITableViewCell { 14 | 15 | @IBOutlet weak var labelRepo: UILabel! 16 | 17 | func bindRepo(_ repo: Repository){ 18 | labelRepo.text = repo.name 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /appios/appswift/ui/UI.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UIKit 3 | import common 4 | import SDWebImage 5 | 6 | public class UI: Kotlinx_coroutines_core_nativeCoroutineDispatcher { 7 | override public func dispatch(context: KotlinCoroutineContext, block: Kotlinx_coroutines_core_nativeRunnable) { 8 | DispatchQueue.main.async { 9 | block.run() 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /appios/appwiftTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /appios/appwiftTests/appswiftTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // konfswiftTests.swift 3 | // konfswiftTests 4 | // 5 | // Created by Yan Zhulanow on 20/09/2017. 6 | // Copyright © 2017 Yan Zhulanow. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import appswift 11 | 12 | class konfswiftTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | // Use XCTAssert and related functions to verify your tests produce the correct results. 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measure { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /appios/konfswift.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /appios/konfswift.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /appios/konfswift.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | allprojects { 2 | buildscript { 3 | repositories { 4 | maven { url "http://kotlin.bintray.com/kotlin-eap" } 5 | maven { url "http://kotlin.bintray.com/kotlin-dev" } 6 | maven { url "https://kotlin.bintray.com/kotlinx" } 7 | maven { url 'https://dl.bintray.com/jetbrains/kotlin-native-dependencies' } 8 | 9 | google() 10 | jcenter() 11 | } 12 | dependencies { 13 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 14 | classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" 15 | } 16 | } 17 | repositories { 18 | maven { url "http://kotlin.bintray.com/kotlin-eap" } 19 | maven { url "http://kotlin.bintray.com/kotlin-dev" } 20 | maven { url "https://kotlin.bintray.com/kotlinx" } 21 | maven { url "https://dl.bintray.com/kotlin/ktor" } 22 | maven { url "https://dl.bintray.com/sargunster/maven" } 23 | maven { url "https://dl.bintray.com/kotlin/squash" } 24 | maven { url = 'https://dl.bintray.com/russhwolf/multiplatform-settings' } 25 | 26 | google() 27 | jcenter() 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /common/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'kotlin-multiplatform' 2 | apply plugin: 'kotlinx-serialization' 3 | 4 | kotlin { 5 | targets { 6 | fromPreset(presets.jvm, 'jvm') 7 | 8 | // Change to `presets.iosArm64` to deploy the app to iPhone 9 | fromPreset(presets.iosX64, 'ios') { 10 | compilations.main.outputKinds('FRAMEWORK') 11 | } 12 | } 13 | sourceSets { 14 | commonMain { 15 | dependencies { 16 | implementation 'org.jetbrains.kotlin:kotlin-stdlib' 17 | implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-common:$coroutines_version" 18 | implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:$serialization_version" 19 | 20 | implementation "io.ktor:ktor-client-core:$ktor_version" 21 | implementation "io.ktor:ktor-client-json:$ktor_version" 22 | } 23 | } 24 | commonTest { 25 | dependencies { 26 | implementation "org.jetbrains.kotlin:kotlin-test-common" 27 | implementation "org.jetbrains.kotlin:kotlin-test-annotations-common" 28 | } 29 | } 30 | jvmMain { 31 | dependencies { 32 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" 33 | implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version" 34 | 35 | implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime:$serialization_version" 36 | 37 | implementation "io.ktor:ktor-client-core-jvm:$ktor_version" 38 | implementation "io.ktor:ktor-client-json-jvm:$ktor_version" 39 | } 40 | } 41 | jvmTest { 42 | dependencies { 43 | implementation 'org.jetbrains.kotlin:kotlin-test' 44 | implementation 'org.jetbrains.kotlin:kotlin-test-junit' 45 | } 46 | } 47 | iosMain { 48 | dependencies { 49 | implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-native:$coroutines_version" 50 | implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:$serialization_version" 51 | 52 | implementation "io.ktor:ktor-client-ios:$ktor_version" 53 | implementation "io.ktor:ktor-client-core-ios:$ktor_version" 54 | implementation "io.ktor:ktor-client-json-ios:$ktor_version" 55 | } 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /common/src/commonMain/kotlin/com/github/florent37/kotlinnative/api/ExpectSuccess.kt: -------------------------------------------------------------------------------- 1 | package com.github.florent37.kotlinnative.api 2 | 3 | import io.ktor.client.* 4 | import io.ktor.client.features.* 5 | import io.ktor.client.response.* 6 | import io.ktor.http.* 7 | import io.ktor.util.* 8 | 9 | object ExpectSuccess : HttpClientFeature { 10 | override val key: AttributeKey = AttributeKey("ExpectSuccess") 11 | 12 | override fun prepare(block: Unit.() -> Unit): ExpectSuccess = this 13 | 14 | override fun install(feature: ExpectSuccess, scope: HttpClient) { 15 | scope.responsePipeline.intercept(HttpResponsePipeline.Receive) { 16 | val response = subject.response as HttpResponse 17 | if (!response.status.isSuccess()) throw ApiException(response) 18 | proceedWith(subject) 19 | } 20 | } 21 | } 22 | 23 | class ApiException(val response: HttpResponse) : Throwable() 24 | -------------------------------------------------------------------------------- /common/src/commonMain/kotlin/com/github/florent37/kotlinnative/api/GithubApi.kt: -------------------------------------------------------------------------------- 1 | package com.github.florent37.kotlinnative.api 2 | 3 | import io.ktor.client.* 4 | import io.ktor.client.call.TypeInfo 5 | import kotlinx.serialization.* 6 | import kotlinx.serialization.json.* 7 | import io.ktor.client.features.json.* 8 | import io.ktor.client.features.json.serializer.* 9 | import io.ktor.client.request.* 10 | import io.ktor.client.response.* 11 | import io.ktor.http.* 12 | import io.ktor.http.content.OutgoingContent 13 | import io.ktor.http.content.TextContent 14 | import kotlinx.io.core.* 15 | import kotlinx.serialization.KSerializer 16 | import kotlinx.serialization.json.JSON 17 | import com.github.florent37.kotlinnative.data.* 18 | import com.github.florent37.kotlinnative.log.PlatformLogger 19 | import com.github.florent37.kotlinnative.api.ExpectSuccess 20 | import kotlin.reflect.KClass 21 | 22 | class GithubApi(val logger: PlatformLogger) { 23 | 24 | val endPoint = "https://api.github.com/users/" 25 | 26 | private val client = HttpClient { 27 | install(JsonFeature) { 28 | serializer = JsonKotlinxSerializer().apply { 29 | setMapper(UserJSON.serializer()) 30 | } 31 | } 32 | install(ExpectSuccess) 33 | } 34 | 35 | suspend fun getUser(name: String): UserJSON = client.get { 36 | url { 37 | takeFrom(endPoint) 38 | path("users", name) 39 | } 40 | } 41 | 42 | suspend fun getUserRepos(name: String): List = client.request { 43 | method = HttpMethod.Get 44 | url { 45 | takeFrom(endPoint) 46 | path("users", name, "repos") 47 | } 48 | }.use { response -> 49 | val json = response.readText() 50 | 51 | logger.log("JSON", json) 52 | val list = JSON.nonstrict.parse(Repository.serializer().list,json) 53 | 54 | logger.log("JSON", "deserialized !!!!") 55 | 56 | return@use list 57 | } 58 | } -------------------------------------------------------------------------------- /common/src/commonMain/kotlin/com/github/florent37/kotlinnative/api/JsonKotlinxSerializer.kt: -------------------------------------------------------------------------------- 1 | package com.github.florent37.kotlinnative.api 2 | 3 | import io.ktor.client.call.TypeInfo 4 | import io.ktor.client.features.json.JsonSerializer 5 | import io.ktor.client.response.HttpResponse 6 | import io.ktor.client.response.readText 7 | import io.ktor.http.ContentType 8 | import io.ktor.http.content.OutgoingContent 9 | import io.ktor.http.content.TextContent 10 | import kotlinx.serialization.KSerializer 11 | import kotlinx.serialization.json.JSON 12 | import com.github.florent37.kotlinnative.data.Repository 13 | import kotlin.reflect.KClass 14 | 15 | class JsonKotlinxSerializer : JsonSerializer { 16 | val mappers = mutableMapOf, KSerializer>() 17 | 18 | /** 19 | * Set mapping from [type] to generated [KSerializer]. 20 | */ 21 | //fun setMapper(type: KClass, serializer: KSerializer) { 22 | // mappers[type as KClass] = serializer as KSerializer 23 | //} 24 | 25 | inline fun setMapper(serializer: KSerializer) { 26 | mappers[T::class as KClass] = serializer as KSerializer 27 | } 28 | 29 | override fun write(data: Any): OutgoingContent { 30 | @Suppress("UNCHECKED_CAST") 31 | val content = JSON.nonstrict.stringify(mappers[data::class]!!, data) 32 | return TextContent(content, ContentType.Application.Json) 33 | } 34 | 35 | override suspend fun read(type: TypeInfo, response: HttpResponse): Any { 36 | val mapper = mappers[type.type]!! 37 | val text = response.readText() 38 | 39 | return JSON.nonstrict.parse(mapper, text) 40 | } 41 | } -------------------------------------------------------------------------------- /common/src/commonMain/kotlin/com/github/florent37/kotlinnative/data/GithubRepositoryImpl.kt: -------------------------------------------------------------------------------- 1 | package com.github.florent37.kotlinnative.data 2 | 3 | import io.ktor.client.call.* 4 | import kotlinx.serialization.* 5 | import kotlinx.serialization.json.* 6 | import com.github.florent37.kotlinnative.* 7 | import com.github.florent37.kotlinnative.api.* 8 | import com.github.florent37.kotlinnative.data.* 9 | import com.github.florent37.kotlinnative.log.PlatformLogger 10 | import com.github.florent37.kotlinnative.presentation.* 11 | import com.github.florent37.kotlinnative.storage.* 12 | import kotlin.properties.* 13 | import kotlin.properties.Delegates.observable 14 | 15 | class GithubRepositoryImpl(logger: PlatformLogger) : GithubRepository { 16 | 17 | private val api = GithubApi(logger) 18 | 19 | override suspend fun getUser(name: String): UserJSON? = 20 | api.getUser(name) 21 | 22 | //not working on iOS 23 | override suspend fun getUserRepos(userName: String): List? = 24 | api.getUserRepos(userName) 25 | 26 | init { 27 | } 28 | } -------------------------------------------------------------------------------- /common/src/commonMain/kotlin/com/github/florent37/kotlinnative/data/Repository.kt: -------------------------------------------------------------------------------- 1 | package com.github.florent37.kotlinnative.data 2 | 3 | import kotlinx.serialization.Serializable 4 | 5 | @Serializable 6 | data class Repository(val name: String, val id: Int) -------------------------------------------------------------------------------- /common/src/commonMain/kotlin/com/github/florent37/kotlinnative/data/UserJSON.kt: -------------------------------------------------------------------------------- 1 | package com.github.florent37.kotlinnative.data 2 | 3 | import kotlinx.serialization.Serializable 4 | 5 | @Serializable 6 | data class UserJSON ( 7 | val login: String, 8 | val id: Int, 9 | val name: String, 10 | val avatar_url: String, 11 | val company: String 12 | ) 13 | -------------------------------------------------------------------------------- /common/src/commonMain/kotlin/com/github/florent37/kotlinnative/log/Logger.kt: -------------------------------------------------------------------------------- 1 | package com.github.florent37.kotlinnative.log 2 | 3 | interface PlatformLogger { 4 | 5 | fun logException(tag: String, text: String, exception: Throwable?) { 6 | 7 | } 8 | 9 | fun log(tag: String, text: String) { 10 | 11 | } 12 | } -------------------------------------------------------------------------------- /common/src/commonMain/kotlin/com/github/florent37/kotlinnative/model/UserModel.kt: -------------------------------------------------------------------------------- 1 | package com.github.florent37.kotlinnative.model 2 | 3 | class UserModel( 4 | val name: String, 5 | val avatar_url: String, 6 | val company: String 7 | ) -------------------------------------------------------------------------------- /common/src/commonMain/kotlin/com/github/florent37/kotlinnative/presentation/BaseView.kt: -------------------------------------------------------------------------------- 1 | package com.github.florent37.kotlinnative.presentation 2 | 3 | interface BaseView { 4 | fun showError(error: Throwable) 5 | } -------------------------------------------------------------------------------- /common/src/commonMain/kotlin/com/github/florent37/kotlinnative/presentation/GithubPresenter.kt: -------------------------------------------------------------------------------- 1 | package com.github.florent37.kotlinnative.presentation 2 | 3 | import kotlinx.coroutines.launch 4 | import com.github.florent37.kotlinnative.* 5 | import com.github.florent37.kotlinnative.data.Repository 6 | import com.github.florent37.kotlinnative.model.UserModel 7 | import kotlinx.coroutines.GlobalScope 8 | import kotlin.coroutines.* 9 | 10 | class GithubPresenter( 11 | private val uiContext: CoroutineContext, 12 | private val repository: GithubRepository 13 | ) { 14 | 15 | private var view: GithubView? = null 16 | 17 | fun bind(view: GithubView){ 18 | this.view = view 19 | } 20 | 21 | fun unbind() { 22 | view = null 23 | } 24 | 25 | fun loadUser(name: String) { 26 | view?.isLoading = true 27 | GlobalScope.launch(uiContext) { 28 | try { 29 | repository.getUser(name)?.let { user -> 30 | val userModel = UserModel( 31 | user.name, 32 | user.avatar_url, 33 | user.company 34 | ) 35 | view?.displayUser(userModel) 36 | } 37 | }catch (e: Exception){ 38 | view?.showError(e) 39 | } 40 | try { 41 | repository.getUserRepos(name)?.let { repositories -> 42 | view?.displayRepos(repositories) 43 | } 44 | }catch (e: Exception){ 45 | view?.showError(e) 46 | } 47 | view?.isLoading = false 48 | } 49 | } 50 | 51 | fun onRepoClicked(repo: Repository){ 52 | 53 | } 54 | } -------------------------------------------------------------------------------- /common/src/commonMain/kotlin/com/github/florent37/kotlinnative/presentation/GithubRepository.kt: -------------------------------------------------------------------------------- 1 | package com.github.florent37.kotlinnative.presentation 2 | 3 | import com.github.florent37.kotlinnative.data.* 4 | 5 | interface GithubRepository { 6 | suspend fun getUser(name: String): UserJSON? 7 | suspend fun getUserRepos(userName: String): List? 8 | } 9 | -------------------------------------------------------------------------------- /common/src/commonMain/kotlin/com/github/florent37/kotlinnative/presentation/GithubView.kt: -------------------------------------------------------------------------------- 1 | package com.github.florent37.kotlinnative.presentation 2 | 3 | import com.github.florent37.kotlinnative.* 4 | import com.github.florent37.kotlinnative.data.Repository 5 | import com.github.florent37.kotlinnative.model.UserModel 6 | 7 | interface GithubView : BaseView { 8 | var isLoading: Boolean 9 | 10 | fun displayUser(user: UserModel) 11 | fun displayRepos(repos: List) 12 | } 13 | -------------------------------------------------------------------------------- /common/src/commonMain/kotlin/com/github/florent37/kotlinnative/storage/Settings.kt: -------------------------------------------------------------------------------- 1 | package com.github.florent37.kotlinnative.storage 2 | 3 | interface Settings { 4 | fun putBoolean(key: String, value: Boolean) 5 | fun getBoolean(key: String, defaultValue: Boolean): Boolean 6 | fun putString(key: String, value: String) 7 | fun getString(key: String, defaultValue: String = ""): String 8 | } -------------------------------------------------------------------------------- /common/src/commonTest/kotlin/DateTest.kt: -------------------------------------------------------------------------------- 1 | package org.jetbrains.kotlinconf 2 | 3 | import kotlin.test.* 4 | 5 | class DateTest { 6 | @Test 7 | fun testMethod() { 8 | 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /common/src/iosMain/kotlin/com/github/florent37/kotlinnative/PlatformSettings.kt: -------------------------------------------------------------------------------- 1 | package com.github.florent37.kotlinnative.storage 2 | 3 | import platform.Foundation.* 4 | 5 | class PlatformSettings : Settings { 6 | private val delegate: NSUserDefaults = NSUserDefaults.standardUserDefaults() 7 | 8 | override fun putString(key: String, value: String) { 9 | delegate.setObject(value, key) 10 | } 11 | 12 | override fun getString(key: String, defaultValue: String): String = 13 | delegate.stringForKey(key) ?: defaultValue 14 | 15 | override fun putBoolean(key: String, value: Boolean) { 16 | delegate.setBool(value, key) 17 | } 18 | 19 | override fun getBoolean(key: String, defaultValue: Boolean): Boolean = 20 | if (hasKey(key)) delegate.boolForKey(key) else defaultValue 21 | 22 | fun hasKey(key: String): Boolean = delegate.objectForKey(key) != null 23 | } -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # gradle 2 | org.gradle.jvmargs=-Xmx1536m 3 | org.gradle.parallel=true 4 | # kotlin 5 | kotlin_version=1.3.0 6 | kotlin.incremental.multiplatform = true 7 | # kotlin libraries 8 | coroutines_version=1.0.0 9 | #0.26.0-rc13 10 | 11 | ktor_version=1.0.0-beta-3 12 | #0.9.6-alpha-1-rc13 13 | serialization_version=0.9.0 14 | # android 15 | INCLUDE_ANDROID=true 16 | gradle_android_version=3.1.3 17 | anko_version=0.10.5 18 | # backend 19 | squash_version=0.2.3 20 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/florent37/KotlinNativeSample/fca6abf35ea759cecaa887ab52dcf5b8696f64b8/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Dec 28 10:00:20 PST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /medias/android_code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/florent37/KotlinNativeSample/fca6abf35ea759cecaa887ab52dcf5b8696f64b8/medias/android_code.png -------------------------------------------------------------------------------- /medias/iphone_android.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/florent37/KotlinNativeSample/fca6abf35ea759cecaa887ab52dcf5b8696f64b8/medias/iphone_android.png -------------------------------------------------------------------------------- /medias/xcode_code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/florent37/KotlinNativeSample/fca6abf35ea759cecaa887ab52dcf5b8696f64b8/medias/xcode_code.png -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'kotlinnative-app' 2 | 3 | enableFeaturePreview('GRADLE_METADATA') 4 | 5 | //include 'backend' 6 | include 'common' 7 | 8 | if (INCLUDE_ANDROID == "true") { 9 | include 'android', 'android:app' 10 | } 11 | --------------------------------------------------------------------------------