This file contains hidden or 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
class CustomCollectionViewCell: UICollectionViewCell{ | |
override var isSelected: Bool{ | |
//Write your code for cell selection here | |
} | |
} |
This file contains hidden or 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
override var isSelected: Bool{ | |
didSet{ | |
} | |
} |
This file contains hidden or 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
override var isSelected: Bool{ | |
didSet{ | |
if self.isSelected | |
{ | |
//This block will be executed whenever the cell’s selection state is set to true (i.e For the selected cell) | |
} | |
else | |
{ | |
//This block will be executed whenever the cell’s selection state is set to false (i.e For the rest of the cells) | |
} |
This file contains hidden or 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
override var isSelected: Bool{ | |
didSet{ | |
if self.isSelected | |
{ | |
self.transform = CGAffineTransform(scaleX: 1.1, y: 1.1) | |
self.contentView.backgroundColor = UIColor.red | |
self.tickImageView.isHidden = false | |
} | |
else | |
{ |
This file contains hidden or 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
var sharedContainer = UserDefaults(suiteName: "YOUR_GROUP_NAME") |
This file contains hidden or 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
override func viewDidLoad() | |
{ | |
super.viewDidLoad() | |
self.extensionContext?.widgetLargestAvailableDisplayMode = .expanded | |
} |
This file contains hidden or 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
func widgetPerformUpdate(completionHandler: @escaping (NCUpdateResult) -> Swift.Void) | |
{ | |
completionHandler(.newData) | |
} |
This file contains hidden or 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
func widgetActiveDisplayModeDidChange(_ activeDisplayMode: NCWidgetDisplayMode, withMaximumSize maxSize: CGSize) | |
{ | |
if activeDisplayMode == .expanded | |
{ | |
preferredContentSize = CGSize(width: 0.0, height: 300.0) | |
} | |
else | |
{ | |
preferredContentSize = maxSize | |
} |
This file contains hidden or 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
self.extensionContext?.open(URL(string: "YOUR_URL_SCHEME://")!, completionHandler: nil) |
This file contains hidden or 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
func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool | |
{ | |
if url.scheme == "YOUR_URL_SCHEME" | |
{ | |
//TODO: Write your code here | |
} | |
return true | |
} |
OlderNewer