Programming (126) 썸네일형 리스트형 Class: NSManagedObject A base class that implements the behavior required of a Core Data model object. Declaration class NSManagedObject : NSObject Overview A managed object is associated with an entity description (NSEntityDescription) that provides metadata about the object, including the name of the entity that the object represents and the names of its attributes and relationships. A managed object is also associa.. Class: UserDefaults Declaration class UserDefaults : NSObject Overview The UserDefaults class provides a programmatic interface for interacting with the defaults system. The defaults system allows an app to customize its behavior to match a user’s preferences. For example, you can allow users to specify their preferred units of measurement or media playback speed. Apps store these preferences by assigning values to.. Class: JSONSerialization An object that converts between JSON and the equivalent Foundation objects. Declaration class JSONSerialization : NSObject Overview You use the JSONSerialization class to convert JSON to Foundation objects and convert Foundation objects to JSON. A Foundation object that may be converted to JSON must have the following properties: The top level object is an NSArray or NSDictionary. All objects ar.. Instance Method: dataTask(with:completionHandler:) Creates a task that retrieves the contents of the specified URL, then calls a handler upon completion. Declaration func dataTask(with url: URL, completionHandler: @escaping (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask The dataTask method passed back 3 values, all of which are optional - Data?, URLResponse?, and Error?. developer.apple.com/documentation/foundation/urlsession/14103.. NSError & CocoaError Information about an error condition including a domain, a domain-specific error code, and application-specific information. Declaration class NSError : NSObject Overview Objective-C methods can signal an error condition by returning an NSError object by reference, which provides additional information about the kind of error and any underlying cause, if one can be determined. An NSError object .. Error Declaration protocol Error Overview Any type that declares conformance to the Error protocol can be used to represent an error in Swift’s error handling system. Because the Error protocol has no requirements of its own, you can declare conformance on any custom type you create. Describing an Error var localizedDescription: String Retrieve the localized description for this error. developer.apple.. Protocols A protocol defines a blueprint of methods, properties, and other requirements that suit a particular task or piece of functionality. The protocol can then be adopted by a class, structure, or enumeration to provide an actual implementation of those requirements. Any type that satisfies the requirements of a protocol is said to conform to that protocol. In addition to specifying requirements that.. When to Use Inheritance Inheritance is a useful programming concept, but it is easy to use inappropriately. Often interfaces do the job better. This topic and When to Use Interfaces help you understand when each approach should be used. Inheritance is a good choice when: Your inheritance hierarchy represents an "is-a" relationship and not a "has-a" relationship. You can reuse code from the base classes. You need to app.. Class: UIPickerView A view that uses a spinning-wheel or slot-machine metaphor to show one or more sets of values. Declaration class UIPickerView : UIView Overview A picker view displays one or more wheels that the user manipulates to select items. Each wheel—known as a component—has a series of indexed rows representing the selectable items. Each row displays a string or view so that the user can identify the item.. Class: URLSession An object that coordinates a group of related, network data-transfer tasks. Declaration class URLSession : NSObject Overview The URLSession class and related classes provide an API for downloading data from and uploading data to endpoints indicated by URLs. Your app can also use this API to perform background downloads when your app isn’t running or, in iOS, while your app is suspended. You can .. 이전 1 2 3 4 5 6 7 ··· 13 다음