#WITHYOU
Lum7671's Weblog
#WITHYOU

iOS Memo

기억하고 싶은 iOS 메모

참고

UITableView Performance

Cells and Table View Performance

The proper use of table view cells, whether off-the-shelf or custom cell objects, is a major factor in the performance of table views. Ensure that your application does the following three things:

  • Reuse cells. Object allocation has a performance cost, especially if the allocation has to happen repeatedly over a short period—say, when the user scrolls a table view. If you reuse cells instead of allocating new ones, you greatly enhance table view performance.
  • Avoid relayout of content. When reusing cells with custom subviews, refrain from laying out those subviews each time the table view requests a cell. Lay out the subviews once, when the cell is created.
  • Use opaque subviews. When customizing table view cells, make the subviews of the cell opaque, not transparent.

NSURLErrorDomain

    enum {
       NSURLErrorUnknown = -1,
       NSURLErrorCancelled = -999,
       NSURLErrorBadURL = -1000,
       NSURLErrorTimedOut = -1001,
       NSURLErrorUnsupportedURL = -1002,
       NSURLErrorCannotFindHost = -1003,
       NSURLErrorCannotConnectToHost = -1004,
       NSURLErrorDataLengthExceedsMaximum = -1103,
       NSURLErrorNetworkConnectionLost = -1005,
       NSURLErrorDNSLookupFailed = -1006,
       NSURLErrorHTTPTooManyRedirects = -1007,
       NSURLErrorResourceUnavailable = -1008,
       NSURLErrorNotConnectedToInternet = -1009,
       NSURLErrorRedirectToNonExistentLocation = -1010,
       NSURLErrorBadServerResponse = -1011,
       NSURLErrorUserCancelledAuthentication = -1012,
       NSURLErrorUserAuthenticationRequired = -1013,
       NSURLErrorZeroByteResource = -1014,
       NSURLErrorCannotDecodeRawData = -1015,
       NSURLErrorCannotDecodeContentData = -1016,
       NSURLErrorCannotParseResponse = -1017,
       NSURLErrorInternationalRoamingOff = -1018,
       NSURLErrorCallIsActive = -1019,
       NSURLErrorDataNotAllowed = -1020,
       NSURLErrorRequestBodyStreamExhausted = -1021,
       NSURLErrorFileDoesNotExist = -1100,
       NSURLErrorFileIsDirectory = -1101,
       NSURLErrorNoPermissionsToReadFile = -1102,
       NSURLErrorSecureConnectionFailed = -1200,
       NSURLErrorServerCertificateHasBadDate = -1201,
       NSURLErrorServerCertificateUntrusted = -1202,
       NSURLErrorServerCertificateHasUnknownRoot = -1203,
       NSURLErrorServerCertificateNotYetValid = -1204,
       NSURLErrorClientCertificateRejected = -1205,
       NSURLErrorClientCertificateRequired = -1206,
       NSURLErrorCannotLoadFromNetwork = -2000,
       NSURLErrorCannotCreateFile = -3000,
       NSURLErrorCannotOpenFile = -3001,
       NSURLErrorCannotCloseFile = -3002,
       NSURLErrorCannotWriteToFile = -3003,
       NSURLErrorCannotRemoveFile = -3004,
       NSURLErrorCannotMoveFile = -3005,
       NSURLErrorDownloadDecodingFailedMidStream = -3006,
       NSURLErrorDownloadDecodingFailedToComplete = -3007
    }

JavaScript’s console log to NSLog

  • 코드:
  @import JavaScriptCore;
  /* JavaScript Console Log */
  JSContext *ctx = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
  ctx[@"console"][@"log"] = ^(JSValue * msg) {
    NSLog(@"JavaScript %@ log message: %@", [JSContext currentContext], msg);
  };

