Skip to content

Instantly share code, notes, and snippets.

View pramod-kumar-ios's full-sized avatar

Pramod Kumar pramod-kumar-ios

View GitHub Profile
@pramod-kumar-ios
pramod-kumar-ios / CustomButton.swift
Created May 3, 2020 12:56
Custom class inherited from UIButton, used to achieve UIButton's frames changing while resizing content size.
//
// CustomButton.swift
// AccessibilityDemo
//
// Created by Pramod Kumar on 03/05/20.
// Copyright © 2020 Pramod Kumar. All rights reserved.
//
import UIKit
BUILD_APP_DIR=${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app
if [ "$CONFIGURATION" == "Release" ]; then
rm -Rf $BUILD_APP_DIR/Settings.bundle
fi
import Foundation
enum Environment: String {
case production
case testing
case development
}
class PKSettingsBundleHelper {
static let shared = PKSettingsBundleHelper()
import SwiftUI
struct NewsRowV : View {
let artical: Artical
var body: some View {
HStack {
Image("ic_news_placeholder")
.frame(width: 55.0, height: 41.0, alignment: Alignment.center)
import SwiftUI
struct NewsDetailV : View {
let artical: Artical
private let imageWidth: CGFloat = (UIDevice.screenWidth-30.0)
var body: some View {
VStack(alignment: .center) {
import SwiftUI
import Combine
class MainHomeVM: BindableObject {
var articals: [Artical] = [] {
didSet {
didChange.send(self)
}
}
import SwiftUI
struct MainHomeV : View {
@State private var searchQuery: String = "cricket"
@EnvironmentObject var viewModel: MainHomeVM
var todayStr: String {
Date().toString(dateFormat: "EEE, dd MMM yyyy")
}
let defaultText: String = "N/A"
struct Article: Hashable {
var sourceId: String = defaultText
var sourceName: String = defaultText
var author: String = defaultText
var title: String = defaultText
var description: String = defaultText
var url: String = defaultText
var urlToImage: String = defaultText
@pramod-kumar-ios
pramod-kumar-ios / PKIAPHandler.swift
Created August 7, 2018 08:34
A handler class that will help you to integrate the In App Purchase (IAP) in you iPhone, iPad, iPod application developed with Swift language.
//
// PKIAPHandler.swift
//
// Created by Pramod Kumar on 13/07/2017.
// Copyright © 2017 Pramod Kumar. All rights reserved.
//
import UIKit
import StoreKit
enum PKIAPHandlerAlertType {