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
extension Encodable { | |
subscript(key: String) -> Any? { | |
return dictionary[key] | |
} | |
var data: Data { | |
return try! JSONEncoder().encode(self) | |
} | |
var dictionary: [String: Any] { | |
return (try? JSONSerialization.jsonObject(with: data)) as? [String: Any] ?? [:] | |
} |
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
"TicketApp" : { | |
"CustomScheme": { | |
"URL": { | |
"htpps://ticket.interpark.com/Genre/GenreHome":{ | |
"ParsingType":"hasPrefix", | |
"Title":"장르", | |
"Type":"URL_Load", | |
"LoadClass":"TicketGenreViewController", | |
"BottomMenu":{ | |
"Animation":true |
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
TestSwift * testSwift = [[TestSwift alloc] init]; | |
[testSwift PrintString]; | |
NSLog(@"결과값 : %d",[testSwift addX:2 Y:3]); |
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
import UIKit | |
class TestSwift: NSObject { | |
@objc(PrintString) | |
func PrintString() { | |
print("Test Swift is Working") | |
} | |
@objc(addX:Y:) | |
func add(x: Int, y: Int) -> Int { |
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
#import <Foundation/Foundation.h> | |
@protocol CustomAddProtocol <NSObject> | |
- (id)addValue:(id)value; | |
@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
#import <Foundation/Foundation.h> | |
#import "CustomAddProtocol.h" | |
@interface CustomNumberClass : NSObject<CustomAddProtocol> | |
@property (nonatomic,retain) NSNumber * value; | |
- (instancetype)initWithInteger:(NSInteger)value; | |
- (id)addValue:(id)value; | |
@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
#import <Foundation/Foundation.h> | |
@interface StackClass<T:id<CustomAddProtocol>> : NSObject | |
@property (nonatomic,retain) NSMutableArray *items; | |
- (void)push:(T)value; | |
- (T)pop; | |
@end | |
#import "StackClass.h" |
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
CustomNumberClass * numberA = [[CustomNumberClass alloc] initWithInteger:10]; | |
CustomNumberClass * numberB = [[CustomNumberClass alloc] initWithInteger:20]; | |
StackClass<CustomNumberClass *> * stack = [[StackClass alloc]init]; | |
[stack push:numberA]; | |
[stack push:numberB]; | |
NSLog(@"%@",stack.items); | |
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
#import <Foundation/Foundation.h> | |
@interface StackClass<T> : NSObject | |
@property (nonatomic,retain) NSMutableArray *items; | |
- (void)push:(T)value; | |
- (T)pop; | |
@end | |
#import "StackClass.h" |
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
/* | |
MPMoviePlayerViewController의 경우 iOS 9.0에서 DEPRECATED 되었다. | |
하지만 동작엔 문제가 없다가 실제로 iOS 11.3에서 동작이 안되게 되었기에 문제가 발생하게 되었다. | |
MPMoviePlayerViewController 대신 AVPlayer와 AVPlayerViewController를 사용해 수정해 줘야 한다. | |
*/ | |
#import <AVFoundation/AVFoundation.h> | |
#import <AVKit/AVKit.h> |
NewerOlder