This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// AppStoryboards.swift | |
// AppStoryboards | |
// | |
// Created by Gurdeep on 15/12/16. | |
// Copyright © 2016 Gurdeep. All rights reserved. | |
// | |
import Foundation | |
import UIKit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%hook UserManager | |
-(BOOL)isLoggedIn{ | |
return true; | |
} | |
%end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface UserManager : NSObject | |
-(BOOL)isLoggedIn; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%hook HomeViewController | |
-(void)viewDidLoad{ | |
%orig; | |
UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"My Alert" | |
message:@"This is an injected alert." | |
preferredStyle:UIAlertControllerStyleAlert]; | |
[self presentViewController:alert animated:YES completion:nil]; | |
} | |
%end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation HomeViewController | |
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
[self loadNetworkData]; | |
} | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct MyStruct: Codable { | |
let price: Int? | |
init(from decoder: Decoder) throws { | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
if let intPrice = try? container.decode(Int?.self, forKey: .price){ | |
self.price = intPrice | |
} else if let stringPrice = try? container.decode(String.self, forKey: .price){ | |
self.price = Int(stringPrice) ?? nil | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// AnimationsFactory.swift | |
// instapay | |
// | |
// Created by Osama on 6/6/20. | |
// Copyright © 2020 Osama Gamal. All rights reserved. | |
// | |
import Foundation | |
import UIKit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct BaseResponse<T: Codable>: Codable { | |
var status: Bool? | |
var message: String? | |
var data: T | |
required init(from decoder:Decoder) throws { | |
let values = try decoder.container(keyedBy: CodingKeys.self) | |
//MARK: Decode all types of messages (message_ar, message, error) |