iOS, Font 이름 목록

  • 코드:
  import UIKit

  for family in UIFont.familyNames() {
      for font in UIFont.fontNamesForFamilyName(family) {
          print("FONT NAME: \(font)")
      }
  }
  • 결과:
  FONT NAME: Copperplate-Light
  FONT NAME: Copperplate
  FONT NAME: Copperplate-Bold
  FONT NAME: IowanOldStyle-Italic
  FONT NAME: IowanOldStyle-Roman
  FONT NAME: IowanOldStyle-BoldItalic
  FONT NAME: IowanOldStyle-Bold
  FONT NAME: KohinoorTelugu-Regular
  FONT NAME: KohinoorTelugu-Medium
  FONT NAME: KohinoorTelugu-Light
  FONT NAME: Thonburi
  FONT NAME: Thonburi-Bold
  FONT NAME: Thonburi-Light
  FONT NAME: CourierNewPS-BoldMT
  FONT NAME: CourierNewPS-ItalicMT
  FONT NAME: CourierNewPSMT
  FONT NAME: CourierNewPS-BoldItalicMT
  FONT NAME: GillSans-Italic
  FONT NAME: GillSans-Bold
  FONT NAME: GillSans-BoldItalic
  FONT NAME: GillSans-LightItalic
  FONT NAME: GillSans
  FONT NAME: GillSans-Light
  FONT NAME: GillSans-SemiBold
  FONT NAME: GillSans-SemiBoldItalic
  FONT NAME: GillSans-UltraBold
  FONT NAME: AppleSDGothicNeo-Bold
  FONT NAME: AppleSDGothicNeo-Thin
  FONT NAME: AppleSDGothicNeo-UltraLight
  FONT NAME: AppleSDGothicNeo-Regular
  FONT NAME: AppleSDGothicNeo-Light
  FONT NAME: AppleSDGothicNeo-Medium
  FONT NAME: AppleSDGothicNeo-SemiBold
  FONT NAME: MarkerFelt-Thin
  FONT NAME: MarkerFelt-Wide
  FONT NAME: AvenirNextCondensed-BoldItalic
  FONT NAME: AvenirNextCondensed-Heavy
  FONT NAME: AvenirNextCondensed-Medium
  FONT NAME: AvenirNextCondensed-Regular
  FONT NAME: AvenirNextCondensed-HeavyItalic
  FONT NAME: AvenirNextCondensed-MediumItalic
  FONT NAME: AvenirNextCondensed-Italic
  FONT NAME: AvenirNextCondensed-UltraLightItalic
  FONT NAME: AvenirNextCondensed-UltraLight
  FONT NAME: AvenirNextCondensed-DemiBold
  FONT NAME: AvenirNextCondensed-Bold
  FONT NAME: AvenirNextCondensed-DemiBoldItalic
  FONT NAME: TamilSangamMN
  FONT NAME: TamilSangamMN-Bold
  FONT NAME: HelveticaNeue-Italic
  FONT NAME: HelveticaNeue-Bold
  FONT NAME: HelveticaNeue-UltraLight
  FONT NAME: HelveticaNeue-CondensedBlack
  FONT NAME: HelveticaNeue-BoldItalic
  FONT NAME: HelveticaNeue-CondensedBold
  FONT NAME: HelveticaNeue-Medium
  FONT NAME: HelveticaNeue-Light
  FONT NAME: HelveticaNeue-Thin
  FONT NAME: HelveticaNeue-ThinItalic
  FONT NAME: HelveticaNeue-LightItalic
  FONT NAME: HelveticaNeue-UltraLightItalic
  FONT NAME: HelveticaNeue-MediumItalic
  FONT NAME: HelveticaNeue
  FONT NAME: GurmukhiMN-Bold
  FONT NAME: GurmukhiMN
  FONT NAME: TimesNewRomanPSMT
  FONT NAME: TimesNewRomanPS-BoldItalicMT
  FONT NAME: TimesNewRomanPS-ItalicMT
  FONT NAME: TimesNewRomanPS-BoldMT
  FONT NAME: Georgia-BoldItalic
  FONT NAME: Georgia
  FONT NAME: Georgia-Italic
  FONT NAME: Georgia-Bold
  FONT NAME: AppleColorEmoji
  FONT NAME: ArialRoundedMTBold
  FONT NAME: Kailasa-Bold
  FONT NAME: Kailasa
  FONT NAME: KohinoorDevanagari-Light
  FONT NAME: KohinoorDevanagari-Regular
  FONT NAME: KohinoorDevanagari-Semibold
  FONT NAME: KohinoorBangla-Semibold
  FONT NAME: KohinoorBangla-Regular
  FONT NAME: KohinoorBangla-Light
  FONT NAME: ChalkboardSE-Bold
  FONT NAME: ChalkboardSE-Light
  FONT NAME: ChalkboardSE-Regular
  FONT NAME: SinhalaSangamMN-Bold
  FONT NAME: SinhalaSangamMN
  FONT NAME: PingFangTC-Medium
  FONT NAME: PingFangTC-Regular
  FONT NAME: PingFangTC-Light
  FONT NAME: PingFangTC-Ultralight
  FONT NAME: PingFangTC-Semibold
  FONT NAME: PingFangTC-Thin
  FONT NAME: GujaratiSangamMN-Bold
  FONT NAME: GujaratiSangamMN
  FONT NAME: DamascusLight
  FONT NAME: DamascusBold
  FONT NAME: DamascusSemiBold
  FONT NAME: DamascusMedium
  FONT NAME: Damascus
  FONT NAME: Noteworthy-Light
  FONT NAME: Noteworthy-Bold
  FONT NAME: GeezaPro
  FONT NAME: GeezaPro-Bold
  FONT NAME: Avenir-Medium
  FONT NAME: Avenir-HeavyOblique
  FONT NAME: Avenir-Book
  FONT NAME: Avenir-Light
  FONT NAME: Avenir-Roman
  FONT NAME: Avenir-BookOblique
  FONT NAME: Avenir-Black
  FONT NAME: Avenir-MediumOblique
  FONT NAME: Avenir-BlackOblique
  FONT NAME: Avenir-Heavy
  FONT NAME: Avenir-LightOblique
  FONT NAME: Avenir-Oblique
  FONT NAME: AcademyEngravedLetPlain
  FONT NAME: DiwanMishafi
  FONT NAME: Futura-CondensedMedium
  FONT NAME: Futura-CondensedExtraBold
  FONT NAME: Futura-Medium
  FONT NAME: Futura-MediumItalic
  FONT NAME: Farah
  FONT NAME: KannadaSangamMN
  FONT NAME: KannadaSangamMN-Bold
  FONT NAME: ArialHebrew-Bold
  FONT NAME: ArialHebrew-Light
  FONT NAME: ArialHebrew
  FONT NAME: ArialMT
  FONT NAME: Arial-BoldItalicMT
  FONT NAME: Arial-BoldMT
  FONT NAME: Arial-ItalicMT
  FONT NAME: PartyLetPlain
  FONT NAME: Chalkduster
  FONT NAME: HoeflerText-Italic
  FONT NAME: HoeflerText-Regular
  FONT NAME: HoeflerText-Black
  FONT NAME: HoeflerText-BlackItalic
  FONT NAME: Optima-Regular
  FONT NAME: Optima-ExtraBlack
  FONT NAME: Optima-BoldItalic
  FONT NAME: Optima-Italic
  FONT NAME: Optima-Bold
  FONT NAME: Palatino-Bold
  FONT NAME: Palatino-Roman
  FONT NAME: Palatino-BoldItalic
  FONT NAME: Palatino-Italic
  FONT NAME: LaoSangamMN
  FONT NAME: MalayalamSangamMN-Bold
  FONT NAME: MalayalamSangamMN
  FONT NAME: AlNile-Bold
  FONT NAME: AlNile
  FONT NAME: BradleyHandITCTT-Bold
  FONT NAME: PingFangHK-Ultralight
  FONT NAME: PingFangHK-Semibold
  FONT NAME: PingFangHK-Thin
  FONT NAME: PingFangHK-Light
  FONT NAME: PingFangHK-Regular
  FONT NAME: PingFangHK-Medium
  FONT NAME: Trebuchet-BoldItalic
  FONT NAME: TrebuchetMS
  FONT NAME: TrebuchetMS-Bold
  FONT NAME: TrebuchetMS-Italic
  FONT NAME: Helvetica-Bold
  FONT NAME: Helvetica
  FONT NAME: Helvetica-LightOblique
  FONT NAME: Helvetica-Oblique
  FONT NAME: Helvetica-BoldOblique
  FONT NAME: Helvetica-Light
  FONT NAME: Courier-BoldOblique
  FONT NAME: Courier
  FONT NAME: Courier-Bold
  FONT NAME: Courier-Oblique
  FONT NAME: Cochin-Bold
  FONT NAME: Cochin
  FONT NAME: Cochin-Italic
  FONT NAME: Cochin-BoldItalic
  FONT NAME: HiraMinProN-W6
  FONT NAME: HiraMinProN-W3
  FONT NAME: DevanagariSangamMN
  FONT NAME: DevanagariSangamMN-Bold
  FONT NAME: OriyaSangamMN
  FONT NAME: OriyaSangamMN-Bold
  FONT NAME: SnellRoundhand-Bold
  FONT NAME: SnellRoundhand
  FONT NAME: SnellRoundhand-Black
  FONT NAME: ZapfDingbatsITC
  FONT NAME: BodoniSvtyTwoITCTT-Bold
  FONT NAME: BodoniSvtyTwoITCTT-Book
  FONT NAME: BodoniSvtyTwoITCTT-BookIta
  FONT NAME: Verdana-Italic
  FONT NAME: Verdana-BoldItalic
  FONT NAME: Verdana
  FONT NAME: Verdana-Bold
  FONT NAME: AmericanTypewriter-CondensedLight
  FONT NAME: AmericanTypewriter
  FONT NAME: AmericanTypewriter-CondensedBold
  FONT NAME: AmericanTypewriter-Light
  FONT NAME: AmericanTypewriter-Bold
  FONT NAME: AmericanTypewriter-Condensed
  FONT NAME: AvenirNext-UltraLight
  FONT NAME: AvenirNext-UltraLightItalic
  FONT NAME: AvenirNext-Bold
  FONT NAME: AvenirNext-BoldItalic
  FONT NAME: AvenirNext-DemiBold
  FONT NAME: AvenirNext-DemiBoldItalic
  FONT NAME: AvenirNext-Medium
  FONT NAME: AvenirNext-HeavyItalic
  FONT NAME: AvenirNext-Heavy
  FONT NAME: AvenirNext-Italic
  FONT NAME: AvenirNext-Regular
  FONT NAME: AvenirNext-MediumItalic
  FONT NAME: Baskerville-Italic
  FONT NAME: Baskerville-SemiBold
  FONT NAME: Baskerville-BoldItalic
  FONT NAME: Baskerville-SemiBoldItalic
  FONT NAME: Baskerville-Bold
  FONT NAME: Baskerville
  FONT NAME: KhmerSangamMN
  FONT NAME: Didot-Italic
  FONT NAME: Didot-Bold
  FONT NAME: Didot
  FONT NAME: SavoyeLetPlain
  FONT NAME: BodoniOrnamentsITCTT
  FONT NAME: Symbol
  FONT NAME: Menlo-Italic
  FONT NAME: Menlo-Bold
  FONT NAME: Menlo-Regular
  FONT NAME: Menlo-BoldItalic
  FONT NAME: BodoniSvtyTwoSCITCTT-Book
  FONT NAME: Papyrus
  FONT NAME: Papyrus-Condensed
  FONT NAME: HiraginoSans-W3
  FONT NAME: HiraginoSans-W6
  FONT NAME: PingFangSC-Ultralight
  FONT NAME: PingFangSC-Regular
  FONT NAME: PingFangSC-Semibold
  FONT NAME: PingFangSC-Thin
  FONT NAME: PingFangSC-Light
  FONT NAME: PingFangSC-Medium
  FONT NAME: EuphemiaUCAS-Italic
  FONT NAME: EuphemiaUCAS
  FONT NAME: EuphemiaUCAS-Bold
  FONT NAME: Zapfino
  FONT NAME: BodoniSvtyTwoOSITCTT-Book
  FONT NAME: BodoniSvtyTwoOSITCTT-Bold
  FONT NAME: BodoniSvtyTwoOSITCTT-BookIt

빌드 후 iPhone에 설치 에러

정리 안됨! ㅎㅎ; ( 뭘 쓴 거지? ) 해결 방법 : 1. “키체인 접근.app” 에서 만료된(유효하지 않는) 인증서를 모두 삭제한다.

딴 얘기:

[!] Your Podfile has had smart quotes sanitised. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes in your editor of choice.