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
# Xcode | |
*/build/* | |
build/ | |
profile | |
*.moved-aside | |
DerivedData | |
.idea/ | |
*.hmap | |
*.xcuserstate | |
*.xccheckout |
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() | |
lf_actionReload() | |
} | |
override func lf_actionReload() { | |
var array: Array<LTDictStrObj> = [ [ | |
"title": "Title 1", | |
"desc": "Description", | |
], [ |
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
let obj = PFObject(className: "sg_text") | |
obj.setObject(text_view!.text, forKey: SG.const.text) | |
MBProgressHUD.show("Analyzing...", view:view) | |
obj.saveInBackgroundWithBlock({ | |
(success: Bool?, error: NSError?) in | |
MBProgressHUD.hideAllHUDsForView(self.view, animated:true) | |
if error == nil { | |
LF.log("TEXT saved", obj) | |
} else { | |
MBProgressHUD.show(error!.localizedDescription, view:self.view, duration:2) |
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 ICSearchController: LFTableController { | |
var source_search: LFTableDataSource! | |
//@IBOutlet var search_controller: UISearchDisplayController! | |
//@IBOutlet var search_bar: UISearchBar! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
reload_featured() | |
reload_search() |
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
@IBAction func action_report() { | |
let composer = SVMailComposer() | |
composer.present(self, subject:SV.s.report_user_title, body:SV.s.report_user_body) | |
} | |
class SVMailComposer: MFMailComposeViewController, MFMailComposeViewControllerDelegate { | |
func present(controller: UIViewController, subject: String, body: String) { | |
if MFMailComposeViewController.canSendMail() { | |
mailComposeDelegate = self | |
setToRecipients(["[email protected]"]) |
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
/// TODO: is something like Loggable.Console / Loggable.File possible in Swift - single namespace inside a target? | |
// A console logger | |
protocol ConsoleLoggable { | |
var clogger: ConsoleLoggerProtocol { get } | |
} | |
extension ConsoleLoggable { | |
var clogger: ConsoleLoggerProtocol { |
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
// To maintain state of extension computed property, use static variable | |
// A console logger | |
protocol ConsoleLoggable { | |
var logger: ConsoleLoggerProtocol { get } | |
} | |
extension ConsoleLoggable { | |
var logger: ConsoleLoggerProtocol { |
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
protocol ProductionFeatureProtocol: TestFeature1, TestFeature2 { | |
} | |
struct DefaultProductionFeature: ProductionFeatureProtocol { | |
} | |
protocol TestFeature1 { | |
func testOnly1() |
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
struct TestStruct { | |
static var staticVar = 1 | |
static func staticFunc() { | |
staticVar = 2 | |
} | |
} |
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
protocol PureEnumProtocol { | |
func test() | |
} | |
enum PureEnum: PureEnumProtocol { | |
static var v = 1 // Still possible | |
//var v = 1 // Enums must not contain stored properties | |
func test() { | |
//v = 2 // Impossible |
OlderNewer