Skip to content

Instantly share code, notes, and snippets.

View bestiosdeveloper's full-sized avatar

Pramod Kumar bestiosdeveloper

View GitHub Profile
@bestiosdeveloper
bestiosdeveloper / 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 {
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
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")
}
import SwiftUI
import Combine
class MainHomeVM: BindableObject {
var articals: [Artical] = [] {
didSet {
didChange.send(self)
}
}
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
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 Foundation
enum Environment: String {
case production
case testing
case development
}
class PKSettingsBundleHelper {
static let shared = PKSettingsBundleHelper()
BUILD_APP_DIR=${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app
if [ "$CONFIGURATION" == "Release" ]; then
rm -Rf $BUILD_APP_DIR/Settings.bundle
fi
@bestiosdeveloper
bestiosdeveloper / 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
//
// CodableExtensionExample.swift
//
// Created by Pramod Kumar on 05/15/20.
// Copyright © 2020 Swift Commmunity. All rights reserved.
//
import UIKit
let json = """